]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
Better alphabetized the event handler macros
[wxWidgets.git] / src / msw / choice.cpp
index 7faa959c51f06e78cbb7a15aff3729407ef048ab..0848b2225127e52992cb10fcbb8751b650956e34 100644 (file)
@@ -28,7 +28,7 @@
     #pragma hdrstop
 #endif
 
-#if wxUSE_CHOICE && !defined(__SMARTPHONE__)
+#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 && !__SMARTPHONE__
+#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)