]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/frame.cpp
*** empty log message ***
[wxWidgets.git] / src / os2 / frame.cpp
index 0adff13a4b31c3183e648f5ba0ee6f13eb187328..50a4cea7f16a8502c71ddc6a791ceffd9036a824 100644 (file)
@@ -339,30 +339,45 @@ void wxFrame::DoGetPosition(
 // ----------------------------------------------------------------------------
 
 void wxFrame::DoShowWindow(
-  int                               nShowCmd
+  int                               bShowCmd
 )
 {
-    ::WinShowWindow(GetHwnd(), nShowCmd);
-    m_bIconized = nShowCmd == SWP_MINIMIZE;
+    HWND                            hClient;
+
+    //
+    // Send anything to initialize the frame
+    //
+    ::WinSendMsg( GetHwnd()
+                 ,WM_UPDATEFRAME
+                 ,(MPARAM)FCF_MENU
+                 ,(MPARAM)0
+                );
+    hClient = ::WinWindowFromID(GetHwnd(), FID_CLIENT);
+    ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
+    ::WinShowWindow(hClient, (BOOL)bShowCmd);
 } // end of wxFrame::DoShowWindow
 
 bool wxFrame::Show(
   bool                              bShow
 )
 {
-    DoShowWindow(bShow ? SWP_SHOW : SWP_HIDE);
+    SWP                             vSwp;
+
+    DoShowWindow((int)bShow);
 
     if (bShow)
     {
         wxActivateEvent             vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
 
+        ::WinQueryWindowPos(GetHwnd(), &vSwp);
+        m_bIconized = vSwp.fl & SWP_MINIMIZE;
         ::WinSetWindowPos( (HWND) GetHWND()
                           ,HWND_TOP
-                          ,0
-                          ,0
-                          ,0
-                          ,0
-                          ,SWP_ZORDER
+                          ,vSwp.x
+                          ,vSwp.y
+                          ,vSwp.cx
+                          ,vSwp.cy
+                          ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
                          );
         vEvent.SetEventObject(this);
         GetEventHandler()->ProcessEvent(vEvent);
@@ -376,14 +391,16 @@ bool wxFrame::Show(
         {
             HWND                    hWndParent = GetHwndOf(GetParent());
 
+            ::WinQueryWindowPos(hWndParent, &vSwp);
+            m_bIconized = vSwp.fl & SWP_MINIMIZE;
             if (hWndParent)
                 ::WinSetWindowPos( hWndParent
                                   ,HWND_TOP
-                                  ,0
-                                  ,0
-                                  ,0
-                                  ,0
-                                  ,SWP_ZORDER
+                                  ,vSwp.x
+                                  ,vSwp.y
+                                  ,vSwp.cx
+                                  ,vSwp.cy
+                                  ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
                                  );
         }
     }
@@ -438,11 +455,11 @@ void wxFrame::SetIcon(
 {
     wxFrameBase::SetIcon(rIcon);
 
-    if (m_icon.Ok())
+    if ((m_icon.GetHICON()) != NULLHANDLE)
     {
         ::WinSendMsg( GetHwnd()
                      ,WM_SETICON
-                     ,(MPARAM)((HICON)m_icon.GetHICON())
+                     ,(MPARAM)((HPOINTER)m_icon.GetHICON())
                      ,NULL
                     );
         ::WinSendMsg( GetHwnd()
@@ -841,6 +858,14 @@ bool wxFrame::OS2Create(
     {
         return FALSE;
     }
+    //
+    // Send anything to initialize the frame
+    //
+    ::WinSendMsg( GetHwnd()
+                 ,WM_UPDATEFRAME
+                 ,(MPARAM)FCF_TASKLIST
+                 ,(MPARAM)0
+                );
 
     //
     // Now size everything.  If adding a menu the client will need to be resized.
@@ -881,6 +906,7 @@ bool wxFrame::OS2Create(
                            ,SWP_SIZE | SWP_MOVE
                           ))
         return FALSE;
+    WinQueryWindowPos(hClient, &vSwp);
     return TRUE;
 } // end of wxFrame::OS2Create