]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
remove unneeded wxCHECK_MSG: GetNextMessage() can get the msg even if the event loop...
[wxWidgets.git] / src / generic / notebook.cpp
index 3b0b6d23823e15bd82698ffa885b6e12d2b8d20a..0d2a77c6e05e811679f1a5fedce96696e6c83431 100644 (file)
@@ -49,9 +49,6 @@
 // event table
 // ----------------------------------------------------------------------------
 
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
-
 BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
     EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
     EVT_SIZE(wxNotebook::OnSize)
@@ -62,7 +59,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 // ============================================================================
 // implementation
@@ -106,7 +102,7 @@ private:
 
 static int GetPageId(wxTabView *tabview, wxNotebookPage *page)
 {
-    return wx_static_cast(wxNotebookTabView*, tabview)->GetId(page);
+    return static_cast<wxNotebookTabView*>(tabview)->GetId(page);
 }
 
 // ----------------------------------------------------------------------------
@@ -116,7 +112,7 @@ static int GetPageId(wxTabView *tabview, wxNotebookPage *page)
 // common part of all ctors
 void wxNotebook::Init()
 {
-    m_tabView = (wxNotebookTabView*) NULL;
+    m_tabView = NULL;
     m_nSelection = -1;
 }
 
@@ -545,7 +541,7 @@ bool wxNotebook::RefreshLayout(bool force)
     return true;
 }
 
-void wxNotebook::OnSelChange(wxNotebookEvent& event)
+void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
 {
     // is it our tab control?
     if ( event.GetEventObject() == this )
@@ -569,15 +565,17 @@ void wxNotebook::OnSetFocus(wxFocusEvent& event)
 
 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
 {
-    if ( event.IsWindowChange() ) {
+    if ( event.IsWindowChange() )
+    {
         // change pages
         AdvanceSelection(event.GetDirection());
     }
     else {
         // pass to the parent
-        if ( GetParent() ) {
+        if ( GetParent() )
+        {
             event.SetCurrentFocus(this);
-            GetParent()->ProcessEvent(event);
+            GetParent()->ProcessWindowEvent(event);
         }
     }
 }
@@ -713,7 +711,7 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   if (!m_notebook)
     return;
 
-  wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
+  wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
 
   // Translate from wxTabView's ids (which aren't position-dependent)
   // to wxNotebook's (which are).
@@ -736,7 +734,7 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
 
   if (m_notebook)
   {
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
 
     // Translate from wxTabView's ids (which aren't position-dependent)
     // to wxNotebook's (which are).