X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/97d74dd29510ecec88b3f8cf9c986536f7512a38..31ad423e4fb556ec225a63b161154d3bf3445c1b:/src/os2/frame.cpp diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 056ce7bc74..c0d17e3403 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -173,15 +173,13 @@ void wxFrame::DoGetClientSize( // // Set the client size (i.e. leave the calculation of borders etc. -// to wxWindows) +// to wxWidgets) // void wxFrame::DoSetClientSize( int nWidth , int nHeight ) { - wxStatusBar* pStatusBar = GetStatusBar(); - // // Statusbars are not part of the OS/2 Client but parent frame // so no statusbar consideration @@ -217,8 +215,6 @@ wxStatusBar* wxFrame::OnCreateStatusBar( ) { wxStatusBar* pStatusBar = NULL; - SWP vSwp; - ERRORID vError; wxString sError; pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber @@ -281,7 +277,6 @@ void wxFrame::PositionStatusBar() int nY; int nStatbarWidth; int nStatbarHeight; - HWND hWndClient; RECTL vRect; RECTL vFRect; @@ -311,7 +306,7 @@ void wxFrame::PositionStatusBar() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for StautsBar. Error: %s\n", sError); + wxLogError("Error setting parent for StautsBar. Error: %s\n", sError.c_str()); return; } } @@ -355,17 +350,7 @@ void wxFrame::SetMenuBar( wxMenuBar* pMenuBar ) { - ERRORID vError; wxString sError; - HWND hTitlebar = NULLHANDLE; - HWND hHScroll = NULLHANDLE; - HWND hVScroll = NULLHANDLE; - HWND hMenuBar = NULLHANDLE; - SWP vSwp; - SWP vSwpTitlebar; - SWP vSwpVScroll; - SWP vSwpHScroll; - SWP vSwpMenu; if (!pMenuBar) { @@ -384,7 +369,7 @@ void wxFrame::SetMenuBar( // // Can set a menubar several times. // TODO: how to prevent a memory leak if you have a currently-unattached - // menubar? wxWindows assumes that the frame will delete the menu (otherwise + // menubar? wxWidgets assumes that the frame will delete the menu (otherwise // there are problems for MDI). // if (pMenuBar->GetHMenu()) @@ -454,14 +439,14 @@ void wxFrame::InternalSetMenuBar() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for submenu. Error: %s\n", sError); + wxLogError("Error setting parent for submenu. Error: %s\n", sError.c_str()); } if (!::WinSetOwner(m_hMenu, m_hFrame)) { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for submenu. Error: %s\n", sError); + wxLogError("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 @@ -738,10 +723,8 @@ void wxFrame::PositionToolBar() if (!pToolBar) return; - HWND hWndClient; RECTL vRect; RECTL vFRect; - SWP vSwp; wxPoint vPos; ::WinQueryWindowRect(m_hFrame, &vRect); @@ -798,6 +781,10 @@ void wxFrame::IconizeChildFrames( bool bIconize ) { + // FIXME: Generic MDI does not use Frames for the Childs, so this does _not_ + // work. Possibly, the right thing is simply to eliminate this + // functions and all the calls to it from within this file. +#if 0 for (wxWindowList::Node* pNode = GetChildren().GetFirst(); pNode; pNode = pNode->GetNext() ) @@ -829,6 +816,7 @@ void wxFrame::IconizeChildFrames( pFrame->Iconize(bIconize); } } +#endif } // end of wxFrame::IconizeChildFrames WXHICON wxFrame::GetDefaultIcon() const @@ -899,7 +887,6 @@ bool wxFrame::HandlePaint() if (hIcon) { - HWND hWndClient; RECTL vRect3; ::WinQueryWindowRect(GetHwnd(), &vRect3); @@ -1227,7 +1214,6 @@ MRESULT EXPENTRY wxFrameWndProc( // MRESULT rc = (MRESULT)0; - bool bProcessed = FALSE; // // Stop right here if we don't have a valid handle in our wxWindow object. @@ -1325,8 +1311,6 @@ MRESULT wxFrame::OS2WindowProc( case WM_SIZE: { - SHORT nScxold = SHORT1FROMMP(wParam); // Old horizontal size. - SHORT nScyold = SHORT2FROMMP(wParam); // Old vertical size. SHORT nScxnew = SHORT1FROMMP(lParam); // New horizontal size. SHORT nScynew = SHORT2FROMMP(lParam); // New vertical size. @@ -1420,3 +1404,22 @@ 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 + ) + ); + } +} +