]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/notebook.cpp
many compilation fixes for WinCE using VC8 (it now build, although still doesn't...
[wxWidgets.git] / src / os2 / notebook.cpp
index b0765dd8e85890aa6312e800de396f18d4f594bd..d29206949ededbf4d84c00591c99acceea1a8f8b 100644 (file)
     #include "wx/dcclient.h"
     #include "wx/string.h"
     #include "wx/settings.h"
     #include "wx/dcclient.h"
     #include "wx/string.h"
     #include "wx/settings.h"
-    #include  "wx/log.h"
+    #include "wx/log.h"
+    #include "wx/event.h"
+    #include  "wx/control.h"
 #endif  // WX_PRECOMP
 
 #include  "wx/imaglist.h"
 #endif  // WX_PRECOMP
 
 #include  "wx/imaglist.h"
-#include  "wx/event.h"
-#include  "wx/control.h"
 
 #include  "wx/os2/private.h"
 
 
 #include  "wx/os2/private.h"
 
@@ -124,6 +124,8 @@ bool wxNotebook::Create( wxWindow*       pParent,
                          long            lStyle,
                          const wxString& rsName )
 {
                          long            lStyle,
                          const wxString& rsName )
 {
+    if ( (lStyle & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        lStyle |= wxBK_TOP;
     //
     // Base init
     //
     //
     // Base init
     //
@@ -241,6 +243,22 @@ int wxNotebook::SetSelection( size_t nPage )
     return nPage;
 } // end of wxNotebook::SetSelection
 
     return nPage;
 } // end of wxNotebook::SetSelection
 
+int wxNotebook::ChangeSelection( size_t nPage )
+{
+    wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
+
+    if (nPage != (size_t)m_nSelection)
+    {
+        ::WinSendMsg( GetHWND()
+                ,BKM_TURNTOPAGE
+                ,MPFROMLONG((ULONG)m_alPageId[nPage])
+                        ,(MPARAM)0
+                    );
+    }
+    m_nSelection = nPage;
+    return nPage;
+}
+
 bool wxNotebook::SetPageText( size_t nPage,
                               const wxString& rsStrText )
 {
 bool wxNotebook::SetPageText( size_t nPage,
                               const wxString& rsStrText )
 {
@@ -248,7 +266,7 @@ bool wxNotebook::SetPageText( size_t nPage,
     return (bool)::WinSendMsg( m_hWnd
                               ,BKM_SETTABTEXT
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
     return (bool)::WinSendMsg( m_hWnd
                               ,BKM_SETTABTEXT
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
-                              ,MPFROMP((PSZ)rsStrText.c_str())
+                              ,MPFROMP((const char*)rsStrText.c_str())
                              );
 } // end of wxNotebook::SetPageText
 
                              );
 } // end of wxNotebook::SetPageText
 
@@ -319,7 +337,7 @@ bool wxNotebook::SetPageImage (
     return (bool)::WinSendMsg( GetHWND()
                               ,BKM_SETTABBITMAP
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
     return (bool)::WinSendMsg( GetHWND()
                               ,BKM_SETTABBITMAP
                               ,MPFROMLONG((ULONG)m_alPageId[nPage])
-                              ,(MPARAM)wxFlipBmp(vBitmap.GetHBITMAP())
+                              ,(MPARAM)wxCopyBmp(vBitmap.GetHBITMAP(), true)
                              );
 } // end of wxNotebook::SetPageImage
 
                              );
 } // end of wxNotebook::SetPageImage