Refactor: Use dedicated methods to manipulate wxRect members.

This commit is contained in:
Artur Wieczorek
2015-07-07 21:51:30 +02:00
parent 6a435345f5
commit 7d77168936
3 changed files with 4 additions and 6 deletions

View File

@@ -861,7 +861,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
if ( useCustomPaintProcedure ) if ( useCustomPaintProcedure )
{ {
pt.x += wxCC_CUSTOM_IMAGE_MARGIN1; pt.x += wxCC_CUSTOM_IMAGE_MARGIN1;
wxRect r(pt.x,pt.y,cis.x,cis.y); wxRect r(pt, cis);
if ( flags & wxODCB_PAINTING_CONTROL ) if ( flags & wxODCB_PAINTING_CONTROL )
{ {
@@ -1883,8 +1883,7 @@ void wxPropertyGrid::FixPosForTextCtrl( wxWindow* ctrl,
finalPos.x += textCtrlXAdjust; finalPos.x += textCtrlXAdjust;
finalPos.width -= textCtrlXAdjust; finalPos.width -= textCtrlXAdjust;
finalPos.x += offset.x; finalPos.Offset(offset);
finalPos.y += offset.y;
ctrl->SetSize(finalPos); ctrl->SetSize(finalPos);
} }

View File

@@ -111,8 +111,7 @@ void wxPGCellRenderer::DrawEditorValue( wxDC& dc, const wxRect& rect,
if ( editor ) if ( editor )
{ {
wxRect rect2(rect); wxRect rect2(rect);
rect2.x += xOffset; rect2.Offset(xOffset, yOffset);
rect2.y += yOffset;
rect2.height -= yOffset; rect2.height -= yOffset;
editor->DrawValue( dc, rect2, property, text ); editor->DrawValue( dc, rect2, property, text );
} }

View File

@@ -1929,7 +1929,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect,
{ {
// Prepare rectangle to be used // Prepare rectangle to be used
wxRect r(rect); wxRect r(rect);
r.x += m_gutterWidth; r.y += m_buttonSpacingY; r.Offset(m_gutterWidth, m_buttonSpacingY);
r.width = m_iconWidth; r.height = m_iconHeight; r.width = m_iconWidth; r.height = m_iconHeight;
#if (wxPG_USE_RENDERER_NATIVE) #if (wxPG_USE_RENDERER_NATIVE)