diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2015-08-19 11:00:19 +0200 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2015-08-19 11:00:19 +0200 |
commit | 99c45aeb3a7432693224b086033f16da08cb2e75 (patch) | |
tree | 0a83a0ac1f1fd4cc426c5efc7a10c85857e20d86 /groupbox.go | |
parent | LineEdit: Add CaseMode (diff) | |
download | wireguard-windows-99c45aeb3a7432693224b086033f16da08cb2e75.tar.xz wireguard-windows-99c45aeb3a7432693224b086033f16da08cb2e75.zip |
GroupBox: Fix enabled handling
Diffstat (limited to 'groupbox.go')
-rw-r--r-- | groupbox.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/groupbox.go b/groupbox.go index de63178c..40cc9ba5 100644 --- a/groupbox.go +++ b/groupbox.go @@ -65,7 +65,7 @@ func NewGroupBox(parent Container) (*GroupBox, error) { gb.checkBox.SetChecked(true) gb.checkBox.CheckedChanged().Attach(func() { - gb.applyEnabled(gb.checkBox.Checked()) + gb.applyEnabledFromCheckBox(gb.checkBox.Checked()) }) setWindowVisible(gb.checkBox.hWnd, false) @@ -153,10 +153,22 @@ func (gb *GroupBox) ClientBounds() Rectangle { } func (gb *GroupBox) applyEnabled(enabled bool) { - if !gb.Checkable() { - gb.WidgetBase.applyEnabled(enabled) + gb.WidgetBase.applyEnabled(enabled) + + if gb.hWndGroupBox != 0 { + setWindowEnabled(gb.hWndGroupBox, enabled) + } + + if gb.checkBox != nil { + gb.checkBox.applyEnabled(enabled) } + if gb.composite != nil { + gb.composite.applyEnabled(enabled) + } +} + +func (gb *GroupBox) applyEnabledFromCheckBox(enabled bool) { if gb.hWndGroupBox != 0 { setWindowEnabled(gb.hWndGroupBox, enabled) } |