]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/checklst.cpp
Return NULL from wxWindow::GetCapture() when the capture is being lost.
[wxWidgets.git] / src / gtk / checklst.cpp
index d3fe708a638bfd7a477dfecd0ffa90b100b0ae27..0a9d31840affc505a2cafca65d1111ef40cb053f 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:
 // Author:      Robert Roebling
 // Modified by: Ryan Norton (Native GTK2.0+ checklist)
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 #if wxUSE_CHECKLISTBOX
 
 #include "wx/checklst.h"
-#include "wx/gtk/private.h"
-#include "wx/gtk/treeentry_gtk.h"
 
-#include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
@@ -31,10 +27,11 @@ static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer),
     wxCHECK_RET( listbox->m_treeview != NULL, wxT("invalid listbox") );
 
     GtkTreePath* path = gtk_tree_path_new_from_string(stringpath);
-    wxCommandEvent new_event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED,
+    wxCommandEvent new_event( wxEVT_CHECKLISTBOX,
                               listbox->GetId() );
     new_event.SetEventObject( listbox );
     new_event.SetInt( gtk_tree_path_get_indices(path)[0] );
+    new_event.SetString( listbox->GetString( new_event.GetInt() ));
     gtk_tree_path_free(path);
     listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt()));
     listbox->HandleWindowEvent( new_event );
@@ -45,9 +42,7 @@ static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer),
 // wxCheckListBox
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox,wxListBox)
-
-wxCheckListBox::wxCheckListBox() : wxListBox()
+wxCheckListBox::wxCheckListBox() : wxCheckListBoxBase()
 {
     m_hasCheckBoxes = true;
 }
@@ -87,7 +82,12 @@ void wxCheckListBox::DoCreateCheckList()
         gtk_tree_view_column_new_with_attributes( "", renderer,
                                                   "active", 0,
                                                   NULL );
+#if wxUSE_LIBHILDON2
+    gtk_tree_view_column_set_fixed_width(column, 40);
+#else
     gtk_tree_view_column_set_fixed_width(column, 22);
+#endif // wxUSE_LIBHILDON2/!wxUSE_LIBHILDON2
+
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
     gtk_tree_view_column_set_clickable(column, TRUE);
 
@@ -117,7 +117,7 @@ bool wxCheckListBox::IsChecked(unsigned int index) const
                              0, //column
                              &value);
 
-    return g_value_get_boolean(&value) == TRUE ? true : false;
+    return g_value_get_boolean(&value) != 0;
 }
 
 void wxCheckListBox::Check(unsigned int index, bool check)