X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e97a905185a72c04a7feb67c7885ab4412100ee..9df05aab59ad8ff0e3cf5556e8273c72c0fc5203:/src/gtk1/notebook.cpp diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 4b81047c5f..22e96ee172 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -31,13 +31,6 @@ #include -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) - //----------------------------------------------------------------------------- // idle system //----------------------------------------------------------------------------- @@ -68,8 +61,8 @@ public: wxGtkNotebookPage() { m_image = -1; - m_page = (GtkNotebookPage *) NULL; - m_box = (GtkWidget *) NULL; + m_page = NULL; + m_box = NULL; } wxString m_text; @@ -298,7 +291,7 @@ void wxNotebook::Init() m_padding = 0; m_inSwitchPage = false; - m_imageList = (wxImageList *) NULL; + m_imageList = NULL; m_selection = -1; m_themeEnabled = true; } @@ -415,9 +408,9 @@ int wxNotebook::GetPageImage( size_t page ) const wxGtkNotebookPage* wxNotebook::GetNotebookPage( int page ) const { - wxCHECK_MSG( m_widget != NULL, (wxGtkNotebookPage*) NULL, wxT("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid notebook") ); - wxCHECK_MSG( page < (int)m_pagesData.GetCount(), (wxGtkNotebookPage*) NULL, wxT("invalid notebook index") ); + wxCHECK_MSG( page < (int)m_pagesData.GetCount(), NULL, wxT("invalid notebook index") ); return m_pagesData.Item(page)->GetData(); } @@ -437,15 +430,13 @@ int wxNotebook::DoSetSelection( size_t page, int flags ) m_selection = page; gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page ); -#ifdef __WXDEBUG__ - if ( !(flags & SetSelection_SendEvent) ) - { - // gtk_notebook_set_current_page will emit the switch-page signal which will be - // caught by our gtk_notebook_page_change_callback which should have reset the - // flag to false: - wxASSERT(!m_skipNextPageChangeEvent); - } -#endif // __WXDEBUG__ + // gtk_notebook_set_current_page is supposed to emit the switch-page signal + // which should be caught by our gtk_notebook_page_change_callback which + // should have reset the flag to false, check it: + wxASSERT_LEVEL_2_MSG( + (flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent, + "internal error in selection events generation" + ); wxNotebookPage *client = GetPage(page); if ( client ) @@ -492,7 +483,7 @@ bool wxNotebook::SetPageImage( size_t page, int image ) if (image == -1 && nb_page->m_image == -1) return true; /* Case 1): Nothing to do. */ - GtkWidget *pixmapwid = (GtkWidget*) NULL; + GtkWidget *pixmapwid = NULL; if (nb_page->m_image != -1) { @@ -528,7 +519,7 @@ bool wxNotebook::SetPageImage( size_t page, int image ) /* Construct the new pixmap */ const wxBitmap *bmp = m_imageList->GetBitmapPtr(image); GdkPixmap *pixmap = bmp->GetPixmap(); - GdkBitmap *mask = (GdkBitmap*) NULL; + GdkBitmap *mask = NULL; if ( bmp->GetMask() ) { mask = bmp->GetMask()->GetBitmap(); @@ -696,7 +687,7 @@ bool wxNotebook::InsertPage( size_t position, const wxBitmap *bmp = m_imageList->GetBitmapPtr(imageId); GdkPixmap *pixmap = bmp->GetPixmap(); - GdkBitmap *mask = (GdkBitmap*) NULL; + GdkBitmap *mask = NULL; if ( bmp->GetMask() ) { mask = bmp->GetMask()->GetBitmap();