Fix wxSlider getting disabled after changing color in wxMSW

The changes of f88585b4ab could result in
wxSlider getting disabled when its background colours was changed because
wxWindow::IsEnabled() could return false if the control was currently disabled
because its parent was disabled, for example -- but wxSlider wouldn't get
enabled back even after the parent was enabled.

Closes #12271.

Closes https://github.com/wxWidgets/wxWidgets/pull/103
This commit is contained in:
Joost Nieuwenhuijse
2015-09-25 08:56:20 +02:00
committed by Vadim Zeitlin
parent 00c63cfd3a
commit ccc94f46e0

View File

@@ -580,7 +580,7 @@ WXHBRUSH wxSlider::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
// Anything really refreshing the slider would work here, we use a
// dummy WM_ENABLE but using TBM_SETPOS would work too, for example.
::PostMessage(hWnd, WM_ENABLE, (BOOL)IsEnabled(), 0);
::PostMessage(hWnd, WM_ENABLE, ::IsWindowEnabled(hWnd), 0);
}
return hBrush;