mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-20 23:34:27 +08:00
Minor improvement to extruder count field
This commit is contained in:
parent
4402dfa6f3
commit
6c53b14ee4
@ -137,6 +137,7 @@ sub BUILD {
|
|||||||
$self->wxWindow($field);
|
$self->wxWindow($field);
|
||||||
|
|
||||||
EVT_SPINCTRL($self->parent, $field, sub {
|
EVT_SPINCTRL($self->parent, $field, sub {
|
||||||
|
$self->tmp_value(undef);
|
||||||
$self->_on_change($self->option->opt_id);
|
$self->_on_change($self->option->opt_id);
|
||||||
});
|
});
|
||||||
EVT_TEXT($self->parent, $field, sub {
|
EVT_TEXT($self->parent, $field, sub {
|
||||||
@ -147,11 +148,14 @@ sub BUILD {
|
|||||||
# gets the old one, and on_kill_focus resets the control to the old value.
|
# gets the old one, and on_kill_focus resets the control to the old value.
|
||||||
# As a workaround, we get the new value from $event->GetString and store
|
# As a workaround, we get the new value from $event->GetString and store
|
||||||
# here temporarily so that we can return it from $self->get_value
|
# here temporarily so that we can return it from $self->get_value
|
||||||
$self->tmp_value($event->GetString);
|
$self->tmp_value($event->GetString) if $event->GetString =~ /^\d+$/;
|
||||||
$self->_on_change($self->option->opt_id);
|
$self->_on_change($self->option->opt_id);
|
||||||
$self->tmp_value(undef);
|
# We don't reset tmp_value here because _on_change might put callbacks
|
||||||
|
# in the CallAfter queue, and we want the tmp value to be available from
|
||||||
|
# them as well.
|
||||||
});
|
});
|
||||||
EVT_KILL_FOCUS($field, sub {
|
EVT_KILL_FOCUS($field, sub {
|
||||||
|
$self->tmp_value(undef);
|
||||||
$self->_on_kill_focus($self->option->opt_id, @_);
|
$self->_on_kill_focus($self->option->opt_id, @_);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user