mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-11 05:51:47 +08:00
Fixed bug from issue #969
This commit is contained in:
parent
dc9a46b269
commit
fba1bf7afc
@ -199,7 +199,25 @@ namespace Slic3r { namespace GUI {
|
|||||||
}), temp->GetId());
|
}), temp->GetId());
|
||||||
#endif // __WXGTK__
|
#endif // __WXGTK__
|
||||||
|
|
||||||
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent) { on_change_field(); }), temp->GetId());
|
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent)
|
||||||
|
{
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
bool bChangedValueEvent = true;
|
||||||
|
#else
|
||||||
|
on_change_field();
|
||||||
|
#endif //__WXGTK__
|
||||||
|
}), temp->GetId());
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
temp->Bind(wxEVT_KEY_UP, [this](wxKeyEvent& event)
|
||||||
|
{
|
||||||
|
if (bChangedValueEvent) {
|
||||||
|
on_change_field();
|
||||||
|
bChangedValueEvent = false;
|
||||||
|
}
|
||||||
|
event.Skip();
|
||||||
|
});
|
||||||
|
#endif //__WXGTK__
|
||||||
|
|
||||||
// select all text using Ctrl+A
|
// select all text using Ctrl+A
|
||||||
temp->Bind(wxEVT_CHAR, ([temp](wxKeyEvent& event)
|
temp->Bind(wxEVT_CHAR, ([temp](wxKeyEvent& event)
|
||||||
|
@ -220,6 +220,9 @@ inline bool is_sizer_field(const t_field& obj) { return !is_bad_field(obj) && ob
|
|||||||
|
|
||||||
class TextCtrl : public Field {
|
class TextCtrl : public Field {
|
||||||
using Field::Field;
|
using Field::Field;
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
bool bChangedValueEvent = false;
|
||||||
|
#endif //__WXGTK__
|
||||||
public:
|
public:
|
||||||
TextCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
TextCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
||||||
TextCtrl(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
|
TextCtrl(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user