X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ecd69fb6e90d50981b109a6ea965b0d097988eb0..dda4f6c089cd8db779cd10904be3263c72d98700:/samples/newgrid/griddemo.cpp diff --git a/samples/newgrid/griddemo.cpp b/samples/newgrid/griddemo.cpp index d4ba949a91..e1820b8a53 100644 --- a/samples/newgrid/griddemo.cpp +++ b/samples/newgrid/griddemo.cpp @@ -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); } }