@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
*/
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
// 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"