X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9a67fc247758a8f590e82f1277463376e91058c..86f6a6d19dd83364e32f35873009fc2bb762091c:/samples/grid/griddemo.cpp?ds=sidebyside diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index af1a576dae..855b24e44d 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -16,11 +16,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(__APPLE__) - #pragma implementation - #pragma interface -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -99,7 +94,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame ) EVT_MENU( ID_SET_CELL_FG_COLOUR, GridFrame::SetCellFgColour ) EVT_MENU( ID_SET_CELL_BG_COLOUR, GridFrame::SetCellBgColour ) - EVT_MENU( ID_ABOUT, GridFrame::About ) + EVT_MENU( wxID_ABOUT, GridFrame::About ) EVT_MENU( wxID_EXIT, GridFrame::OnQuit ) EVT_MENU( ID_VTABLE, GridFrame::OnVTable) EVT_MENU( ID_BUGS_TABLE, GridFrame::OnBugsTable) @@ -215,7 +210,7 @@ GridFrame::GridFrame() wxMenu *helpMenu = new wxMenu; - helpMenu->Append( ID_ABOUT, _T("&About wxGrid demo") ); + helpMenu->Append( wxID_ABOUT, _T("&About wxGrid demo") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( fileMenu, _T("&File") ); @@ -661,10 +656,12 @@ void GridFrame::DeleteSelectedRows( wxCommandEvent& WXUNUSED(ev) ) { grid->BeginBatch(); for ( int n = 0; n < grid->GetNumberRows(); ) + { if ( grid->IsInSelection( n , 0 ) ) grid->DeleteRows( n, 1 ); - else - n++; + else + n++; + } grid->EndBatch(); } } @@ -676,10 +673,12 @@ void GridFrame::DeleteSelectedCols( wxCommandEvent& WXUNUSED(ev) ) { grid->BeginBatch(); for ( int n = 0; n < grid->GetNumberCols(); ) + { if ( grid->IsInSelection( 0 , n ) ) grid->DeleteCols( n, 1 ); - else - n++; + else + n++; + } grid->EndBatch(); } } @@ -888,7 +887,7 @@ void GridFrame::OnCellValueChanged( wxGridEvent& ev ) void GridFrame::OnCellBeginDrag( wxGridEvent& ev ) { - logBuf = _T(""); + logBuf = wxEmptyString; logBuf << _T("Got request to drag cell at") << _T(" row ") << ev.GetRow() << _T(" col ") << ev.GetCol(); @@ -935,7 +934,7 @@ void GridFrame::OnEditorHidden( wxGridEvent& ev ) void GridFrame::About( wxCommandEvent& WXUNUSED(ev) ) { (void)wxMessageBox( _T("\n\nwxGrid demo \n\n") - _T("Michael Bedward, Julian Small, Vadim Zeitlin"), + _T("Michael Bedward, Julian Smart, Vadim Zeitlin"), _T("About"), wxOK ); }