OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::BBLStatusBarPrint Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/BBLStatusBarPrint.hpp>

Inheritance diagram for Slic3r::BBLStatusBarPrint:
Collaboration diagram for Slic3r::BBLStatusBarPrint:

Public Types

using CancelFn = std::function<void()>
 Cancel callback function type.

Public Member Functions

 BBLStatusBarPrint (wxWindow *parent=nullptr, int id=-1)
 ~BBLStatusBarPrint ()=default
int get_progress () const
void set_prog_block ()
void set_progress (int) override
int get_range () const override
void set_range (int=100) override
void clear_percent () override
void show_error_info (wxString msg, int code, wxString description, wxString extra) override
void show_progress (bool)
void start_busy (int=100)
void stop_busy ()
void set_cancel_callback_fina (BBLStatusBarPrint::CancelFn ccb)
bool is_busy () const
void set_cancel_callback (CancelFn=CancelFn()) override
void reset_cancel_callback ()
wxPanel * get_panel ()
bool is_english_text (wxString str)
bool format_text (wxStaticText *dc, int width, const wxString &text, wxString &multiline_text)
void set_status_text (const wxString &txt)
void set_percent_text (const wxString &txt)
void msw_rescale ()
void set_status_text (const std::string &txt)
void set_status_text (const char *txt) override
wxString get_status_text () const
void set_font (const wxFont &font)
void set_object_info (const wxString &txt)
void set_slice_info (const wxString &txt)
void show_slice_info (bool show)
bool is_slice_info_shown ()
bool update_status (wxString &msg, bool &was_cancel, int percent=-1, bool yield=true)
void reset ()
void show_cancel_button ()
void hide_cancel_button ()
void change_button_label (wxString name)
void disable_cancel_button ()
void enable_cancel_button ()

Private Attributes

wxPanel * m_self
wxGauge * m_prog
Label * m_link_show_error
wxBoxSizer * m_sizer_status_text
wxStaticBitmap * m_static_bitmap_show_error
wxBitmap m_bitmap_show_error_close
wxBitmap m_bitmap_show_error_open
Button * m_cancelbutton
wxStaticText * m_status_text
wxPanel * top_panel
wxStaticText * m_stext_percent
wxBoxSizer * m_sizer
wxBoxSizer * m_sizer_eline
wxWindow * block_left
wxWindow * block_right
bool m_show_error_info_state = false
bool m_busy = false
bool m_was_cancelled = false
CancelFn m_cancel_cb
CancelFn m_cancel_cb_fina

Detailed Description

Member Typedef Documentation

◆ CancelFn

using Slic3r::ProgressIndicator::CancelFn = std::function<void()>
inherited

Cancel callback function type.

Constructor & Destructor Documentation

◆ BBLStatusBarPrint()

Slic3r::BBLStatusBarPrint::BBLStatusBarPrint ( wxWindow * parent = nullptr,
int id = -1 )
31 : m_self{new wxPanel(parent, id == -1 ? wxID_ANY : id)}
32 , m_sizer(new wxBoxSizer(wxHORIZONTAL))
33{
34 m_self->SetBackgroundColour(*wxWHITE);
35 wxBoxSizer *m_sizer_body = new wxBoxSizer(wxVERTICAL);
36 wxBoxSizer *m_sizer_top = new wxBoxSizer(wxHORIZONTAL);
37 wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
38
39
40 top_panel = new wxPanel(m_self, wxID_ANY);
41 top_panel->SetBackgroundColour(*wxWHITE);
42 top_panel->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
43 top_panel->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
44
45 m_status_text = new wxStaticText(top_panel, wxID_ANY, wxEmptyString);
46 m_status_text->SetForegroundColour(wxColour(107, 107, 107));
47 m_status_text->SetMaxSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
48 m_status_text->SetMinSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
50
51 StateColor btn_bt_white(std::pair<wxColour, int>(wxColour(0x90, 0x90, 0x90), StateColor::Disabled),
52 std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
53 std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
54 std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
55
56 StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
57 std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
58
59
60 StateColor btn_txt_white(std::pair<wxColour, int>(wxColour("#FFFFFE"), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal));
61
62 m_cancelbutton = new Button(m_self, _L("Cancel"));
63 m_cancelbutton->SetMinSize(wxSize(m_self->FromDIP(80), m_self->FromDIP(32)));
64 m_cancelbutton->SetMaxSize(wxSize(m_self->FromDIP(80), m_self->FromDIP(32)));
65 m_cancelbutton->SetBackgroundColor(btn_bt_white);
66 m_cancelbutton->SetBorderColor(btn_bd_white);
67 m_cancelbutton->SetTextColor(btn_txt_white);
68 m_cancelbutton->SetCornerRadius(4);
69 m_cancelbutton->Bind(wxEVT_BUTTON,
70 [this](wxCommandEvent &evt) {
71 m_was_cancelled = true;
74 });
75
76 m_stext_percent = new wxStaticText(top_panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0);
77 m_stext_percent->SetForegroundColour(wxColour(107, 107, 107));
79 m_stext_percent->Wrap(-1);
80
81 m_sizer_status_text = new wxBoxSizer(wxHORIZONTAL);
82 m_link_show_error = new Label(top_panel, _L("Check the reason"));
83 m_link_show_error->SetForegroundColour(wxColour("#009688"));
85 m_link_show_error->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_HAND); });
86 m_link_show_error->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_ARROW); });
87
88 m_bitmap_show_error_close = create_scaled_bitmap("link_more_error_close", nullptr, 7);
89 m_bitmap_show_error_open = create_scaled_bitmap("link_more_error_open", nullptr, 7);
90 m_static_bitmap_show_error = new wxStaticBitmap(top_panel, wxID_ANY, m_bitmap_show_error_open, wxDefaultPosition, wxSize(m_self->FromDIP(7), m_self->FromDIP(7)));
91
92 m_link_show_error->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {this->m_self->SetCursor(wxCURSOR_HAND); });
93 m_link_show_error->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {this->m_self->SetCursor(wxCURSOR_ARROW); });
94 m_link_show_error->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
97 wxCommandEvent* evt = new wxCommandEvent(EVT_SHOW_ERROR_INFO);
98 wxQueueEvent(this->m_self->GetParent(), evt);
99 });
100
101
102 m_link_show_error->Hide();
104 m_static_bitmap_show_error->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {this->m_self->SetCursor(wxCURSOR_HAND); });
105 m_static_bitmap_show_error->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {this->m_self->SetCursor(wxCURSOR_ARROW); });
106 m_static_bitmap_show_error->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
109 wxCommandEvent* evt = new wxCommandEvent(EVT_SHOW_ERROR_INFO);
110 wxQueueEvent(this->m_self->GetParent(), evt);
111 });
112
113 m_sizer_status_text->Add(m_link_show_error, 0, wxALIGN_CENTER, 0);
114 m_sizer_status_text->Add(0, 0, 0, wxLEFT, top_panel->FromDIP(4));
115 m_sizer_status_text->Add(m_static_bitmap_show_error, 0, wxALIGN_CENTER, 0);
116
117
118 m_prog = new wxGauge(m_self, wxID_ANY, 100, wxDefaultPosition, wxSize(-1, m_self->FromDIP(6)), wxGA_HORIZONTAL);
119 m_prog->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(6)));
120 m_prog->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(6)));
121 m_prog->SetValue(0);
122
123 m_sizer_bottom->Add(m_prog, 1, wxALIGN_CENTER, 0);
124 m_sizer_bottom->Add(0, 0, 1, wxEXPAND, 0);
125
126
127 m_sizer_top->Add(m_status_text, 1, wxEXPAND, 0);
128 m_sizer_top->Add(0, 0, 1, wxEXPAND, 0);
129 m_sizer_top->Add(m_sizer_status_text, 0, wxALIGN_CENTER, 0);
130 m_sizer_top->Add(m_stext_percent, 0, wxEXPAND, 0);
131
132 top_panel->SetSizer(m_sizer_top);
133 top_panel->Layout();
134
135 m_sizer_body->Add(top_panel, 0, wxEXPAND, 0);
136 m_sizer_body->Add(m_sizer_bottom, 0, wxEXPAND, 0);
137 m_sizer_body->Add(0, 0, 1, wxEXPAND, 0);
138
139 wxBoxSizer *m_sizer_button = new wxBoxSizer(wxVERTICAL);
140 m_sizer_button->Add(m_cancelbutton, 0, wxALIGN_CENTER, 0);
141
142 m_sizer->Add(m_sizer_body, 1, wxALIGN_CENTER, 0);
143 m_sizer->Add(m_sizer_button, 0, wxALIGN_CENTER, 0);
144
145 m_self->SetSizer(m_sizer);
146 m_self->Layout();
147 m_sizer->Fit(m_self);
148}
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
class WXDLLIMPEXP_FWD_CORE wxGauge
Definition ProgressDialog.hpp:29
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_13
Definition Label.hpp:46
CancelFn m_cancel_cb_fina
Definition BBLStatusBarPrint.hpp:96
Button * m_cancelbutton
Definition BBLStatusBarPrint.hpp:39
wxStaticText * m_stext_percent
Definition BBLStatusBarPrint.hpp:42
wxBitmap m_bitmap_show_error_close
Definition BBLStatusBarPrint.hpp:37
Label * m_link_show_error
Definition BBLStatusBarPrint.hpp:34
wxStaticText * m_status_text
Definition BBLStatusBarPrint.hpp:40
wxBoxSizer * m_sizer_status_text
Definition BBLStatusBarPrint.hpp:35
wxPanel * top_panel
Definition BBLStatusBarPrint.hpp:41
wxPanel * m_self
Definition BBLStatusBarPrint.hpp:32
wxGauge * m_prog
Definition BBLStatusBarPrint.hpp:33
bool m_show_error_info_state
Definition BBLStatusBarPrint.hpp:92
wxBoxSizer * m_sizer
Definition BBLStatusBarPrint.hpp:43
wxStaticBitmap * m_static_bitmap_show_error
Definition BBLStatusBarPrint.hpp:36
bool m_was_cancelled
Definition BBLStatusBarPrint.hpp:94
wxBitmap m_bitmap_show_error_open
Definition BBLStatusBarPrint.hpp:38
@ Hovered
Definition StateColor.hpp:20
@ Normal
Definition StateColor.hpp:16
@ Disabled
Definition StateColor.hpp:22
@ Pressed
Definition StateColor.hpp:21
@ Enabled
Definition StateColor.hpp:17
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References _L, Label::Body_13, create_scaled_bitmap(), StateColor::Disabled, StateColor::Enabled, Label::Head_13, StateColor::Hovered, m_bitmap_show_error_close, m_bitmap_show_error_open, m_cancel_cb_fina, m_cancelbutton, m_link_show_error, m_prog, m_self, m_show_error_info_state, m_sizer, m_sizer_status_text, m_static_bitmap_show_error, m_status_text, m_stext_percent, m_was_cancelled, StateColor::Normal, StateColor::Pressed, top_panel, wxGauge, and wxStaticText.

Here is the call graph for this function:

◆ ~BBLStatusBarPrint()

Slic3r::BBLStatusBarPrint::~BBLStatusBarPrint ( )
default

Member Function Documentation

◆ change_button_label()

void Slic3r::BBLStatusBarPrint::change_button_label ( wxString name)
426{
427 m_cancelbutton->SetLabel(name);
428}

References m_cancelbutton.

◆ clear_percent()

void Slic3r::BBLStatusBarPrint::clear_percent ( )
overridevirtual

Implements Slic3r::ProgressIndicator.

187{
188 //set_percent_text(wxEmptyString);
189 if (!m_link_show_error->IsShown()) /*do not hide cancel if there are errors*/ {
190 m_cancelbutton->Hide();
191 }
192}

References m_cancelbutton, and m_link_show_error.

◆ disable_cancel_button()

void Slic3r::BBLStatusBarPrint::disable_cancel_button ( )
431{
432 m_cancelbutton->Disable();
433}

References m_cancelbutton.

◆ enable_cancel_button()

void Slic3r::BBLStatusBarPrint::enable_cancel_button ( )
436{
437 m_cancelbutton->Enable();
438}

References m_cancelbutton.

◆ format_text()

bool Slic3r::BBLStatusBarPrint::format_text ( wxStaticText * dc,
int width,
const wxString & text,
wxString & multiline_text )
288{
289 bool multiline = false;
290 multiline_text = text;
291 if (width > 0 && dc->GetTextExtent(text).x > width) {
292 size_t start = 0;
293 while (true) {
294 size_t idx = size_t(-1);
295 for (size_t i = start; i < multiline_text.Len(); i++) {
296 if (multiline_text[i] == ' ') {
297 if (dc->GetTextExtent(multiline_text.SubString(start, i)).x < width)
298 idx = i;
299 else {
300 if (idx == size_t(-1)) idx = i;
301 break;
302 }
303 }
304 }
305 if (idx == size_t(-1)) break;
306 multiline = true;
307 multiline_text[idx] = '\n';
308 start = idx + 1;
309 if (dc->GetTextExtent(multiline_text.Mid(start)).x < width) break;
310 }
311 }
312 return multiline;
313 //return dc->GetTextExtent(multiline_text);
314}

References wxStaticText.

◆ get_panel()

wxPanel * Slic3r::BBLStatusBarPrint::get_panel ( )
262{
263 return m_self;
264}

References m_self.

Referenced by set_status_text().

Here is the caller graph for this function:

◆ get_progress()

int Slic3r::BBLStatusBarPrint::get_progress ( ) const
155{
156 return m_prog->GetValue();
157}

References m_prog.

◆ get_range()

int Slic3r::BBLStatusBarPrint::get_range ( ) const
overridevirtual

Implements Slic3r::ProgressIndicator.

175{
176 return m_prog->GetRange();
177}

References m_prog.

◆ get_status_text()

wxString Slic3r::BBLStatusBarPrint::get_status_text ( ) const
371{
372 return m_status_text->GetLabelText();
373}

References m_status_text.

◆ hide_cancel_button()

void Slic3r::BBLStatusBarPrint::hide_cancel_button ( )
419{
420 m_sizer->Hide(m_cancelbutton);
421 m_cancelbutton->Hide();
422 m_sizer->Layout();
423}

References m_cancelbutton, and m_sizer.

Referenced by stop_busy().

Here is the caller graph for this function:

◆ is_busy()

bool Slic3r::BBLStatusBarPrint::is_busy ( ) const
inline
65{ return m_busy; }
bool m_busy
Definition BBLStatusBarPrint.hpp:93

References m_busy.

◆ is_english_text()

bool Slic3r::BBLStatusBarPrint::is_english_text ( wxString str)
267{
268 std::regex reg("^[0-9a-zA-Z]+$");
269 std::smatch matchResult;
270
271 std::string pattern_Special = "{}[]<>~!@#$%^&*(),.?/ :";
272 for (auto i = 0; i < str.Length(); i++) {
273 std::string regex_str = wxString(str[i]).ToStdString();
274 if (std::regex_match(regex_str, matchResult, reg)) {
275 continue;
276 }
277 else {
278 int result = pattern_Special.find(regex_str.c_str());
279 if (result < 0 || result > pattern_Special.length()) {
280 return false;
281 }
282 }
283 }
284 return true;
285}

◆ is_slice_info_shown()

bool Slic3r::BBLStatusBarPrint::is_slice_info_shown ( )

◆ msw_rescale()

void Slic3r::BBLStatusBarPrint::msw_rescale ( )
365 {
366 //set_prog_block();
367 m_cancelbutton->SetMinSize(wxSize(m_self->FromDIP(56), m_self->FromDIP(24)));
368}

References m_cancelbutton, and m_self.

◆ reset()

void Slic3r::BBLStatusBarPrint::reset ( )
388{
389 m_link_show_error->Hide();
391 m_prog->Show();
392 m_stext_percent->Show();
393 m_cancelbutton->Enable();
394 m_cancelbutton->Show();
395 m_was_cancelled = false;
396
397 top_panel->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
398 top_panel->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
399 m_status_text->SetMaxSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
400 m_status_text->SetMinSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
401
402 set_status_text("");
403 set_progress(0);
404 set_percent_text(wxString::Format("%d%%", 0));
405}
void set_percent_text(const wxString &txt)
Definition BBLStatusBarPrint.cpp:348
void set_status_text(const wxString &txt)
Definition BBLStatusBarPrint.cpp:317
void set_progress(int) override
Definition BBLStatusBarPrint.cpp:159

References m_cancelbutton, m_link_show_error, m_prog, m_self, m_static_bitmap_show_error, m_status_text, m_stext_percent, m_was_cancelled, set_percent_text(), set_progress(), set_status_text(), and top_panel.

Here is the call graph for this function:

◆ reset_cancel_callback()

void Slic3r::BBLStatusBarPrint::reset_cancel_callback ( )
inline
void set_cancel_callback(CancelFn=CancelFn()) override
Definition BBLStatusBarPrint.cpp:250

References set_cancel_callback().

Here is the call graph for this function:

◆ set_cancel_callback()

void Slic3r::BBLStatusBarPrint::set_cancel_callback ( BBLStatusBarPrint::CancelFn ccb = CancelFn())
overridevirtual

Implements Slic3r::ProgressIndicator.

250 {
251 /* m_cancel_cb = ccb;
252 if (ccb) {
253 m_sizer->Show(m_cancelbutton);
254 }
255 else {
256 m_sizer->Hide(m_cancelbutton);
257 }
258 m_sizer->Layout();*/
259}

Referenced by reset_cancel_callback().

Here is the caller graph for this function:

◆ set_cancel_callback_fina()

void Slic3r::BBLStatusBarPrint::set_cancel_callback_fina ( BBLStatusBarPrint::CancelFn ccb)
241{
242 m_cancel_cb_fina = ccb;
243 if (ccb) {
244 m_sizer->Show(m_cancelbutton);
245 } else {
246 m_sizer->Hide(m_cancelbutton);
247 }
248}

References m_cancel_cb_fina, m_cancelbutton, and m_sizer.

◆ set_font()

void Slic3r::BBLStatusBarPrint::set_font ( const wxFont & font)
408{
409 m_self->SetFont(font);
410}

References m_self.

◆ set_object_info()

void Slic3r::BBLStatusBarPrint::set_object_info ( const wxString & txt)

◆ set_percent_text()

void Slic3r::BBLStatusBarPrint::set_percent_text ( const wxString & txt)
349{
350 m_stext_percent->SetLabelText(txt);
351}

References m_stext_percent.

Referenced by reset(), and set_progress().

Here is the caller graph for this function:

◆ set_prog_block()

void Slic3r::BBLStatusBarPrint::set_prog_block ( )
151{
152}

◆ set_progress()

void Slic3r::BBLStatusBarPrint::set_progress ( int val)
overridevirtual

Implements Slic3r::ProgressIndicator.

160{
161 if(val < 0) return;
162
163 //add the logic for arrange/orient jobs, which don't call stop_busy
164 if (!m_prog->IsShown()) {
165 m_sizer->Show(m_prog);
166 m_sizer->Show(m_cancelbutton);
167 }
168 m_prog->SetValue(val);
169 set_percent_text(wxString::Format("%d%%", val));
170
171 m_sizer->Layout();
172}

References m_cancelbutton, m_prog, m_sizer, and set_percent_text().

Referenced by reset(), and update_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_range()

void Slic3r::BBLStatusBarPrint::set_range ( int val = 100)
overridevirtual

Implements Slic3r::ProgressIndicator.

180{
181 if(val != m_prog->GetRange()) {
182 m_prog->SetRange(val);
183 }
184}

References m_prog.

◆ set_slice_info()

void Slic3r::BBLStatusBarPrint::set_slice_info ( const wxString & txt)

◆ set_status_text() [1/3]

void Slic3r::BBLStatusBarPrint::set_status_text ( const char * txt)
overridevirtual

Implements Slic3r::ProgressIndicator.

359{
360 this->set_status_text(wxString::FromUTF8(txt));
361 get_panel()->GetParent()->Layout();
362 get_panel()->GetParent()->Update();
363}
wxPanel * get_panel()
Definition BBLStatusBarPrint.cpp:261

References get_panel(), and set_status_text().

Here is the call graph for this function:

◆ set_status_text() [2/3]

void Slic3r::BBLStatusBarPrint::set_status_text ( const std::string & txt)
354{
355 this->set_status_text(txt.c_str());
356}

References set_status_text().

Here is the call graph for this function:

◆ set_status_text() [3/3]

void Slic3r::BBLStatusBarPrint::set_status_text ( const wxString & txt)
318{
319 //auto txtss = "Sending the printing task has timed out.\nPlease try again!";
320 //auto txtss = "The printing project is being uploaded... 25%%";
321 //m_status_text->SetLabelText(txtss);
322 //wxString str;
323 //format_text(m_status_text, m_self->FromDIP(300), txt, str);
324
325 //if (m_status_text->GetTextExtent(txt).x > m_self->FromDIP(360)) {
326 // m_status_text->SetSize(m_self->FromDIP(360), m_self->FromDIP(40));
327 //}
328 //if (m_prog->IsShown()) {
329 // top_panel->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
330 // top_panel->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(26)));
331 // m_status_text->SetMaxSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
332 // m_status_text->SetMinSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(26)));
333 //} else {
334 // top_panel->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(32)));
335 // top_panel->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(32)));
336 // m_status_text->SetMaxSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(32)));
337 // m_status_text->SetMinSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(32)));
338 //}
339 m_status_text->SetLabelText(txt);
340 m_self->Layout();
341
342 //m_status_text->Wrap(m_self->FromDIP(360));
343 //m_status_text->Layout();
344 //m_self->Layout();
345 //if (is_english_text(str)) m_status_text->Wrap(m_self->FromDIP(280));
346}

References m_self, and m_status_text.

Referenced by reset(), set_status_text(), set_status_text(), show_error_info(), and update_status().

Here is the caller graph for this function:

◆ show_cancel_button()

void Slic3r::BBLStatusBarPrint::show_cancel_button ( )
413{
414 m_sizer->Show(m_cancelbutton);
415 m_sizer->Layout();
416}

References m_cancelbutton, and m_sizer.

Referenced by start_busy().

Here is the caller graph for this function:

◆ show_error_info()

void Slic3r::BBLStatusBarPrint::show_error_info ( wxString msg,
int code,
wxString description,
wxString extra )
overridevirtual

Implements Slic3r::ProgressIndicator.

195{
196 set_status_text(msg);
197 m_prog->Hide();
198 m_stext_percent->Hide();
199 m_link_show_error->Show();
201
202 top_panel->SetMinSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(32)));
203 top_panel->SetMaxSize(wxSize(m_self->FromDIP(550), m_self->FromDIP(32)));
204 m_status_text->SetMaxSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(32)));
205 m_status_text->SetMinSize(wxSize(m_self->FromDIP(400), m_self->FromDIP(32)));
206
207 m_cancelbutton->Show();
208 m_self->Layout();
209 m_sizer->Layout();
210}

References m_cancelbutton, m_link_show_error, m_prog, m_self, m_sizer, m_static_bitmap_show_error, m_status_text, m_stext_percent, set_status_text(), and top_panel.

Here is the call graph for this function:

◆ show_progress()

void Slic3r::BBLStatusBarPrint::show_progress ( bool show)
213{
214 if (show) {
215 m_sizer->Show(m_prog);
216 m_sizer->Layout();
217 }
218 else {
219 m_sizer->Hide(m_prog);
220 m_sizer->Layout();
221 }
222}

References m_prog, and m_sizer.

Referenced by start_busy(), and stop_busy().

Here is the caller graph for this function:

◆ show_slice_info()

void Slic3r::BBLStatusBarPrint::show_slice_info ( bool show)

◆ start_busy()

void Slic3r::BBLStatusBarPrint::start_busy ( int rate = 100)
225{
226 m_busy = true;
227 show_progress(true);
229}
void show_progress(bool)
Definition BBLStatusBarPrint.cpp:212
void show_cancel_button()
Definition BBLStatusBarPrint.cpp:412

References m_busy, show_cancel_button(), and show_progress().

Here is the call graph for this function:

◆ stop_busy()

void Slic3r::BBLStatusBarPrint::stop_busy ( )
232{
233 show_progress(false);
235 m_prog->SetValue(0);
236 m_sizer->Layout();
237 m_busy = false;
238}
void hide_cancel_button()
Definition BBLStatusBarPrint.cpp:418

References hide_cancel_button(), m_busy, m_prog, m_sizer, and show_progress().

Here is the call graph for this function:

◆ update_status()

bool Slic3r::BBLStatusBarPrint::update_status ( wxString & msg,
bool & was_cancel,
int percent = -1,
bool yield = true )
376{
377 set_status_text(msg);
378 if (percent >= 0)
379 this->set_progress(percent);
380
381 if (yield)
382 wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT);
383 was_cancel = m_was_cancelled;
384 return true;
385}

References m_was_cancelled, set_progress(), and set_status_text().

Here is the call graph for this function:

Member Data Documentation

◆ block_left

wxWindow* Slic3r::BBLStatusBarPrint::block_left
private

◆ block_right

wxWindow* Slic3r::BBLStatusBarPrint::block_right
private

◆ m_bitmap_show_error_close

wxBitmap Slic3r::BBLStatusBarPrint::m_bitmap_show_error_close
private

Referenced by BBLStatusBarPrint().

◆ m_bitmap_show_error_open

wxBitmap Slic3r::BBLStatusBarPrint::m_bitmap_show_error_open
private

Referenced by BBLStatusBarPrint().

◆ m_busy

bool Slic3r::BBLStatusBarPrint::m_busy = false
private

Referenced by is_busy(), start_busy(), and stop_busy().

◆ m_cancel_cb

CancelFn Slic3r::BBLStatusBarPrint::m_cancel_cb
private

◆ m_cancel_cb_fina

CancelFn Slic3r::BBLStatusBarPrint::m_cancel_cb_fina
private

◆ m_cancelbutton

◆ m_link_show_error

Label* Slic3r::BBLStatusBarPrint::m_link_show_error
private

◆ m_prog

◆ m_self

wxPanel* Slic3r::BBLStatusBarPrint::m_self
private

◆ m_show_error_info_state

bool Slic3r::BBLStatusBarPrint::m_show_error_info_state = false
private

Referenced by BBLStatusBarPrint().

◆ m_sizer

◆ m_sizer_eline

wxBoxSizer* Slic3r::BBLStatusBarPrint::m_sizer_eline
private

◆ m_sizer_status_text

wxBoxSizer* Slic3r::BBLStatusBarPrint::m_sizer_status_text
private

Referenced by BBLStatusBarPrint().

◆ m_static_bitmap_show_error

wxStaticBitmap* Slic3r::BBLStatusBarPrint::m_static_bitmap_show_error
private

◆ m_status_text

wxStaticText* Slic3r::BBLStatusBarPrint::m_status_text
private

◆ m_stext_percent

wxStaticText* Slic3r::BBLStatusBarPrint::m_stext_percent
private

◆ m_was_cancelled

bool Slic3r::BBLStatusBarPrint::m_was_cancelled = false
private

◆ top_panel

wxPanel* Slic3r::BBLStatusBarPrint::top_panel
private

The documentation for this class was generated from the following files: