]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/notebook.cpp
don't provide unnecessary (as default) arguments to wxPen ctor, this incidentally...
[wxWidgets.git] / src / univ / notebook.cpp
index 7ec0981b86a6793e037006f45099fea248baac56..a1c7d867f29b677399547b685281b13fbecc3e8b 100644 (file)
@@ -114,7 +114,7 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 // ----------------------------------------------------------------------------
@@ -153,7 +153,7 @@ bool wxNotebook::Create(wxWindow *parent,
 
     m_sizePad = GetRenderer()->GetTabPadding();
 
-    SetBestSize(size);
+    SetInitialSize(size);
 
     CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
 
@@ -243,14 +243,9 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags)
         return m_sel;
     }
 
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
-    if (flags & SetSelection_SendEvent)
+    if ( flags & SetSelection_SendEvent )
     {
-        // event handling
-        event.SetSelection(nPage);
-        event.SetOldSelection(m_sel);
-        event.SetEventObject(this);
-        if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
+        if ( !SendPageChangingEvent(nPage) )
         {
             // program doesn't allow the page change
             return m_sel;
@@ -300,11 +295,10 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags)
         m_pages[m_sel]->Show();
     }
 
-    if (flags & SetSelection_SendEvent)
+    if ( flags & SetSelection_SendEvent )
     {
         // event handling
-        event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
-        GetEventHandler()->ProcessEvent(event);
+        SendPageChangedEvent(selOld);
     }
 
     return selOld;