]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
extracted LPITEMIDLIST wrappers in a separate header (also [will be] used by wxStdnar...
[wxWidgets.git] / src / msw / choice.cpp
index 893d0ad9a2fa3ca6eeae2f31d8904e94a499d002..0848b2225127e52992cb10fcbb8751b650956e34 100644 (file)
@@ -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__)