Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-01-08 18:05:49 +0300
committerYuSanka <yusanka@gmail.com>2019-01-08 18:06:58 +0300
commit6efcdd1ddf5bd57b110370cc314f275cded3fb2d (patch)
tree89cd4960ccd6375abf554d0767a330945bb54b75 /src/slic3r/GUI/Field.hpp
parent2ccdfe68531265a51f6f5a7a8788cdbdf765b74f (diff)
Added wxEVT_TEXT_ENTER handling for TextCtrl, SpinCtrl & PointCtrl (but it doesn't work under OSX) (fix of #1518)
Diffstat (limited to 'src/slic3r/GUI/Field.hpp')
-rw-r--r--src/slic3r/GUI/Field.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp
index 4a19b6103..bcc94c7ba 100644
--- a/src/slic3r/GUI/Field.hpp
+++ b/src/slic3r/GUI/Field.hpp
@@ -74,7 +74,7 @@ protected:
/// Call the attached on_kill_focus method.
//! It's important to use wxEvent instead of wxFocusEvent,
//! in another case we can't unfocused control at all
- void on_kill_focus(wxEvent& event);
+ void on_kill_focus();
/// Call the attached on_change method.
void on_set_focus(wxEvent& event);
/// Call the attached on_change method.
@@ -226,6 +226,8 @@ protected:
// current value
boost::any m_value;
+
+ bool bEnterPressed = false;
friend class OptionsGroup;
};
@@ -252,6 +254,8 @@ public:
~TextCtrl() {}
void BUILD();
+ // Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
+ void propagate_value();
wxWindow* window {nullptr};
virtual void set_value(const std::string& value, bool change_event = false) {
@@ -310,6 +314,8 @@ public:
wxWindow* window{ nullptr };
void BUILD() override;
+ /// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
+ void propagate_value() ;
void set_value(const std::string& value, bool change_event = false) {
m_disable_change_event = !change_event;
@@ -393,8 +399,8 @@ public:
wxTextCtrl* y_textctrl{ nullptr };
void BUILD() override;
-
- void OnKillFocus(wxEvent& e, wxTextCtrl* win);
+ // Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
+ void propagate_value(wxTextCtrl* win);
void set_value(const Vec2d& value, bool change_event = false);
void set_value(const boost::any& value, bool change_event = false);
boost::any& get_value() override;