]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/gridctrl.cpp
initial native implementation of wxCalendarCtrl for MSW
[wxWidgets.git] / src / generic / gridctrl.cpp
index 27c709e3ab0ea017d2e8d5c4fd5835a5f7d581d5..0d69504f6575d1917357d74718773fba23f7f300 100644 (file)
@@ -65,7 +65,8 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int
     {
         void * tempval = table->GetValueAsCustom(row, col,wxGRID_VALUE_DATETIME);
 
-        if (tempval){
+        if (tempval)
+        {
             val = *((wxDateTime *)tempval);
             hasDatetime = true;
             delete (wxDateTime *)tempval;
@@ -76,13 +77,14 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int
     if (!hasDatetime )
     {
         text = table->GetValue(row, col);
-        hasDatetime = (val.ParseFormat( text, m_iformat, m_dateDef ) != (wxChar *)NULL) ;
+        const char * const end = val.ParseFormat(text, m_iformat, m_dateDef);
+        hasDatetime = end && !*end;
     }
 
     if ( hasDatetime )
         text = val.Format(m_oformat, m_tz );
 
-    //If we faild to parse string just show what we where given?
+    // If we failed to parse string just show what we where given?
     return text;
 }
 
@@ -292,12 +294,8 @@ wxGridCellAutoWrapStringEditor::Create(wxWindow* parent,
                                        wxWindowID id,
                                        wxEvtHandler* evtHandler)
 {
-  m_control = new wxTextCtrl(parent, id, wxEmptyString,
-                             wxDefaultPosition, wxDefaultSize,
-                             wxTE_MULTILINE | wxTE_RICH);
-
-
-  wxGridCellEditor::Create(parent, id, evtHandler);
+  wxGridCellTextEditor::DoCreate(parent, id, evtHandler,
+                                 wxTE_MULTILINE | wxTE_RICH);
 }
 
 void