]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/radiobox.cpp
react to the year being changed in the spin control text zone and not only with the...
[wxWidgets.git] / src / os2 / radiobox.cpp
index fa32d2ccadc66792b342bd71625eed1ded32314c..4e979893404f558ca39366d95885ee1ba795621f 100644 (file)
@@ -264,7 +264,11 @@ bool wxRadioBox::Create(
     // System fonts are too big in OS/2 and they are blue
     // We want smaller fonts and black by default.
     //
     // System fonts are too big in OS/2 and they are blue
     // We want smaller fonts and black by default.
     //
-    wxFont&                         rFont = *wxSMALL_FONT;
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
     wxColour                        vColour;
     LONG                            lColor;
 
     wxColour                        vColour;
     LONG                            lColor;
 
@@ -279,22 +283,26 @@ bool wxRadioBox::Create(
     //
     // Common initialization
     //
     //
     // Common initialization
     //
-    if (!OS2CreateControl( pParent
-                          ,vId
-                          ,rPos
-                          ,rSize
-                          ,lStyle
+    if (!CreateControl( pParent
+                       ,vId
+                       ,rPos
+                       ,rSize
+                       ,lStyle
 #if wxUSE_VALIDATORS
 #if wxUSE_VALIDATORS
-                          ,rVal
+                       ,rVal
 #endif
 #endif
-                          ,rsName
-                         ))
+                       ,rsName
+                      ))
 
 
 
 
     if (!OS2CreateControl( "STATIC"
 
 
 
 
     if (!OS2CreateControl( "STATIC"
-                          ,SS_GROUPBOX | WS_GROUP
+#if RADIOBTN_PARENT_IS_RADIOBOX
+                          ,SS_GROUPBOX | WS_GROUP | WS_CLIPCHILDREN
+#else
+                          ,SS_GROUPBOX | WS_GROUP | WS_CLIPSIBLINGS
+#endif
                           ,rPos
                           ,rSize
                           ,rsTitle
                           ,rPos
                           ,rSize
                           ,rsTitle
@@ -315,9 +323,9 @@ bool wxRadioBox::Create(
     m_pnRadioWidth   = new int[nNum];
     m_pnRadioHeight  = new int[nNum];
 
     m_pnRadioWidth   = new int[nNum];
     m_pnRadioHeight  = new int[nNum];
 
-    if (rFont.Ok())
+    if (pTextFont->Ok())
     {
     {
-        hFont = rFont.GetResourceHandle();
+        hFont = pTextFont->GetResourceHandle();
     }
 
     for (int i = 0; i < nNum; i++)
     }
 
     for (int i = 0; i < nNum; i++)
@@ -341,11 +349,19 @@ bool wxRadioBox::Create(
                                                                          ,NULL
                                                                          ,NULL
                                                                         );
                                                                          ,NULL
                                                                          ,NULL
                                                                         );
+        lColor = (LONG)vColour.GetPixel();
         ::WinSetPresParam( hWndBtn
                           ,PP_FOREGROUNDCOLOR
                           ,sizeof(LONG)
                           ,(PVOID)&lColor
                          );
         ::WinSetPresParam( hWndBtn
                           ,PP_FOREGROUNDCOLOR
                           ,sizeof(LONG)
                           ,(PVOID)&lColor
                          );
+        lColor = (LONG)m_backgroundColour.GetPixel();
+
+        ::WinSetPresParam( hWndBtn
+                          ,PP_BACKGROUNDCOLOR
+                          ,sizeof(LONG)
+                          ,(PVOID)&lColor
+                         );
         if (!hWndBtn)
         {
             return FALSE;
         if (!hWndBtn)
         {
             return FALSE;
@@ -353,7 +369,7 @@ bool wxRadioBox::Create(
         m_ahRadioButtons[i] = (WXHWND)hWndBtn;
         SubclassRadioButton((WXHWND)hWndBtn);
         wxOS2SetFont( hWndBtn
         m_ahRadioButtons[i] = (WXHWND)hWndBtn;
         SubclassRadioButton((WXHWND)hWndBtn);
         wxOS2SetFont( hWndBtn
-                     ,rFont
+                     ,*pTextFont
                     );
         ::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
         m_aSubControls.Add(nNewId);
                     );
         ::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
         m_aSubControls.Add(nNewId);
@@ -373,18 +389,27 @@ bool wxRadioBox::Create(
                              ,NULL
                              ,NULL
                             );
                              ,NULL
                              ,NULL
                             );
-     SetFont(*wxSMALL_FONT);
+    SetFont(*pTextFont);
+    lColor = (LONG)vColour.GetPixel();
     ::WinSetPresParam( m_hWnd
                       ,PP_FOREGROUNDCOLOR
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
     ::WinSetPresParam( m_hWnd
                       ,PP_FOREGROUNDCOLOR
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
+    lColor = (LONG)m_backgroundColour.GetPixel();
+
+    ::WinSetPresParam( m_hWnd
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
     SetSelection(0);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
             ,rSize.y
            );
     SetSelection(0);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
             ,rSize.y
            );
+    delete pTextFont;
     return TRUE;
 } // end of wxRadioBox::Create
 
     return TRUE;
 } // end of wxRadioBox::Create