]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/notebook.cpp
don't use \u escapes, VC6 doesn't understand them
[wxWidgets.git] / src / univ / notebook.cpp
index 7a72aaf22ec8967032253878c83bc7a954a697ed..d219fa2162d231ce63196cd647dd84ba931c95da 100644 (file)
@@ -76,9 +76,6 @@ protected:
 
 static const size_t INVALID_PAGE = (size_t)-1;
 
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
-
 // ----------------------------------------------------------------------------
 // private classes
 // ----------------------------------------------------------------------------
@@ -114,8 +111,7 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 
 // ----------------------------------------------------------------------------
 // wxNotebook creation
@@ -153,7 +149,7 @@ bool wxNotebook::Create(wxWindow *parent,
 
     m_sizePad = GetRenderer()->GetTabPadding();
 
-    SetBestSize(size);
+    SetInitialSize(size);
 
     CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
 
@@ -233,7 +229,7 @@ wxNotebook::~wxNotebook()
 // wxNotebook page switching
 // ----------------------------------------------------------------------------
 
-int wxNotebook::DoSetSelection(size_t nPage, int flags = 0)
+int wxNotebook::DoSetSelection(size_t nPage, int flags)
 {
     wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
 
@@ -243,14 +239,9 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags = 0)
         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 +291,10 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags = 0)
         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;