]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/notebook.cpp
Blind fix for bug #1209944, wxFileConfig constructor corrupts the stack
[wxWidgets.git] / src / os2 / notebook.cpp
index a8e9ea80b4ee68c2413c313ee30ce42236d0552d..398290e166e4855d9a02f520d23b7a340997d88f 100644 (file)
@@ -14,7 +14,7 @@
 
 #if wxUSE_NOTEBOOK
 
-// wxWindows
+// wxWidgets
 #ifndef WX_PRECOMP
   #include "wx/app.h"
   #include "wx/dcclient.h"
@@ -137,8 +137,8 @@ bool wxNotebook::Create(
     //
     // Notebook, so explicitly specify 0 as last parameter
     //
-    if (!OS2CreateControl( "NOTEBOOK"
-                          ,_T("")
+    if (!OS2CreateControl( wxT("NOTEBOOK")
+                          ,wxEmptyString
                           ,rPos
                           ,rSize
                           ,lStyle | wxTAB_TRAVERSAL
@@ -158,7 +158,7 @@ WXDWORD wxNotebook::OS2GetStyle (
                                                                         ,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;
@@ -280,7 +280,7 @@ wxString wxNotebook::GetPageText (
         return wxEmptyString;
     }
     vBookText.textLen = ulRc + 1; // To get the null terminator
-    vBookText.pString = zBuf;
+    vBookText.pString = (char*)zBuf;
 
     //
     // Now get the actual text
@@ -298,7 +298,7 @@ wxString wxNotebook::GetPageText (
         ulRc = 255L;
 
     vBookText.pString[ulRc] = '\0';
-    sStr = vBookText.pString;
+    sStr = (wxChar*)vBookText.pString;
     return sStr;
 } // end of wxNotebook::GetPageText
 
@@ -319,12 +319,12 @@ bool wxNotebook::SetPageImage (
 , 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])
-                              ,(MPARAM)pBitmap->GetHBITMAP()
+                              ,(MPARAM)vBitmap.GetHBITMAP()
                              );
 } // end of wxNotebook::SetPageImage
 
@@ -346,22 +346,7 @@ void wxNotebook::SetPageSize (
   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 (
@@ -671,6 +656,9 @@ bool wxNotebook::InsertPage (
 
     if (nSelNew != -1)
         SetSelection(nSelNew);
+
+    InvalidateBestSize();
+
     return TRUE;
 } // end of wxNotebook::InsertPage
 
@@ -681,20 +669,6 @@ void wxNotebook::OnSize(
   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