mirror of https://github.com/PCSX2/pcsx2.git
utilities: Fix CheckedStaticBox behaviour
Avoid enabling the child windows when SetValue is called if the window is currently disabled. Also continue processing the checkbox event after it has been handled, which allows the event to propagate to the parent window.
This commit is contained in:
parent
ff68ad61e7
commit
629bb23832
|
@ -35,6 +35,7 @@ CheckedStaticBox::CheckedStaticBox(wxWindow *parent, int orientation, const wxSt
|
|||
void CheckedStaticBox::MainToggle_Click(wxCommandEvent &evt)
|
||||
{
|
||||
SetValue(evt.IsChecked());
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
// Sets the main checkbox status, and enables/disables all child controls
|
||||
|
@ -46,7 +47,7 @@ void CheckedStaticBox::SetValue(bool val)
|
|||
for (wxWindowList::iterator iter = list.begin(); iter != list.end(); ++iter) {
|
||||
wxWindow *current = *iter;
|
||||
if (current != &ThisToggle)
|
||||
current->Enable(val);
|
||||
current->Enable(IsEnabled() && val);
|
||||
}
|
||||
ThisToggle.SetValue(val);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue