From: David Webster Date: Tue, 2 Jul 2002 21:10:52 +0000 (+0000) Subject: Toolbar updates X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2590f154ff935ee7a24ea4d25108e8ed97a56f04 Toolbar updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 92ca4c551e..5e974b5963 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -74,9 +74,11 @@ void wxBitmapRefData::Free() wxLogLastError("GpiDeleteBitmap(hbitmap)"); } } - - delete m_pBitmapMask; - m_pBitmapMask = NULL; + if (m_pBitmapMask) + { + delete m_pBitmapMask; + m_pBitmapMask = NULL; + } } // end of wxBitmapRefData::Free // ---------------------------------------------------------------------------- diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index 20d3f61a4c..2af455913a 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -1390,7 +1390,7 @@ void wxDC::DoDrawBitmap( // // Need to get a background color for mask blitting // - if (IsKindOf(CLASSINFO(wxPaintDC))) + if (IsKindOf(CLASSINFO(wxWindowDC))) { wxWindowDC* pWindowDC = wxDynamicCast(this, wxWindowDC); diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 646295e411..e725d21116 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -695,29 +695,13 @@ bool wxFrame::ShowFullScreen( // Checks if there is a toolbar, and returns the first free client position wxPoint wxFrame::GetClientAreaOrigin() const { - wxPoint vPoint(0, 0); + wxPoint vPoint = wxTopLevelWindow::GetClientAreaOrigin(); -#if wxUSE_TOOLBAR - if (GetToolBar()) - { - int nWidth; - int nHeight; - - GetToolBar()->GetSize( &nWidth - ,&nHeight - ); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - vPoint.x += nWidth; - } - else - { - // PM is backwards from windows - vPoint.y += nHeight; - } - } -#endif //wxUSE_TOOLBAR + // + // In OS/2 the toolbar and statusbar are frame extensions so there is no + // adjustment. The client is supposedly resized for a toolbar in OS/2 + // as it is for the status bar. + // return vPoint; } // end of wxFrame::GetClientAreaOrigin diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 610628a79a..52a983498a 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -2592,6 +2592,8 @@ MRESULT wxWindowOS2::OS2WindowProc( { if (pFrame->GetStatusBar()) pFrame->PositionStatusBar(); + if (pFrame->GetToolBar()) + pFrame->PositionToolBar(); } } } @@ -4364,7 +4366,19 @@ int wxWindowOS2::GetOS2ParentHeight( IsKindOf(CLASSINFO(wxMenuBar)) || IsKindOf(CLASSINFO(wxToolBar)) ) - return(pParent->GetSize().y); + { + if (IsKindOf(CLASSINFO(wxToolBar))) + { + wxFrame* pFrame = wxDynamicCast(GetParent(), wxFrame); + + if (pFrame->GetToolBar() == this) + return(pParent->GetSize().y); + else + return(pParent->GetClientSize().y); + } + else + return(pParent->GetSize().y); + } else return(pParent->GetClientSize().y); }