]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/statbox.cpp
fix showing keyboard cues under Win2k/XP
[wxWidgets.git] / src / os2 / statbox.cpp
index 16a28e6c60194eb9be24a1d9bb644c1fb2ae3fc1..cb5a1b6aa0e7802e06546adc270b44e7f54d75e8 100644 (file)
@@ -34,16 +34,14 @@ bool wxStaticBox::Create(
 , const wxString&                   rsName
 )
 {
-    if(!OS2CreateControl( pParent
-                         ,vId
-                         ,rPos
-                         ,rSize
-                         ,lStyle
-#if wxUSE_VALIDATORS
-                         ,wxDefaultValidator
-#endif
-                         ,rsName
-                        ))
+    if(!CreateControl( pParent
+                      ,vId
+                      ,rPos
+                      ,rSize
+                      ,lStyle
+                      ,wxDefaultValidator
+                      ,rsName
+                     ))
     {
         return FALSE;
     }
@@ -51,7 +49,7 @@ bool wxStaticBox::Create(
     wxPoint                         vPos(0,0);
     wxSize                          vSize(0,0);
 
-    if (!OS2CreateControl( "STATIC"
+    if (!OS2CreateControl( wxT("STATIC")
                           ,SS_GROUPBOX
                           ,vPos
                           ,vSize
@@ -61,9 +59,14 @@ bool wxStaticBox::Create(
         return FALSE;
     }
 
+    //
+    // To be transparent we should have the same colour as the parent as well
+    //
+    SetBackgroundColour(GetParent()->GetBackgroundColour());
+
     wxColour                        vColour;
 
-    vColour.Set(wxString("BLACK"));
+    vColour.Set(wxString(wxT("BLACK")));
 
     LONG                            lColor = (LONG)vColour.GetPixel();
 
@@ -72,7 +75,14 @@ bool wxStaticBox::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    SetFont(pParent->GetFont());
+    lColor = (LONG)m_backgroundColour.GetPixel();
+
+    ::WinSetPresParam( m_hWnd
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    SetFont(*wxSMALL_FONT);
     SetSize( rPos.x
             ,rPos.y
             ,rSize.x
@@ -86,11 +96,12 @@ wxSize wxStaticBox::DoGetBestSize() const
     int                             nCx;
     int                             nCy;
     int                             wBox;
+    wxFont                          vFont = GetFont();
 
     wxGetCharSize( GetHWND()
                   ,&nCx
                   ,&nCy
-                  ,(wxFont*)&GetFont()
+                  ,&vFont
                  );
     GetTextExtent( wxGetWindowText(m_hWnd)
                   ,&wBox