]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/notebook.cpp
fixed crash introduced by recently applied autowidth patch (patch 1171455)
[wxWidgets.git] / src / os2 / notebook.cpp
index a8e9ea80b4ee68c2413c313ee30ce42236d0552d..f792c76a6057c50f1c2f0e5363bd2dd8f80e3aaa 100644 (file)
@@ -14,7 +14,7 @@
 
 #if wxUSE_NOTEBOOK
 
 
 #if wxUSE_NOTEBOOK
 
-// wxWindows
+// wxWidgets
 #ifndef WX_PRECOMP
   #include "wx/app.h"
   #include "wx/dcclient.h"
 #ifndef WX_PRECOMP
   #include "wx/app.h"
   #include "wx/dcclient.h"
@@ -158,7 +158,7 @@ WXDWORD wxNotebook::OS2GetStyle (
                                                                         ,pdwExstyle
                                                                        );
 
                                                                         ,pdwExstyle
                                                                        );
 
-    dwTabStyle |= WS_TABSTOP | BKS_SOLIDBIND | BKS_ROUNDEDTABS | BKS_TABTEXTCENTER;
+    dwTabStyle |= WS_TABSTOP | BKS_SOLIDBIND | BKS_ROUNDEDTABS | BKS_TABTEXTCENTER | BKS_TABBEDDIALOG;
 
     if (lStyle & wxNB_BOTTOM)
         dwTabStyle |= BKS_MAJORTABBOTTOM | BKS_BACKPAGESBL;
 
     if (lStyle & wxNB_BOTTOM)
         dwTabStyle |= BKS_MAJORTABBOTTOM | BKS_BACKPAGESBL;
@@ -319,12 +319,12 @@ bool wxNotebook::SetPageImage (
 , int                               nImage
 )
 {
 , int                               nImage
 )
 {
-    wxBitmap*                       pBitmap = (wxBitmap*)m_imageList->GetBitmap(nImage);
+    wxBitmap                        vBitmap = (wxBitmap)m_imageList->GetBitmap(nImage);
 
     return (bool)::WinSendMsg( GetHWND()
                               ,BKM_SETTABBITMAP
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
 
     return (bool)::WinSendMsg( GetHWND()
                               ,BKM_SETTABBITMAP
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
-                              ,(MPARAM)pBitmap->GetHBITMAP()
+                              ,(MPARAM)vBitmap.GetHBITMAP()
                              );
 } // end of wxNotebook::SetPageImage
 
                              );
 } // end of wxNotebook::SetPageImage
 
@@ -346,22 +346,7 @@ void wxNotebook::SetPageSize (
   const wxSize&                     rSize
 )
 {
   const wxSize&                     rSize
 )
 {
-    RECTL                           vRect;
-
-    //
-    // Transform the page size into the notebook size
-    //
-    vRect.xLeft   = vRect.yTop = 0;
-    vRect.xRight  = rSize.x;
-    vRect.yBottom = rSize.y;
-
-
-    //
-    // And now set it
-    //
-    SetSize( vRect.xRight - vRect.xLeft
-            ,vRect.yBottom - vRect.yTop
-           );
+    SetSize(rSize);
 } // end of wxNotebook::SetPageSize
 
 void wxNotebook::SetPadding (
 } // end of wxNotebook::SetPageSize
 
 void wxNotebook::SetPadding (
@@ -671,6 +656,9 @@ bool wxNotebook::InsertPage (
 
     if (nSelNew != -1)
         SetSelection(nSelNew);
 
     if (nSelNew != -1)
         SetSelection(nSelNew);
+
+    InvalidateBestSize();
+
     return TRUE;
 } // end of wxNotebook::InsertPage
 
     return TRUE;
 } // end of wxNotebook::InsertPage
 
@@ -681,20 +669,6 @@ void wxNotebook::OnSize(
   wxSizeEvent&                      rEvent
 )
 {
   wxSizeEvent&                      rEvent
 )
 {
-    int                             nPage;
-    int                             nCount = (int)m_pages.Count();
-
-    for (nPage = 0; nPage < nCount; nPage++)
-    {
-        if (m_nSelection == nPage)
-            m_pages[nPage]->Refresh();
-        else
-            ::WinSetWindowPos(m_pages[nPage]->GetHWND()
-                              ,NULLHANDLE
-                              ,0,0,0,0
-                              ,SWP_HIDE
-                             );
-    }
     rEvent.Skip();
 } // end of wxNotebook::OnSize
 
     rEvent.Skip();
 } // end of wxNotebook::OnSize