]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/newgrid/griddemo.cpp
added demo of capturing program output - doesn't work very well though
[wxWidgets.git] / samples / newgrid / griddemo.cpp
index 23ff16424d401d51b2fc3d1ab052778a98b95231..c8d754d620ba994dd74b3817645c4d2132051939 100644 (file)
@@ -669,9 +669,9 @@ void GridFrame::OnVTable(wxCommandEvent& )
     s = wxGetTextFromUser( "Size of the table to create",
                            "Size:",
                            s );
     s = wxGetTextFromUser( "Size of the table to create",
                            "Size:",
                            s );
-    
+
     s.ToLong( &s_sizeGrid );
     s.ToLong( &s_sizeGrid );
-    
+
 #else
     s_sizeGrid = wxGetNumberFromUser("Size of the table to create",
                                      "Size: ",
 #else
     s_sizeGrid = wxGetNumberFromUser("Size of the table to create",
                                      "Size: ",
@@ -679,7 +679,7 @@ void GridFrame::OnVTable(wxCommandEvent& )
                                      s_sizeGrid,
                                      0, 32000, this);
 #endif
                                      s_sizeGrid,
                                      0, 32000, this);
 #endif
-    
+
     if ( s_sizeGrid != -1 )
     {
         BigGridFrame* win = new BigGridFrame(s_sizeGrid);
     if ( s_sizeGrid != -1 )
     {
         BigGridFrame* win = new BigGridFrame(s_sizeGrid);
@@ -815,28 +815,12 @@ static const wxChar* severities[] =
 static struct BugsGridData
 {
     int id;
 static struct BugsGridData
 {
     int id;
-
-    // Borland can't deal with global wxStrings and will generate a
-    // compile time error with the initializing the gs_dataGridBugs
-    // array (below)
-    //
-#ifndef __BORLANDC__
-    wxString summary;
-#else
-    wxChar *summary;
-#endif
-
+    wxChar summary[80];
     Severity severity;
     int prio;
     Severity severity;
     int prio;
-    
-#ifndef __BORLANDC__
-    wxString platform;
-#else
-    wxChar *platform;
-#endif
-
+    wxChar platform[12];
     bool opened;
     bool opened;
-} gs_dataBugsGrid [] = 
+} gs_dataBugsGrid [] =
 {
     { 18, _T("foo doesn't work"), Sev_Major, 1, _T("wxMSW"), TRUE },
     { 27, _T("bar crashes"), Sev_Critical, 1, _T("all"), FALSE },
 {
     { 18, _T("foo doesn't work"), Sev_Major, 1, _T("wxMSW"), TRUE },
     { 27, _T("bar crashes"), Sev_Critical, 1, _T("all"), FALSE },
@@ -870,8 +854,10 @@ wxString BugsGridTable::GetTypeName(int WXUNUSED(row), int col)
             // fall thorugh (TODO should be a list)
 
         case Col_Summary:
             // fall thorugh (TODO should be a list)
 
         case Col_Summary:
+            return wxString::Format(_T("%s:80"), wxGRID_VALUE_STRING);
+
         case Col_Platform:
         case Col_Platform:
-            return wxGRID_VALUE_STRING;
+            return wxString::Format(_T("%s:all,MSW,GTK,other"), wxGRID_VALUE_CHOICE);
 
         case Col_Opened:
             return wxGRID_VALUE_BOOL;
 
         case Col_Opened:
             return wxGRID_VALUE_BOOL;
@@ -956,27 +942,11 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value )
             break;
 
         case Col_Summary:
             break;
 
         case Col_Summary:
-#ifndef __BORLANDC__
-            gd.summary = value;
-#else
-            // this generates a warning message if you are using the
-            // memory tracing code but it should be ok :MB
-            //
-            delete gd.summary;
-            gd.summary = copystring( value.c_str() );
-#endif
+            wxStrncpy(gd.summary, value, WXSIZEOF(gd.summary));
             break;
 
         case Col_Platform:
             break;
 
         case Col_Platform:
-#ifndef __BORLANDC__
-            gd.platform = value;
-#else            
-            // this generates a warning message if you are using the
-            // memory tracing code but it should be ok :MB
-            //
-            delete gd.platform;
-            gd.platform = copystring( value.c_str() );
-#endif
+            wxStrncpy(gd.platform, value, WXSIZEOF(gd.platform));
             break;
     }
 }
             break;
     }
 }