Next try to fix bug with CheckBox selection if cursor is in SpinCtrl.
This commit is contained in:
parent
2eee3a64b7
commit
28b6d222f2
2 changed files with 4 additions and 3 deletions
|
@ -265,8 +265,8 @@ void SpinCtrl::BUILD() {
|
||||||
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
|
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
|
||||||
0, min_val, max_val, default_value);
|
0, min_val, max_val, default_value);
|
||||||
|
|
||||||
temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { tmp_value = undef_spin_val; on_change_field(); }), temp->GetId());
|
// temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { tmp_value = undef_spin_val; on_change_field(); }), temp->GetId());
|
||||||
temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { tmp_value = undef_spin_val; on_kill_focus(e); }), temp->GetId());
|
// temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { tmp_value = undef_spin_val; on_kill_focus(e); }), temp->GetId());
|
||||||
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e)
|
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e)
|
||||||
{
|
{
|
||||||
// # On OSX / Cocoa, wxSpinCtrl::GetValue() doesn't return the new value
|
// # On OSX / Cocoa, wxSpinCtrl::GetValue() doesn't return the new value
|
||||||
|
|
|
@ -203,7 +203,8 @@ public:
|
||||||
}
|
}
|
||||||
void set_value(boost::any value, bool change_event = false) {
|
void set_value(boost::any value, bool change_event = false) {
|
||||||
m_disable_change_event = !change_event;
|
m_disable_change_event = !change_event;
|
||||||
dynamic_cast<wxSpinCtrl*>(window)->SetValue(boost::any_cast<int>(value));
|
tmp_value = boost::any_cast<int>(value);
|
||||||
|
dynamic_cast<wxSpinCtrl*>(window)->SetValue(tmp_value/*boost::any_cast<int>(value)*/);
|
||||||
m_disable_change_event = false;
|
m_disable_change_event = false;
|
||||||
}
|
}
|
||||||
boost::any get_value() override {
|
boost::any get_value() override {
|
||||||
|
|
Loading…
Reference in a new issue