]> git.saurik.com Git - wxWidgets.git/commitdiff
Correction to: Support diabling items in GTK+, see #12686: Allow disabling of wxDVC...
authorRobert Roebling <robert@roebling.de>
Mon, 20 Dec 2010 19:13:13 +0000 (19:13 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 20 Dec 2010 19:13:13 +0000 (19:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/dataview.h
src/gtk/dataview.cpp

index e9da457e58a8a6187fa4cdfb8fec1d1c54b9f395..f1ff60bf579f15cd2603c3ee430451a731634fd6 100644 (file)
@@ -185,8 +185,8 @@ public:
 
         @note Currently disabling items is fully implemented only for the
               native control implementation in wxOSX/Cocoa. This feature is
-              partially supported in the generic version but not in wxGTK or
-              wxOSX/Carbon native implementations.
+              only partially supported in the generic version (wxMSW) and
+              currently not supported by the wxOSX/Carbon implementation.
 
         @since 2.9.2
     */
index 3bbb38b53b02d583cd602f0b3728c3e821df05b9..4ebd29fc9aa09620673abf0bef7a2a3fc3e0e03e 100644 (file)
@@ -2930,6 +2930,22 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
 
     cell->SetValue( value );
 
+    // deal with disabled items
+    bool enabled = wx_model->IsEnabled( item, cell->GetOwner()->GetModelColumn() );
+
+    // a) this sets the appearance to disabled grey    
+    GValue gvalue = { 0, };
+    g_value_init( &gvalue, G_TYPE_BOOLEAN );
+    g_value_set_boolean( &gvalue, enabled );
+    g_object_set_property( G_OBJECT(renderer), "sensitive", &gvalue );
+    g_value_unset( &gvalue );
+
+    // b) this actually disables the control/renderer
+    if (enabled)
+        cell->SetMode( cell->GtkGetMode() );
+    else
+        cell->SetMode( wxDATAVIEW_CELL_INERT );
+        
 
     // deal with attributes: if the renderer doesn't support them at all, we
     // don't even need to query the model for them
@@ -2947,18 +2963,6 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
     // else: no custom attributes specified and we're already using the default
     //       ones -- nothing to do
     
-    // deal with disabled items
-    bool enabled = wx_model->IsEnabled( item, cell->GetOwner()->GetModelColumn());
-    GValue gvalue = { 0, };
-    g_value_init( &gvalue, G_TYPE_BOOLEAN );
-    g_value_set_boolean( &gvalue, enabled );
-    g_object_set_property( G_OBJECT(renderer), "sensitive", &gvalue );
-    g_value_unset( &gvalue );
-
-    if (enabled)
-        cell->SetMode( cell->GtkGetMode() );
-    else
-        cell->SetMode( wxDATAVIEW_CELL_INERT );
 }
 
 } // extern "C"