]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/notebook.cpp
exposing wxOSXGetViewFromResponder
[wxWidgets.git] / src / os2 / notebook.cpp
index fb45fe10a3e64131652bd3d23bf4b46fd09356ed..de5fbf8e7ad510b2adfff4bab6d853e12d929057 100644 (file)
@@ -60,8 +60,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
     EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
 END_EVENT_TABLE()
 
-IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-
 // ============================================================================
 // implementation
 // ============================================================================
@@ -75,7 +73,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 //
 void wxNotebook::Init()
 {
-    m_imageList  = NULL;
     m_nTabSize   = 0;
 } // end of wxNotebook::Init
 
@@ -211,7 +208,7 @@ int wxNotebook::SetSelection( size_t nPage )
 
     if (nPage != (size_t)m_selection)
     {
-        wxBookCtrlEvent             vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
+        wxBookCtrlEvent             vEvent( wxEVT_NOTEBOOK_PAGE_CHANGING
                                            ,m_windowId
                                           );
 
@@ -224,7 +221,7 @@ int wxNotebook::SetSelection( size_t nPage )
             //
             // Program allows the page change
             //
-            vEvent.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
+            vEvent.SetEventType(wxEVT_NOTEBOOK_PAGE_CHANGED);
             HandleWindowEvent(vEvent);
 
             ::WinSendMsg( GetHWND()
@@ -327,7 +324,7 @@ bool wxNotebook::SetPageImage (
 , int                               nImage
 )
 {
-    wxBitmap                        vBitmap = (wxBitmap)m_imageList->GetBitmap(nImage);
+    wxBitmap                        vBitmap = (wxBitmap)GetImageList()->GetBitmap(nImage);
 
     return (bool)::WinSendMsg( GetHWND()
                               ,BKM_SETTABBITMAP
@@ -648,19 +645,7 @@ bool wxNotebook::InsertPage ( size_t          nPage,
         pPage->Show(false);
     }
 
-    //
-    // Some page should be selected: either this one or the first one if there is
-    // still no selection
-    //
-    int nSelNew = wxNOT_FOUND;
-
-    if (bSelect)
-        nSelNew = nPage;
-    else if ( m_selection == wxNOT_FOUND )
-        nSelNew = 0;
-
-    if (nSelNew != wxNOT_FOUND)
-        SetSelection(nSelNew);
+    DoSetSelectionAfterInsertion(nPage, bSelect);
 
     InvalidateBestSize();