From ccc94f46e0e44963388a55b5f78d72006521a0d7 Mon Sep 17 00:00:00 2001 From: Joost Nieuwenhuijse Date: Fri, 25 Sep 2015 08:56:20 +0200 Subject: [PATCH] Fix wxSlider getting disabled after changing color in wxMSW The changes of f88585b4ab538dc638094aa4ba04bda848add9fa 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 --- src/msw/slider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 2afb961fd2..551bb169be 100644 --- a/src/msw/slider.cpp +++ b/src/msw/slider.cpp @@ -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;