]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
wxPaletteBase introduction. wxPalette::GetColoursCount() in interface of all platform...
[wxWidgets.git] / src / msw / radiobox.cpp
index e490720610941a6f0f39f03a28f11a4a0bc6f963..d583c4f33710ff238969ff5d8fab8ae359f771ac 100644 (file)
     #include "wx/tooltip.h"
 #endif // wxUSE_TOOLTIPS
 
+#if defined(__WXWINCE__) && !defined(WS_EX_TRANSPARENT)
+#define WS_EX_TRANSPARENT 0
+#endif
+
 // TODO: wxCONSTRUCTOR
 #if 0 // wxUSE_EXTENDED_RTTI
 WX_DEFINE_FLAGS( wxRadioBoxStyle )
@@ -276,7 +280,7 @@ bool wxRadioBox::Create(wxWindow *parent,
 
     // create the static box
     if ( !MSWCreateControl(wxT("BUTTON"), BS_GROUPBOX | WS_GROUP,
-                           pos, size, title, 0) )
+                           pos, size, title, WS_EX_TRANSPARENT) )
         return false;
 
     // and now create the buttons
@@ -831,11 +835,23 @@ bool wxRadioBox::SetFont(const wxFont& font)
 
 WXLRESULT wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
 {
+#if RADIOBTN_PARENT_IS_RADIOBOX
     switch ( nMsg )
     {
+        // handle this message to set correct colours for our buttons here
         case WM_CTLCOLORSTATIC:
-            return (WXLRESULT)GetStockObject(WHITE_BRUSH);
+            {
+                WXHDC hdc;
+                WXHWND hwnd;
+                UnpackCtlColor(wParam, lParam, &hdc, &hwnd);
+
+                WXHBRUSH hbr = MSWControlColor((WXHDC)hdc);
+                if ( hbr )
+                    return (WXLRESULT)hbr;
+                //else: fall through to default window proc
+            }
     }
+#endif // RADIOBTN_PARENT_IS_RADIOBOX
 
     return wxControl::MSWWindowProc(nMsg, wParam, lParam);
 }