OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::LayerRangeEditor Class Reference

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

Inheritance diagram for Slic3r::GUI::LayerRangeEditor:
Collaboration diagram for Slic3r::GUI::LayerRangeEditor:

Public Member Functions

 LayerRangeEditor (ObjectLayers *parent, const wxString &value=wxEmptyString, EditorType type=etUndef, std::function< void(EditorType)> set_focus_data_fn=[](EditorType) {;}, std::function< bool(coordf_t, bool, bool)> edit_fn=[](coordf_t, bool, bool) {return false;})
 ~LayerRangeEditor ()
EditorType type () const
void set_focus_data () const
void SetValue (const wxString &value)
wxString GetValue ()
void msw_rescale ()
void Create (wxWindow *parent, wxString text, wxString label="", wxString icon="", const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
void SetCornerRadius (double radius)
int GetCornerRadius () const
void SetLabel (const wxString &label) override
void SetStaticTips (const wxString &tips, const wxBitmap &bitmap)
void SetIcon (const wxBitmap &icon)
void SetIcon (const wxString &icon)
void SetIcon_1 (const wxString &icon)
void SetIcon_1 (const wxBitmap &icon)
void SetLabelColor (StateColor const &color)
void SetTextColor (StateColor const &color)
virtual void Rescale ()
virtual bool Enable (bool enable=true) override
virtual void SetMinSize (const wxSize &size) override
wxTextCtrl * GetTextCtrl ()
wxTextCtrl const * GetTextCtrl () const

Protected Member Functions

virtual void OnEdit ()
virtual void DoSetSize (int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO) override
void DoSetToolTipText (wxString const &tip) override

Private Member Functions

coordf_t get_value ()
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void messureSize ()

Private Attributes

bool m_enter_pressed { false }
bool m_call_kill_focus { false }
wxString m_valid_value
EditorType m_type
std::function< void(EditorType)> m_set_focus_data
wxSize labelSize
ScalableBitmap icon
ScalableBitmap icon_1
StateColor label_color
StateColor text_color
wxTextCtrl * text_ctrl
wxString static_tips
wxSize static_tips_size
wxBitmap static_tips_icon

Static Private Attributes

static const int TextInputWidth = 200
static const int TextInputHeight = 50

Detailed Description

Constructor & Destructor Documentation

◆ LayerRangeEditor()

Slic3r::GUI::LayerRangeEditor::LayerRangeEditor ( ObjectLayers * parent,
const wxString & value = wxEmptyString,
EditorType type = etUndef,
std::function< void(EditorType)> set_focus_data_fn = [](EditorType) {;},
std::function< bool(coordf_t, bool, bool)> edit_fn = [](coordf_t, bool, bool) {return false; } )
368 :
369 m_valid_value(value),
370 m_type(type),
371 m_set_focus_data(set_focus_data_fn),
372 TextInput(parent->m_og->ctrl_parent(), value, _L("mm"), "", wxDefaultPosition, wxSize(em_unit(parent->m_parent), wxDefaultCoord), wxTE_PROCESS_ENTER)
373{
374 this->SetFont(wxGetApp().normal_font());
375 wxGetApp().UpdateDarkUI(this);
376
377 wxTextCtrl* ctrl = GetTextCtrl();
378
379 // Reset m_enter_pressed flag to _false_, when value is editing
380 ctrl->Bind(wxEVT_TEXT, [this](wxEvent&) { m_enter_pressed = false; }, ctrl->GetId());
381
382 ctrl->Bind(wxEVT_TEXT_ENTER, [this, edit_fn](wxCommandEvent& e)
383 {
384 m_enter_pressed = true;
385 // If LayersList wasn't updated/recreated, we can call wxEVT_KILL_FOCUS.Skip()
386 if (m_type&etLayerHeight) {
387 if (!edit_fn(get_value(), true, false))
389 else
391 m_call_kill_focus = true;
392 }
393 else if (!edit_fn(get_value(), true, false)) {
395 m_call_kill_focus = true;
396 }
397 }, ctrl->GetId());
398
399 ctrl->Bind(wxEVT_KILL_FOCUS, [this, edit_fn](wxFocusEvent& e)
400 {
401 if (!m_enter_pressed) {
402#ifndef __WXGTK__
403 /* Update data for next editor selection.
404 * But under GTK it looks like there is no information about selected control at e.GetWindow(),
405 * so we'll take it from wxEVT_LEFT_DOWN event
406 * */
407 LayerRangeEditor* new_editor = dynamic_cast<LayerRangeEditor*>(e.GetWindow());
408 if (new_editor)
409 new_editor->set_focus_data();
410#endif // not __WXGTK__
411 // If LayersList wasn't updated/recreated, we should call e.Skip()
412 if (m_type & etLayerHeight) {
413 if (!edit_fn(get_value(), false, dynamic_cast<ObjectLayers::PlusMinusButton*>(e.GetWindow()) != nullptr))
415 else
417 e.Skip();
418 }
419 else if (!edit_fn(get_value(), false, dynamic_cast<ObjectLayers::PlusMinusButton*>(e.GetWindow()) != nullptr)) {
421 e.Skip();
422 }
423 }
424 else if (m_call_kill_focus) {
425 m_call_kill_focus = false;
426 e.Skip();
427 }
428 }, ctrl->GetId());
429
430 ctrl->Bind(wxEVT_SET_FOCUS, [this, parent](wxFocusEvent& e)
431 {
433 parent->update_scene_from_editor_selection();
434 e.Skip();
435 }, ctrl->GetId());
436
437#ifdef __WXGTK__ // Workaround! To take information about selectable range
438 this->Bind(wxEVT_LEFT_DOWN, [this](wxEvent& e)
439 {
441 e.Skip();
442 }, this->GetId());
443#endif //__WXGTK__
444
445 this->Bind(wxEVT_CHAR, ([this](wxKeyEvent& event)
446 {
447 // select all text using Ctrl+A
448 if (wxGetKeyState(wxKeyCode('A')) && wxGetKeyState(WXK_CONTROL))
449 GetTextCtrl()->SetSelection(-1, -1); //select all
450 event.Skip();
451 }));
452}
#define _L(s)
Definition OBJ.cpp:34
bool m_call_kill_focus
Definition GUI_ObjectLayers.hpp:42
wxString m_valid_value
Definition GUI_ObjectLayers.hpp:43
coordf_t get_value()
Definition GUI_ObjectLayers.cpp:454
EditorType type() const
Definition GUI_ObjectLayers.hpp:58
LayerRangeEditor(ObjectLayers *parent, const wxString &value=wxEmptyString, EditorType type=etUndef, std::function< void(EditorType)> set_focus_data_fn=[](EditorType) {;}, std::function< bool(coordf_t, bool, bool)> edit_fn=[](coordf_t, bool, bool) {return false;})
Definition GUI_ObjectLayers.cpp:363
std::function< void(EditorType)> m_set_focus_data
Definition GUI_ObjectLayers.hpp:46
void set_focus_data() const
Definition GUI_ObjectLayers.hpp:59
bool m_enter_pressed
Definition GUI_ObjectLayers.hpp:41
EditorType m_type
Definition GUI_ObjectLayers.hpp:44
void SetValue(const wxString &value)
Definition GUI_ObjectLayers.hpp:60
TextInput()
Definition TextInput.cpp:37
wxTextCtrl * GetTextCtrl()
Definition TextInput.hpp:76
wxString double_to_string(double const value, const int max_precision)
Definition Field.cpp:99
@ etLayerHeight
Definition GUI_ObjectLayers.hpp:36
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References LayerRangeEditor(), TextInput::TextInput(), _L, Slic3r::GUI::double_to_string(), em_unit(), Slic3r::GUI::etLayerHeight, get_value(), TextInput::GetTextCtrl(), m_call_kill_focus, m_enter_pressed, m_set_focus_data, m_type, m_valid_value, set_focus_data(), SetValue(), type(), and Slic3r::GUI::ObjectLayers::update_scene_from_editor_selection().

Referenced by LayerRangeEditor().

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

◆ ~LayerRangeEditor()

Slic3r::GUI::LayerRangeEditor::~LayerRangeEditor ( )
inline
56{}

Member Function Documentation

◆ Create()

void TextInput::Create ( wxWindow * parent,
wxString text,
wxString label = "",
wxString icon = "",
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0 )
inherited
70{
71 text_ctrl = nullptr;
72 StaticBox::Create(parent, wxID_ANY, pos, size, style);
73 wxWindow::SetLabel(label);
74 assert((style & wxRIGHT) == 0);
75 style &= ~wxALIGN_MASK;
76 state_handler.attach({&label_color, & text_color});
77 state_handler.update_binds();
78 text_ctrl = new TextCtrl(this, wxID_ANY, text, {4, 4}, wxDefaultSize, style | wxBORDER_NONE | wxTE_PROCESS_ENTER);
79
80#ifdef __WXGTK__
81 Slic3r::GUI::RemoveInputBorder(text_ctrl);
82#endif
83
84 text_ctrl->SetFont(Label::Body_14);
85 text_ctrl->SetInitialSize(text_ctrl->GetBestSize());
86 text_ctrl->SetBackgroundColour(background_color.colorForStates(state_handler.states()));
87 text_ctrl->SetForegroundColour(text_color.colorForStates(state_handler.states()));
88 state_handler.attach_child(text_ctrl);
89 text_ctrl->Bind(wxEVT_KILL_FOCUS, [this](auto &e) {
90 OnEdit();
91 e.SetId(GetId());
92 ProcessEventLocally(e);
93 e.Skip();
94 });
95 text_ctrl->Bind(wxEVT_TEXT_ENTER, [this](auto &e) {
96 OnEdit();
97 e.SetId(GetId());
98 ProcessEventLocally(e);
99 });
100 text_ctrl->Bind(wxEVT_RIGHT_DOWN, [](auto &e) {}); // disable context menu
101 if (!icon.IsEmpty()) {
102 this->icon = ScalableBitmap(this, icon.ToStdString(), 16);
103 }
104 messureSize();
105}
wxTextCtrl TextCtrl
Definition TextCtrl.h:14
#define style
Definition WipeTowerDialog.cpp:101
static wxFont Body_14
Definition Label.hpp:53
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
Definition StaticBox.cpp:51
void messureSize()
Definition TextInput.cpp:343
virtual void OnEdit()
Definition TextInput.hpp:81
StateColor text_color
Definition TextInput.hpp:21
StateColor label_color
Definition TextInput.hpp:20
wxTextCtrl * text_ctrl
Definition TextInput.hpp:22
ScalableBitmap icon
Definition TextInput.hpp:18

References Label::Body_14, StaticBox::Create(), icon, label_color, messureSize(), OnEdit(), style, text_color, and text_ctrl.

Referenced by ComboBox::ComboBox(), and TextInput().

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

◆ DoSetSize()

void TextInput::DoSetSize ( int x,
int y,
int width,
int height,
int sizeFlags = wxSIZE_AUTO )
overrideprotectedvirtualinherited
211{
212 wxWindow::DoSetSize(x, y, width, height, sizeFlags);
213 if (sizeFlags & wxSIZE_USE_EXISTING) return;
214 wxSize size = GetSize();
215 wxPoint textPos = {5, 0};
216 if (this->icon.bmp().IsOk()) {
217 wxSize szIcon = this->icon.GetBmpSize();
218 textPos.x += szIcon.x;
219 }
220 if (this->icon_1.bmp().IsOk()) {
221 wxSize szIcon = this->icon_1.GetBmpSize();
222 textPos.x += (szIcon.x);
223 }
224 bool align_right = GetWindowStyle() & wxALIGN_RIGHT;
225 if (align_right)
226 textPos.x += labelSize.x;
227 if (text_ctrl) {
228 wxSize textSize = text_ctrl->GetSize();
229 textSize.x = size.x - textPos.x - labelSize.x - 10;
230 if(textSize.x < -1) textSize.x = -1;
231 text_ctrl->SetSize(textSize);
232 text_ctrl->SetPosition({textPos.x, (size.y - textSize.y) / 2});
233 }
234}
wxSize labelSize
Definition TextInput.hpp:17
ScalableBitmap icon_1
Definition TextInput.hpp:19

References icon, icon_1, labelSize, and text_ctrl.

◆ DoSetToolTipText()

void TextInput::DoSetToolTipText ( wxString const & tip)
overrideprotectedinherited
237{
238 wxWindow::DoSetToolTipText(tip);
239 text_ctrl->SetToolTip(tip);
240}

References text_ctrl.

◆ Enable()

bool TextInput::Enable ( bool enable = true)
overridevirtualinherited
186{
187 bool result = text_ctrl->Enable(enable) && wxWindow::Enable(enable);
188 if (result) {
189 wxCommandEvent e(EVT_ENABLE_CHANGED);
190 e.SetEventObject(this);
191 GetEventHandler()->ProcessEvent(e);
192 text_ctrl->SetBackgroundColour(background_color.colorForStates(state_handler.states()));
193 text_ctrl->SetForegroundColour(text_color.colorForStates(state_handler.states()));
194 }
195 return result;
196}

References text_color, and text_ctrl.

◆ get_value()

coordf_t Slic3r::GUI::LayerRangeEditor::get_value ( )
private
455{
456 wxString str = GetValue();
457
459 const char dec_sep = is_decimal_separator_point() ? '.' : ',';
460 const char dec_sep_alt = dec_sep == '.' ? ',' : '.';
461 // Replace the first incorrect separator in decimal number.
462 if (str.Replace(dec_sep_alt, dec_sep, false) != 0)
463 SetValue(str);
464
465 if (str == ".")
466 layer_height = 0.0;
467 else {
468 if (!str.ToDouble(&layer_height) || layer_height < 0.0f) {
469 show_error(m_parent, _L("Invalid numeric."));
470 SetValue(m_valid_value); // reset to a valid value
471 }
472 }
473
474 return layer_height;
475}
wxString GetValue()
Definition GUI_ObjectLayers.hpp:61
static std::string layer_height
Definition Tab.cpp:4294
void show_error(wxWindow *parent, const wxString &message, bool has_code_excerpts)
Definition GUI.cpp:296
double coordf_t
Definition GUI_ObjectLayers.hpp:26
bool is_decimal_separator_point()
Definition LocalesUtils.cpp:78

References _L, GetValue(), Slic3r::is_decimal_separator_point(), Slic3r::GUI::layer_height, m_valid_value, SetValue(), and Slic3r::GUI::show_error().

Referenced by LayerRangeEditor().

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

◆ GetCornerRadius()

int TextInput::GetCornerRadius ( ) const
inlineinherited
54{ return static_cast<int>(radius); }

Referenced by CustomWidgetsPlugin::addTextInputProps().

Here is the caller graph for this function:

◆ GetTextCtrl() [1/2]

wxTextCtrl * TextInput::GetTextCtrl ( )
inlineinherited

◆ GetTextCtrl() [2/2]

wxTextCtrl const * TextInput::GetTextCtrl ( ) const
inlineinherited
78{ return text_ctrl; }

References text_ctrl.

◆ GetValue()

wxString Slic3r::GUI::LayerRangeEditor::GetValue ( )
inline
61{return GetTextCtrl()->GetValue();}

References TextInput::GetTextCtrl().

Referenced by get_value().

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

◆ messureSize()

void TextInput::messureSize ( )
privateinherited
344{
345 wxSize size = GetSize();
346 wxClientDC dc(this);
347 bool align_right = GetWindowStyle() & wxALIGN_RIGHT;
348 if (align_right)
349 dc.SetFont(GetFont());
350 else
351 dc.SetFont(Label::Body_12);
352 labelSize = dc.GetTextExtent(wxWindow::GetLabel());
353 wxSize textSize = text_ctrl->GetSize();
354
355 if (!static_tips.empty()) {
356 static_tips_size = dc.GetTextExtent(static_tips);
357 textSize.x = std::max(labelSize.GetWidth(), static_tips_size.GetWidth());
358 textSize.y += static_tips_size.y;
359 textSize.y += 8;
360 }
361
362 int h = textSize.y + 8;
363 if (size.y < h) {
364 size.y = h;
365 }
366
367 wxSize minSize = size;
368 minSize.x = GetMinWidth();
369 SetMinSize(minSize);
370 SetSize(size);
371}
static wxFont Body_12
Definition Label.hpp:55
wxSize static_tips_size
Definition TextInput.hpp:25
virtual void SetMinSize(const wxSize &size) override
Definition TextInput.cpp:198
wxString static_tips
Definition TextInput.hpp:24

References Label::Body_12, labelSize, SetMinSize(), static_tips, static_tips_size, and text_ctrl.

Referenced by Create(), Rescale(), SetLabel(), and SetStaticTips().

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

◆ msw_rescale()

void Slic3r::GUI::LayerRangeEditor::msw_rescale ( )
478{
479 Rescale();
480}
virtual void Rescale()
Definition TextInput.cpp:175

References TextInput::Rescale().

Referenced by Slic3r::GUI::ObjectLayers::msw_rescale().

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

◆ OnEdit()

virtual void TextInput::OnEdit ( )
inlineprotectedvirtualinherited
81{}

Referenced by Create().

Here is the caller graph for this function:

◆ paintEvent()

void TextInput::paintEvent ( wxPaintEvent & evt)
privateinherited
243{
244 // depending on your system you may need to look at double-buffered dcs
245 wxPaintDC dc(this);
246 render(dc);
247}
void render(wxDC &dc)
Definition TextInput.cpp:254

References render().

Here is the call graph for this function:

◆ render()

void TextInput::render ( wxDC & dc)
privateinherited
255{
257 int states = state_handler.states();
258 wxSize size = GetSize();
259 bool align_center = GetWindowStyle() & wxALIGN_CENTER_HORIZONTAL;
260 bool align_right = GetWindowStyle() & wxALIGN_RIGHT;
261 // start draw
262 wxPoint pt = {5, 0};
263 if (icon.bmp().IsOk()) {
264 wxSize szIcon = icon.GetBmpSize();
265 pt.y = (size.y - szIcon.y) / 2;
266 if (align_center) {
267 if (pt.x * 2 + szIcon.x + 0 + labelSize.x < size.x)
268 pt.x = (size.x - (szIcon.x + 0 + labelSize.x)) / 2;
269 }
270 dc.DrawBitmap(icon.bmp(), pt);
271 pt.x += (szIcon.x + szIcon.x * 0.2);
272 }
273 if (icon_1.bmp().IsOk()) {
274 wxSize szIcon = icon_1.GetBmpSize();
275 pt.y = (size.y - szIcon.y) / 2;
276 if (align_center) {
277 if (pt.x * 2 + szIcon.x + 0 + labelSize.x < size.x)
278 pt.x = (size.x - (szIcon.x + 0 + labelSize.x)) / 2;
279 }
280 pt.x += szIcon.x / 4.f;
281 dc.DrawBitmap(icon_1.bmp(), pt);
282 pt.x += szIcon.x + 0;
283 }
284 auto text = wxWindow::GetLabel();
285 if (!text.IsEmpty()) {
286 if (static_tips.IsEmpty()) {
287 wxSize textSize = text_ctrl->GetSize();
288 if (align_right || align_center)
289 {
290 if (pt.x + labelSize.x + 5 > size.x)
291 text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END, size.x - pt.x - 5);
292 pt.y = (size.y - labelSize.y) / 2;
293 }
294 else
295 {
296 pt.x += textSize.x;
297 pt.y = (size.y + textSize.y) / 2 - labelSize.y;
298 }
299 dc.SetTextForeground(label_color.colorForStates(states));
300 if(align_right)
301 dc.SetFont(GetFont());
302 else
303 dc.SetFont(Label::Body_12);
304 dc.DrawText(text, pt);
305 } else {
306 wxSize textSize = text_ctrl->GetSize();
307 if (align_right || align_center) {
308 if (pt.x + labelSize.x + 5 > size.x)
309 text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END, size.x - pt.x - 5);
310 pt.y = (size.y - labelSize.y - static_tips_size.y - 8) / 2;
311 } else {
312 pt.x += textSize.x;
313 pt.y = (size.y - labelSize.y - static_tips_size.y - 8) / 2;
314 }
315 dc.SetTextForeground(label_color.colorForStates(states));
316 if(align_right)
317 dc.SetFont(GetFont());
318 else
319 dc.SetFont(Label::Body_12);
320 dc.DrawText(text, pt);
321
322 if (align_right || align_center) {
323 if (pt.x + static_tips_size.x + 5 > size.x) {
324 text = wxControl::Ellipsize(static_tips, dc, wxELLIPSIZE_END, size.x - pt.x - 5);
325 }
326
327 pt.y += (labelSize.y + 8);
328 } else {
329 pt.x += static_tips_size.x;
330 pt.y += (labelSize.y + 8);
331 }
332
333 dc.SetTextForeground(wxColour(144, 144, 144));
334
335 wxFont font = GetFont();
336 font.SetPointSize(font.GetPointSize() - 1);// use smaller font
337 dc.SetFont(font);
338 dc.DrawText(static_tips, pt);
339 }
340 }
341}
void render(wxDC &dc)
Definition StaticBox.cpp:181

References Label::Body_12, icon, icon_1, label_color, labelSize, StaticBox::render(), static_tips, static_tips_size, and text_ctrl.

Referenced by paintEvent().

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

◆ Rescale()

void TextInput::Rescale ( )
virtualinherited
176{
177 if (!this->icon.name().empty())
178 this->icon.msw_rescale();
179 if (!this->icon_1.name().empty())
180 this->icon_1.msw_rescale();
181 messureSize();
182 Refresh();
183}

References icon, icon_1, and messureSize().

Referenced by Slic3r::GUI::LayerRangeEditor::msw_rescale(), ComboBox::Rescale(), SetIcon(), SetIcon(), SetIcon_1(), and SetIcon_1().

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

◆ set_focus_data()

void Slic3r::GUI::LayerRangeEditor::set_focus_data ( ) const
inline

References m_set_focus_data, and m_type.

Referenced by LayerRangeEditor().

Here is the caller graph for this function:

◆ SetCornerRadius()

void TextInput::SetCornerRadius ( double radius)
inherited
108{
109 this->radius = radius;
110 Refresh();
111}

Referenced by CustomWidgetsPlugin::addTextInputProps().

Here is the caller graph for this function:

◆ SetIcon() [1/2]

void TextInput::SetIcon ( const wxBitmap & icon)
inherited
129{
130 this->icon = ScalableBitmap();
131 this->icon.bmp() = icon;
132 Rescale();
133}

References icon, and Rescale().

Here is the call graph for this function:

◆ SetIcon() [2/2]

void TextInput::SetIcon ( const wxString & icon)
inherited
136{
137 if (this->icon.name() == icon.ToStdString())
138 return;
139 this->icon = ScalableBitmap(this, icon.ToStdString(), 16);
140 Rescale();
141}

References icon, and Rescale().

Here is the call graph for this function:

◆ SetIcon_1() [1/2]

void TextInput::SetIcon_1 ( const wxBitmap & icon)
inherited
156 {
157 this->icon_1 = ScalableBitmap();
158 if (icon.IsOk())
159 this->icon_1.bmp() = icon;
160 Rescale();
161}

References icon, icon_1, and Rescale().

Here is the call graph for this function:

◆ SetIcon_1() [2/2]

void TextInput::SetIcon_1 ( const wxString & icon)
inherited
143 {
144 if (this->icon_1.name() == icon.ToStdString())
145 return;
146 if (icon.empty()) {
147 this->icon_1 = ScalableBitmap();
148 return;
149 }
150 this->icon_1 = ScalableBitmap(this, icon.ToStdString(), 14);
151 Rescale();
152}

References icon, icon_1, and Rescale().

Referenced by ComboBox::SetLabel().

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

◆ SetLabel()

void TextInput::SetLabel ( const wxString & label)
overrideinherited
114{
115 wxWindow::SetLabel(label);
116 messureSize();
117 Refresh();
118}

References messureSize().

Referenced by CustomWidgetsPlugin::addTextInputProps(), ComboBox::SetLabel(), and ComboBox::SetTextLabel().

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

◆ SetLabelColor()

void TextInput::SetLabelColor ( StateColor const & color)
inherited
164{
165 label_color = color;
166 state_handler.update_binds();
167}

References label_color.

Referenced by ComboBox::ComboBox().

Here is the caller graph for this function:

◆ SetMinSize()

void TextInput::SetMinSize ( const wxSize & size)
overridevirtualinherited
199{
200 wxSize size2 = size;
201 if (size2.y < 0) {
202#ifdef __WXMAC__
203 if (GetPeer()) // peer is not ready in Create on mac
204#endif
205 size2.y = GetSize().y;
206 }
207 wxWindow::SetMinSize(size2);
208}

Referenced by messureSize().

Here is the caller graph for this function:

◆ SetStaticTips()

void TextInput::SetStaticTips ( const wxString & tips,
const wxBitmap & bitmap )
inherited
121{
122 static_tips = tips;
123 static_tips_icon = bitmap;
124 messureSize();
125 Refresh();
126}
wxBitmap static_tips_icon
Definition TextInput.hpp:26

References messureSize(), static_tips, and static_tips_icon.

Here is the call graph for this function:

◆ SetTextColor()

void TextInput::SetTextColor ( StateColor const & color)
inherited
170{
171 text_color= color;
172 state_handler.update_binds();
173}

References text_color.

◆ SetValue()

void Slic3r::GUI::LayerRangeEditor::SetValue ( const wxString & value)
inline
60{GetTextCtrl()->SetValue(value);}

References TextInput::GetTextCtrl().

Referenced by LayerRangeEditor(), and get_value().

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

◆ type()

EditorType Slic3r::GUI::LayerRangeEditor::type ( ) const
inline
58{return m_type;}

References m_type.

Referenced by LayerRangeEditor().

Here is the caller graph for this function:

Member Data Documentation

◆ icon

ScalableBitmap TextInput::icon
privateinherited

◆ icon_1

ScalableBitmap TextInput::icon_1
privateinherited

◆ label_color

StateColor TextInput::label_color
privateinherited

◆ labelSize

wxSize TextInput::labelSize
privateinherited

Referenced by DoSetSize(), messureSize(), and render().

◆ m_call_kill_focus

bool Slic3r::GUI::LayerRangeEditor::m_call_kill_focus { false }
private
42{ false };

Referenced by LayerRangeEditor().

◆ m_enter_pressed

bool Slic3r::GUI::LayerRangeEditor::m_enter_pressed { false }
private
41{ false };

Referenced by LayerRangeEditor().

◆ m_set_focus_data

std::function<void(EditorType)> Slic3r::GUI::LayerRangeEditor::m_set_focus_data
private

Referenced by LayerRangeEditor(), and set_focus_data().

◆ m_type

EditorType Slic3r::GUI::LayerRangeEditor::m_type
private

◆ m_valid_value

wxString Slic3r::GUI::LayerRangeEditor::m_valid_value
private

Referenced by LayerRangeEditor(), and get_value().

◆ static_tips

wxString TextInput::static_tips
privateinherited

Referenced by messureSize(), render(), and SetStaticTips().

◆ static_tips_icon

wxBitmap TextInput::static_tips_icon
privateinherited

Referenced by SetStaticTips().

◆ static_tips_size

wxSize TextInput::static_tips_size
privateinherited

Referenced by messureSize(), and render().

◆ text_color

StateColor TextInput::text_color
privateinherited

◆ text_ctrl

wxTextCtrl* TextInput::text_ctrl
privateinherited

◆ TextInputHeight

const int TextInput::TextInputHeight = 50
staticprivateinherited

◆ TextInputWidth

const int TextInput::TextInputWidth = 200
staticprivateinherited

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