X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49bf4e3e689c2131994aa2aab3c9eca6255a46eb..3b96fc2f1b64f78bba7c755a5c14f618962f696b:/src/gtk1/notebook.cpp diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index d58e2fe172..883714775e 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -7,10 +7,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "notebook.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -73,7 +69,7 @@ public: m_page = (GtkNotebookPage *) NULL; m_box = (GtkWidget *) NULL; } - + wxString m_text; int m_image; GtkNotebookPage *m_page; @@ -90,6 +86,7 @@ WX_DEFINE_LIST(wxGtkNotebookPagesList); // "switch_page" //----------------------------------------------------------------------------- +extern "C" { static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), GtkNotebookPage *WXUNUSED(page), gint page, @@ -132,11 +129,13 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), notebook->m_inSwitchPage = FALSE; } +} //----------------------------------------------------------------------------- // "size_allocate" //----------------------------------------------------------------------------- +extern "C" { static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) { if (g_isIdle) @@ -163,11 +162,13 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* gtk_widget_size_allocate( win->m_wxwindow, alloc ); } } +} //----------------------------------------------------------------------------- // "realize" from m_widget //----------------------------------------------------------------------------- +extern "C" { static gint gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) { @@ -180,11 +181,13 @@ gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) return FALSE; } +} //----------------------------------------------------------------------------- // "key_press_event" //----------------------------------------------------------------------------- +extern "C" { static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook ) { if (g_isIdle) @@ -192,7 +195,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk if (!notebook->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; - + /* win is a control: tab can be propagated up */ if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right)) { @@ -212,10 +215,10 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk { return FALSE; } - + // m_selection = page; gtk_notebook_set_page( GTK_NOTEBOOK(widget), page ); - + gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" ); return TRUE; } @@ -234,7 +237,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */ event.SetDirection( (gdk_event->keyval == GDK_Tab) ); /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) || + event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) || (gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right) ); event.SetCurrentFocus( notebook ); @@ -250,6 +253,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk return FALSE; } +} //----------------------------------------------------------------------------- // InsertChild callback for wxNotebook @@ -646,7 +650,7 @@ bool wxNotebook::InsertPage( size_t position, if ( position == GetPageCount() ) m_pagesData.Append( nb_page ); else - m_pagesData.Insert( m_pagesData.Item( position ), nb_page ); + m_pagesData.Insert( position, nb_page ); m_pages.Insert(win, position); @@ -702,8 +706,8 @@ bool wxNotebook::InsertPage( size_t position, { gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style); gtk_rc_style_unref(style); - } - + } + /* show the label */ gtk_widget_show( GTK_WIDGET(nb_page->m_label) ); if (select && (m_pagesData.GetCount() > 1)) @@ -714,7 +718,7 @@ bool wxNotebook::InsertPage( size_t position, SetSelection( GetPageCount()-1 ); else #endif - SetSelection( position ); + SetSelection( position ); } gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",