mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Enable/disable GUI controls according to the others in order to guide the user through option dependency
This commit is contained in:
parent
04b67f0cb0
commit
a06fad9e13
5 changed files with 207 additions and 16 deletions
|
@ -28,6 +28,11 @@ sub set_tooltip {
|
|||
if $tooltip && $self->can('SetToolTipString');
|
||||
}
|
||||
|
||||
sub toggle {
|
||||
my ($self, $enable) = @_;
|
||||
$enable ? $self->enable : $self->disable;
|
||||
}
|
||||
|
||||
sub _on_change {
|
||||
my ($self, $opt_id) = @_;
|
||||
|
||||
|
@ -80,6 +85,20 @@ sub get_value {
|
|||
return $self->wxWindow->GetValue;
|
||||
}
|
||||
|
||||
sub enable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->wxWindow->Enable;
|
||||
$self->wxWindow->Refresh;
|
||||
}
|
||||
|
||||
sub disable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->wxWindow->Disable;
|
||||
$self->wxWindow->Refresh;
|
||||
}
|
||||
|
||||
|
||||
package Slic3r::GUI::OptionsGroup::Field::Checkbox;
|
||||
use Moo;
|
||||
|
@ -154,6 +173,20 @@ sub BUILD {
|
|||
});
|
||||
}
|
||||
|
||||
sub enable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->wxWindow->Enable;
|
||||
$self->wxWindow->SetEditable(1);
|
||||
}
|
||||
|
||||
sub disable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->wxWindow->Disable;
|
||||
$self->wxWindow->SetEditable(0);
|
||||
}
|
||||
|
||||
|
||||
package Slic3r::GUI::OptionsGroup::Field::Choice;
|
||||
use Moo;
|
||||
|
@ -343,6 +376,20 @@ sub get_value {
|
|||
];
|
||||
}
|
||||
|
||||
sub enable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->x_textctrl->Enable;
|
||||
$self->y_textctrl->Enable;
|
||||
}
|
||||
|
||||
sub disable {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->x_textctrl->Disable;
|
||||
$self->y_textctrl->Disable;
|
||||
}
|
||||
|
||||
|
||||
package Slic3r::GUI::OptionsGroup::Field::Slider;
|
||||
use Moo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue