]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/frame.cpp
Better compatibility with old files when creating an image cache
[wxWidgets.git] / src / os2 / frame.cpp
index 53860bb6e7f1cb5599d373cc849e76dcd66a66f4..a872743ea25db80e4632936fd3b381a8e37258f2 100644 (file)
@@ -52,8 +52,6 @@ BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
     EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
 END_EVENT_TABLE()
 
-IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
-
 // ============================================================================
 // implementation
 // ============================================================================
@@ -127,7 +125,8 @@ bool wxFrame::Create( wxWindow*       pParent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 } // end of wxFrame::~wxFrame
 
@@ -280,7 +279,7 @@ void wxFrame::PositionStatusBar()
         {
             vError = ::WinGetLastError(vHabmain);
             sError = wxPMErrorToStr(vError);
-            wxLogError(_T("Error setting parent for StatusBar. Error: %s\n"), sError.c_str());
+            wxLogError(wxT("Error setting parent for StatusBar. Error: %s\n"), sError.c_str());
             return;
         }
     }
@@ -404,14 +403,14 @@ void wxFrame::InternalSetMenuBar()
     {
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
-        wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
+        wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
     }
 
     if (!::WinSetOwner(m_hMenu, m_hFrame))
     {
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
-        wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
+        wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
     }
     ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
 } // end of wxFrame::InternalSetMenuBar
@@ -433,7 +432,7 @@ void wxFrame::OnSysColourChanged(
         wxSysColourChangedEvent     vEvent2;
 
         vEvent2.SetEventObject(m_frameStatusBar);
-        m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2);
+        m_frameStatusBar->HandleWindowEvent(vEvent2);
     }
 #endif //wxUSE_STATUSBAR
 
@@ -499,7 +498,7 @@ bool wxFrame::ShowFullScreen( bool bShow, long lStyle )
         if ((lStyle & wxFULLSCREEN_NOSTATUSBAR) && pTheStatusBar)
         {
             m_nFsStatusBarFields = pTheStatusBar->GetFieldsCount();
-            SetStatusBar((wxStatusBar*) NULL);
+            SetStatusBar(NULL);
             delete pTheStatusBar;
         }
         else
@@ -570,7 +569,7 @@ bool wxFrame::ShowFullScreen( bool bShow, long lStyle )
         wxSize sz( nWidth, nHeight );
         wxSizeEvent vEvent( sz, GetId() );
 
-        GetEventHandler()->ProcessEvent(vEvent);
+        HandleWindowEvent(vEvent);
         return true;
     }
     else
@@ -853,7 +852,7 @@ bool wxFrame::HandlePaint()
             const wxIcon&           vIcon = GetIcon();
             HPOINTER                hIcon;
 
-            if (vIcon.Ok())
+            if (vIcon.IsOk())
                 hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L);
             else
                 hIcon = (HPOINTER)m_hDefaultIcon;
@@ -1051,7 +1050,7 @@ bool wxFrame::HandleMenuSelect( WXWORD nItem,
             wxMenuEvent                     vEvent(wxEVT_MENU_HIGHLIGHT, nItem);
 
             vEvent.SetEventObject(this);
-            GetEventHandler()->ProcessEvent(vEvent); // return value would be ignored by PM
+            HandleWindowEvent(vEvent); // return value would be ignored by PM
         }
         else
         {
@@ -1072,9 +1071,8 @@ MRESULT EXPENTRY wxFrameMainWndProc( HWND   hWnd,
 {
     MRESULT  rc = (MRESULT)0;
     bool     bProcessed = false;
-    wxFrame* pWnd  = NULL;
 
-    pWnd = (wxFrame*) wxFindWinFromHandle((WXHWND) hWnd);
+    wxFrame* pWnd  = (wxFrame*) wxFindWinFromHandle((WXHWND) hWnd);
     switch (ulMsg)
     {
         case WM_QUERYFRAMECTLCOUNT:
@@ -1303,7 +1301,7 @@ MRESULT wxFrame::OS2WindowProc( WXUINT uMessage,
                 const wxIcon&           vIcon = GetIcon();
                 HPOINTER                hIcon;
 
-                if (vIcon.Ok())
+                if (vIcon.IsOk())
                     hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
                 else
                     hIcon = (HPOINTER)m_hDefaultIcon;
@@ -1379,20 +1377,3 @@ wxWindow* wxFrame::GetClient()
     return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT));
 }
 
-void wxFrame::SendSizeEvent()
-{
-    if (!m_bIconized)
-    {
-        RECTL                       vRect = wxGetWindowRect(GetHwnd());
-
-        ::WinPostMsg( GetHwnd()
-                     ,WM_SIZE
-                     ,MPFROM2SHORT( vRect.xRight - vRect.xLeft
-                                   ,vRect.xRight - vRect.xLeft
-                                  )
-                     ,MPFROM2SHORT( vRect.yTop - vRect.yBottom
-                                   ,vRect.yTop - vRect.yBottom
-                                  )
-                    );
-    }
-}