]> git.saurik.com Git - wxWidgets.git/commitdiff
Toolbar updates
authorDavid Webster <Dave.Webster@bhmi.com>
Tue, 2 Jul 2002 21:10:52 +0000 (21:10 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Tue, 2 Jul 2002 21:10:52 +0000 (21:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/bitmap.cpp
src/os2/dc.cpp
src/os2/frame.cpp
src/os2/window.cpp

index 92ca4c551ee821f396dbb28174c1cb58b98d2fb9..5e974b596371a61a489fdf93ddbedb5380d158e8 100644 (file)
@@ -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
 
 // ----------------------------------------------------------------------------
index 20d3f61a4ca0cd3750e1de978f2406dc8a38a1b1..2af455913a8cf71e483fea2afcd6e13f477f4ab7 100644 (file)
@@ -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);
 
index 646295e41179ad7a82a812cf69bfd9d0a071cdf1..e725d211161f88f3671f7443510ceebbfd50717d 100644 (file)
@@ -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
 
index 610628a79ab645875131295c75f6814547b25482..52a983498a0940591749a505b324dec09d193847 100644 (file)
@@ -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);
     }