]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/notebook.cpp
Better fix
[wxWidgets.git] / src / gtk1 / notebook.cpp
index 7c51c6d91bbeeaa655bb08b9baa8d64a8c5665b7..37fa1fd8e565945fb5fe4fe847125c7b08dbedd8 100644 (file)
@@ -118,16 +118,10 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
     }
     else
     {
-        wxNotebookEvent eventChanging( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
-                                       notebook->GetId(), page, old );
-        eventChanging.SetEventObject( notebook );
-
-        if ( (notebook->GetEventHandler()->ProcessEvent(eventChanging)) &&
-              !eventChanging.IsAllowed() )
+        if ( !notebook->SendPageChangingEvent(page) )
         {
-            /* program doesn't allow the page change */
-            g_signal_stop_emission_by_name (notebook->m_widget,
-                                            "switch_page");
+            // program doesn't allow the page change
+            gtk_signal_emit_stop_by_name(GTK_OBJECT(notebook->m_widget), "switch_page");
         }
         else // change allowed
         {
@@ -136,10 +130,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
             // not really changed in GTK+
             notebook->m_selection = page;
 
-            wxNotebookEvent eventChanged( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
-                                          notebook->GetId(), page, old );
-            eventChanged.SetEventObject( notebook );
-            notebook->GetEventHandler()->ProcessEvent( eventChanged );
+            notebook->SendPageChangedEvent(old);
         }
     }
 
@@ -258,7 +249,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
         event.SetCurrentFocus( notebook );
 
         wxNotebookPage *client = notebook->GetPage(sel);
-        if ( !client->GetEventHandler()->ProcessEvent( event ) )
+        if ( !client->HandleWindowEvent( event ) )
         {
              client->SetFocus();
         }
@@ -296,9 +287,9 @@ static void wxInsertChildInNotebook( wxNotebook* parent, wxWindow* child )
 // wxNotebook
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxBookCtrlBase)
 
-BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
     EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
 END_EVENT_TABLE()