X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02b7b6b072762ff1e02950109a751815ac7429fd..6bb09706724534c42465f9ecf46a4a7e7ff08c30:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 893d0ad9a2..0848b22251 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -28,7 +28,7 @@ #pragma hdrstop #endif -#if wxUSE_CHOICE +#if wxUSE_CHOICE && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) #ifndef WX_PRECOMP #include "wx/choice.h" @@ -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); @@ -601,4 +620,4 @@ WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED( return (WXHBRUSH)brush->GetResourceHandle(); } -#endif // wxUSE_CHOICE +#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)