]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
don't free user data before sending wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, this prevent...
[wxWidgets.git] / src / generic / grid.cpp
index 67c696f3b71d85b877477613c2c8aebd2f2dc42b..4b0e08f185394ae8a8d3136a4628f509cf4bc419 100644 (file)
@@ -8882,14 +8882,24 @@ void wxGrid::SetDefaultCellFont( const wxFont& font )
     m_defaultCellAttr->SetFont(font);
 }
 
+
+// For editors and renderers the type registry takes precedence over the
+// default attr, so we need to register the new editor/renderer for the string
+// data type in order to make setting a default editor/renderer appear to
+// work correctly.
+
 void wxGrid::SetDefaultRenderer(wxGridCellRenderer *renderer)
 {
-    m_defaultCellAttr->SetRenderer(renderer);
+    RegisterDataType(wxGRID_VALUE_STRING,
+                     renderer,
+                     GetDefaultEditorForType(wxGRID_VALUE_STRING));
 }
 
 void wxGrid::SetDefaultEditor(wxGridCellEditor *editor)
 {
-    m_defaultCellAttr->SetEditor(editor);
+    RegisterDataType(wxGRID_VALUE_STRING,
+                     GetDefaultRendererForType(wxGRID_VALUE_STRING),
+                     editor);                     
 }
 
 // ----------------------------------------------------------------------------