+ int index = FindRegisteredDataType(typeName);
+ if ( index == wxNOT_FOUND )
+ {
+ // check whether this is one of the standard ones, in which case
+ // register it "on the fly"
+#if wxUSE_TEXTCTRL
+ if ( typeName == wxGRID_VALUE_STRING )
+ {
+ RegisterDataType(wxGRID_VALUE_STRING,
+ new wxGridCellStringRenderer,
+ new wxGridCellTextEditor);
+ } else
+#endif // wxUSE_TEXTCTRL
+#if wxUSE_CHECKBOX
+ if ( typeName == wxGRID_VALUE_BOOL )
+ {
+ RegisterDataType(wxGRID_VALUE_BOOL,
+ new wxGridCellBoolRenderer,
+ new wxGridCellBoolEditor);
+ } else
+#endif // wxUSE_CHECKBOX
+#if wxUSE_TEXTCTRL
+ if ( typeName == wxGRID_VALUE_NUMBER )
+ {
+ RegisterDataType(wxGRID_VALUE_NUMBER,
+ new wxGridCellNumberRenderer,
+ new wxGridCellNumberEditor);
+ }
+ else if ( typeName == wxGRID_VALUE_FLOAT )
+ {
+ RegisterDataType(wxGRID_VALUE_FLOAT,
+ new wxGridCellFloatRenderer,
+ new wxGridCellFloatEditor);
+ } else
+#endif // wxUSE_TEXTCTRL
+#if wxUSE_COMBOBOX
+ if ( typeName == wxGRID_VALUE_CHOICE )
+ {
+ RegisterDataType(wxGRID_VALUE_CHOICE,
+ new wxGridCellStringRenderer,
+ new wxGridCellChoiceEditor);
+ } else
+#endif // wxUSE_COMBOBOX
+ {
+ return wxNOT_FOUND;
+ }