]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/newgrid/griddemo.cpp
Applied patch [ 651640 ] Toolbar sizing fix
[wxWidgets.git] / samples / newgrid / griddemo.cpp
index d4ba949a91c4cd875fdc784953f1cc8f07d8237f..e1820b8a53983060fe4a7068715456537134b4cb 100644 (file)
@@ -246,7 +246,13 @@ GridFrame::GridFrame()
 
     // this will create a grid and, by default, an associated grid
     // table for strings
-    grid->CreateGrid( 100, 100 );
+    grid->CreateGrid( 0, 0 );
+    grid->AppendRows(100);
+    grid->AppendCols(100);
+
+    int ir = grid->GetNumberRows();
+    grid->DeleteRows(0, ir);
+    grid->AppendRows(ir);
 
     grid->SetRowSize( 0, 60 );
     grid->SetCellValue( 0, 0, "Ctrl+Home\nwill go to\nthis cell" );
@@ -699,8 +705,11 @@ void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) )
     wxColour col = wxGetColourFromUser(this);
     if ( col.Ok() )
     {
+        // Check the new Refresh function by passing it a rectangle
+        // which exactly fits the grid.
+        wxRect r(wxPoint(0, 0), grid->GetSize());
         grid->SetDefaultCellBackgroundColour(col);
-        grid->Refresh();
+        grid->Refresh(TRUE, &r);
     }
 }