]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
Change wxNotebook selection before sending page changed event in wxMSW.
[wxWidgets.git] / src / gtk / listbox.cpp
index 60c03da2030ea8284126b095c1226b9d234d03a0..09b0b4a12ae711b64966e4f98d801580dff21c3d 100644 (file)
 #endif
 
 #include <gtk/gtk.h>
+
 #include <gdk/gdkkeysyms.h>
+#if GTK_CHECK_VERSION(3,0,0)
+#include <gdk/gdkkeysyms-compat.h>
+#endif
 
 //-----------------------------------------------------------------------------
 // data
@@ -237,8 +241,6 @@ static gboolean gtk_listbox_searchequal_callback(GtkTreeModel * WXUNUSED(model),
 // wxListBox
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControlWithItems)
-
 // ----------------------------------------------------------------------------
 // construction
 // ----------------------------------------------------------------------------
@@ -431,7 +433,7 @@ void wxListBox::Update()
     wxWindow::Update();
 
     if (m_treeview)
-        gdk_window_process_updates(GTK_WIDGET(m_treeview)->window, TRUE);
+        gdk_window_process_updates(gtk_widget_get_window(GTK_WIDGET(m_treeview)), true);
 }
 
 // ----------------------------------------------------------------------------
@@ -580,9 +582,6 @@ void wxListBox::GTKSetItem(GtkTreeIter& iter, const GtkTreeEntry *entry)
 
 void* wxListBox::DoGetItemClientData(unsigned int n) const
 {
-    wxCHECK_MSG( IsValid(n), NULL,
-                 wxT("Invalid index passed to GetItemClientData") );
-
     wxGtkObject<GtkTreeEntry> entry(GTKGetEntry(n));
     wxCHECK_MSG(entry, NULL, wxT("could not get entry"));
 
@@ -591,9 +590,6 @@ void* wxListBox::DoGetItemClientData(unsigned int n) const
 
 void wxListBox::DoSetItemClientData(unsigned int n, void* clientData)
 {
-    wxCHECK_RET( IsValid(n),
-                 wxT("Invalid index passed to SetItemClientData") );
-
     wxGtkObject<GtkTreeEntry> entry(GTKGetEntry(n));
     wxCHECK_RET(entry, wxT("could not get entry"));
 
@@ -777,7 +773,7 @@ void wxListBox::DoScrollToCell(int n, float alignY, float alignX)
     wxCHECK_RET( IsValid(n), wxT("invalid index"));
 
     //RN: I have no idea why this line is needed...
-    if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview))
+    if (gdk_pointer_is_grabbed () && gtk_widget_has_grab(GTK_WIDGET(m_treeview)))
         return;
 
     GtkTreeIter iter;
@@ -845,23 +841,6 @@ int wxListBox::DoListHitTest(const wxPoint& point) const
 // helpers
 // ----------------------------------------------------------------------------
 
-#if wxUSE_TOOLTIPS
-void wxListBox::GTKApplyToolTip( GtkTooltips *tips, const gchar *tip )
-{
-#if GTK_CHECK_VERSION(2, 12, 0)
-    if (!gtk_check_version(2, 12, 0))
-    {
-        gtk_widget_set_tooltip_text(GTK_WIDGET( m_treeview ), tip);
-    }
-    else
-#endif
-    {
-        // RN: Is this needed anymore?
-        gtk_tooltips_set_tip( tips, GTK_WIDGET( m_treeview ), tip, NULL );
-    }
-}
-#endif // wxUSE_TOOLTIPS
-
 GtkWidget *wxListBox::GetConnectWidget()
 {
     // the correct widget for listbox events (such as mouse clicks for example)