From: Vadim Zeitlin Date: Fri, 10 Sep 2004 20:36:50 +0000 (+0000) Subject: make background colour apply to choice/combobox dropdown listbox as well as the main... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f499e61407a950d2b2568556b100630998f1581c make background colour apply to choice/combobox dropdown listbox as well as the main part (patch 1023669) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 6c437c0f75..c45e203de8 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -269,6 +269,7 @@ wxMSW: - fixed wxTextCtrl::SetMaxLength for rich edit controls - fixed flat style for toolbars under XP, Windows Classic style - fixed truncation of transferred data in wxConnection under unicode build +- wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei) wxUniv/X11: diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 7faa959c51..1ebacc20e4 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -539,18 +539,37 @@ wxSize wxChoice::DoGetBestSize() const WXLRESULT wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { - if ( nMsg == WM_LBUTTONUP ) + switch ( nMsg ) { - int x = (int)LOWORD(lParam); - int y = (int)HIWORD(lParam); - - // Ok, this is truly weird, but if a panel with a wxChoice loses the - // focus, then you get a *fake* WM_LBUTTONUP message with x = 65535 and - // y = 65535. Filter out this nonsense. - // - // VZ: I'd like to know how to reproduce this please... - if ( x == 65535 && y == 65535 ) - return 0; + case WM_LBUTTONUP: + { + int x = (int)LOWORD(lParam); + int y = (int)HIWORD(lParam); + + // Ok, this is truly weird, but if a panel with a wxChoice + // loses the focus, then you get a *fake* WM_LBUTTONUP message + // with x = 65535 and y = 65535. Filter out this nonsense. + // + // VZ: I'd like to know how to reproduce this please... + if ( x == 65535 && y == 65535 ) + return 0; + } + break; + + // we have to handle both: one for the normal case and the other + // for readonly + case WM_CTLCOLOREDIT: + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLORSTATIC: + { + WXWORD nCtlColor; + WXHDC hdc; + WXHWND hwnd; + UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd); + + return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, + nMsg, wParam, lParam); + } } return wxWindow::MSWWindowProc(nMsg, wParam, lParam);