added wxGridUpdateLocker helper class wrapping Begin/EndBatch() calls in a more convenient and safe way
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -668,7 +668,7 @@ void GridFrame::DeleteSelectedRows( wxCommandEvent& WXUNUSED(ev) )
|
||||
{
|
||||
if ( grid->IsSelection() )
|
||||
{
|
||||
grid->BeginBatch();
|
||||
wxGridUpdateLocker locker(grid);
|
||||
for ( int n = 0; n < grid->GetNumberRows(); )
|
||||
{
|
||||
if ( grid->IsInSelection( n , 0 ) )
|
||||
@@ -676,7 +676,6 @@ void GridFrame::DeleteSelectedRows( wxCommandEvent& WXUNUSED(ev) )
|
||||
else
|
||||
n++;
|
||||
}
|
||||
grid->EndBatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +684,7 @@ void GridFrame::DeleteSelectedCols( wxCommandEvent& WXUNUSED(ev) )
|
||||
{
|
||||
if ( grid->IsSelection() )
|
||||
{
|
||||
grid->BeginBatch();
|
||||
wxGridUpdateLocker locker(grid);
|
||||
for ( int n = 0; n < grid->GetNumberCols(); )
|
||||
{
|
||||
if ( grid->IsInSelection( 0 , n ) )
|
||||
@@ -693,7 +692,6 @@ void GridFrame::DeleteSelectedCols( wxCommandEvent& WXUNUSED(ev) )
|
||||
else
|
||||
n++;
|
||||
}
|
||||
grid->EndBatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user