]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/checklst.cpp
Fix typo in last commit
[wxWidgets.git] / src / gtk / checklst.cpp
index f74635e4e01b55ebe30e9f389dcecefdb8aa51d3..a75aebf608ef942e4e12dea3f0be8ebe25e4ac62 100644 (file)
@@ -23,9 +23,8 @@
 //-----------------------------------------------------------------------------
 // "toggled"
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // "toggled"
 //-----------------------------------------------------------------------------
-#if wxUSE_NATIVEGTKCHECKLIST
 extern "C" {
 extern "C" {
-static void gtk_checklist_toggled(GtkCellRendererToggle *renderer,
+static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer),
                                   gchar                 *stringpath,
                                   wxCheckListBox        *listbox)
 {
                                   gchar                 *stringpath,
                                   wxCheckListBox        *listbox)
 {
@@ -36,19 +35,17 @@ static void gtk_checklist_toggled(GtkCellRendererToggle *renderer,
                               listbox->GetId() );
     new_event.SetEventObject( listbox );
     new_event.SetInt( gtk_tree_path_get_indices(path)[0] );
                               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()));
     gtk_tree_path_free(path);
     listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt()));
-    listbox->GetEventHandler()->ProcessEvent( new_event );
+    listbox->HandleWindowEvent( new_event );
 }
 }
 }
 }
-#endif
 
 //-----------------------------------------------------------------------------
 // wxCheckListBox
 //-----------------------------------------------------------------------------
 
 
 //-----------------------------------------------------------------------------
 // wxCheckListBox
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox,wxListBox)
-
 wxCheckListBox::wxCheckListBox() : wxListBox()
 {
     m_hasCheckBoxes = true;
 wxCheckListBox::wxCheckListBox() : wxListBox()
 {
     m_hasCheckBoxes = true;
@@ -80,7 +77,6 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
                        style, validator, name );
 }
 
                        style, validator, name );
 }
 
-#if wxUSE_NATIVEGTKCHECKLIST
 void wxCheckListBox::DoCreateCheckList()
 {
     //Create the checklist in our treeview and set up events for it
 void wxCheckListBox::DoCreateCheckList()
 {
     //Create the checklist in our treeview and set up events for it
@@ -90,7 +86,12 @@ void wxCheckListBox::DoCreateCheckList()
         gtk_tree_view_column_new_with_attributes( "", renderer,
                                                   "active", 0,
                                                   NULL );
         gtk_tree_view_column_new_with_attributes( "", renderer,
                                                   "active", 0,
                                                   NULL );
-    gtk_tree_view_column_set_fixed_width(column, 20);
+#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);
 
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
     gtk_tree_view_column_set_clickable(column, TRUE);
 
@@ -154,52 +155,4 @@ int wxCheckListBox::GetItemHeight() const
     return height;
 }
 
     return height;
 }
 
-#else //NON-NATIVE
-
-bool wxCheckListBox::IsChecked( int index ) const
-{
-    wxCHECK_MSG( m_treeview != NULL, false, wxT("invalid checklistbox") );
-
-    GtkTreeEntry* entry = GtkGetEntry(index);
-    if (entry)
-    {
-        wxString str( wxGTK_CONV_BACK( gtk_tree_entry_get_label(entry) ) );
-
-        return str.GetChar(1) == wxCHECKLBOX_CHECKED;
-    }
-
-    wxFAIL_MSG(wxT("wrong checklistbox index"));
-    return false;
-}
-
-void wxCheckListBox::Check( int index, bool check )
-{
-    wxCHECK_RET( m_treeview != NULL, wxT("invalid checklistbox") );
-
-    GtkTreeEntry* entry = GtkGetEntry(index);
-    if (entry)
-    {
-        wxString str( wxGTK_CONV_BACK( gtk_tree_entry_get_label(entry) ) );
-
-        if (check == (str.GetChar(1) == wxCHECKLBOX_CHECKED))
-            return;
-
-        str.SetChar( 1, check ? wxCHECKLBOX_CHECKED : wxCHECKLBOX_UNCHECKED );
-
-        gtk_tree_entry_set_label( entry, wxGTK_CONV( str ) );
-
-        return;
-    }
-
-    wxFAIL_MSG(wxT("wrong checklistbox index"));
-}
-
-int wxCheckListBox::GetItemHeight() const
-{
-    // FIXME
-    return 22;
-}
-
-#endif //wxUSE_NATIVEGTKCHECKLIST
-
 #endif //wxUSE_CHECKLISTBOX
 #endif //wxUSE_CHECKLISTBOX