Use dedicated IncBy method to increase wxSize value in propgrid sample.

Use this method instead of modifying directly wxSize data members.
This commit is contained in:
Artur Wieczorek 2015-06-14 17:10:28 +02:00
parent 87f0b6fe80
commit a1c888437d
2 changed files with 2 additions and 4 deletions

View File

@ -2472,8 +2472,7 @@ void FormMain::OnFitColumnsClick( wxCommandEvent& WXUNUSED(event) )
int dx = oldFullSize.x - oldGridSize.x; int dx = oldFullSize.x - oldGridSize.x;
int dy = oldFullSize.y - oldGridSize.y; int dy = oldFullSize.y - oldGridSize.y;
newSz.x += dx; newSz.IncBy(dx, dy);
newSz.y += dy;
SetSize(newSz); SetSize(newSz);
} }

View File

@ -1211,8 +1211,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxSize sz = GetSize(); wxSize sz = GetSize();
wxSize origSz = sz; wxSize origSz = sz;
sz.x += 5; sz.IncBy(5, 5);
sz.y += 5;
if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos ) if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos )
RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos).c_str()); RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos).c_str());