]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/frame.cpp
Menuing and statusbar updates
[wxWidgets.git] / src / os2 / frame.cpp
index 261c01de4c463f1609e61793bba9ab7b99ee574d..f0a4438e1653a9eaf3eab3eead15dfdc0d08dadc 100644 (file)
@@ -30,6 +30,7 @@
     #include "wx/dialog.h"
     #include "wx/settings.h"
     #include "wx/dcclient.h"
+    #include "wx/mdi.h"
 #endif // WX_PRECOMP
 
 #include "wx/os2/private.h"
@@ -52,7 +53,6 @@
 
 extern wxWindowList wxModelessWindows;
 extern wxList WXDLLEXPORT wxPendingDelete;
-extern const wxChar* wxFrameClassName;
 
 #if wxUSE_MENUS_NATIVE
 extern wxMenu *wxCurrentPopupMenu;
@@ -144,7 +144,6 @@ bool wxFrame::Create(
                                   ,rsName
                                  ))
         return FALSE;
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
     wxModelessWindows.Append(this);
     return TRUE;
 } // end of wxFrame::Create
@@ -211,21 +210,6 @@ void wxFrame::Raise()
                      );
 }
 
-// generate an artificial resize event
-void wxFrame::SendSizeEvent()
-{
-    if (!m_bIconized)
-    {
-        RECTL                       vRect = wxGetWindowRect(GetHwnd());
-
-        (void)::WinPostMsg( m_hFrame
-                           ,WM_SIZE
-                           ,MPFROM2SHORT(vRect.xRight - vRect.xLeft, vRect.yTop - vRect.yBottom)
-                           ,MPFROM2SHORT(vRect.xRight - vRect.xLeft, vRect.yTop - vRect.yBottom)
-                          );
-    }
-}
-
 #if wxUSE_STATUSBAR
 wxStatusBar* wxFrame::OnCreateStatusBar(
   int                               nNumber
@@ -248,6 +232,26 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
     if( !pStatusBar )
         return NULL;
 
+    wxClientDC                      vDC(pStatusBar);
+    int                             nY;
+
+    //
+    // Set the height according to the font and the border size
+    //
+    vDC.SetFont(pStatusBar->GetFont()); // Screws up the menues for some reason
+    vDC.GetTextExtent( "X"
+                      ,NULL
+                      ,&nY
+                     );
+
+    int                             nHeight = ((11 * nY) / 10 + 2 * pStatusBar->GetBorderY());
+
+    pStatusBar->SetSize( -1
+                        ,-1
+                        ,-1
+                        ,nHeight
+                       );
+
     ::WinSetParent( pStatusBar->GetHWND()
                    ,m_hFrame
                    ,FALSE
@@ -449,7 +453,7 @@ void wxFrame::OnSysColourChanged(
   wxSysColourChangedEvent&          rEvent
 )
 {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
     Refresh();
 
 #if wxUSE_STATUSBAR
@@ -919,9 +923,10 @@ bool wxFrame::HandlePaint()
             //
             // Icons in PM are the same as "pointers"
             //
+            const wxIcon&           vIcon = GetIcon();
             HPOINTER                hIcon;
 
-            if (m_icon.Ok())
+            if (vIcon.Ok())
                 hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L);
             else
                 hIcon = (HPOINTER)m_hDefaultIcon;
@@ -1075,7 +1080,6 @@ bool wxFrame::HandleSize(
 
         vEvent.SetEventObject(this);
         bProcessed = GetEventHandler()->ProcessEvent(vEvent);
-        AlterChildPos();
     }
     return bProcessed;
 } // end of wxFrame::HandleSize
@@ -1376,9 +1380,10 @@ MRESULT wxFrame::OS2WindowProc(
 
         case CM_QUERYDRAGIMAGE:
             {
+                const wxIcon&           vIcon = GetIcon();
                 HPOINTER                hIcon;
 
-                if (m_icon.Ok())
+                if (vIcon.Ok())
                     hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
                 else
                     hIcon = (HPOINTER)m_hDefaultIcon;