]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/newgrid/griddemo.cpp
Added SetSelectionMode
[wxWidgets.git] / samples / newgrid / griddemo.cpp
index 7817e47a27ce3e06c03a7a8c455f3294a19ab70d..1e3586dd3dc1477959a30917d1203af89cc16ad1 100644 (file)
@@ -482,23 +482,27 @@ void GridFrame::InsertCol( wxCommandEvent& WXUNUSED(ev) )
 
 void GridFrame::DeleteSelectedRows( wxCommandEvent& WXUNUSED(ev) )
 {
+#if 0
     if ( grid->IsSelection() )
     {
         int topRow, bottomRow, leftCol, rightCol;
         grid->GetSelection( &topRow, &leftCol, &bottomRow, &rightCol );
         grid->DeleteRows( topRow, bottomRow - topRow + 1 );
     }
+#endif
 }
 
 
 void GridFrame::DeleteSelectedCols( wxCommandEvent& WXUNUSED(ev) )
 {
+#if 0
     if ( grid->IsSelection() )
     {
         int topRow, bottomRow, leftCol, rightCol;
         grid->GetSelection( &topRow, &leftCol, &bottomRow, &rightCol );
         grid->DeleteCols( leftCol, rightCol - leftCol + 1 );
     }
+#endif
 }
 
 
@@ -815,26 +819,10 @@ static const wxChar* severities[] =
 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;
-
-#ifndef __BORLANDC__
-    wxString platform;
-#else
-    wxChar *platform;
-#endif
-
+    wxChar platform[12];
     bool opened;
 } gs_dataBugsGrid [] =
 {
@@ -958,27 +946,11 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value )
             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:
-#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;
     }
 }