本文整理汇总了C++中wxRect::Deflate方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::Deflate方法的具体用法?C++ wxRect::Deflate怎么用?C++ wxRect::Deflate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::Deflate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InflateDeflate
void RectTestCase::InflateDeflate()
{
// This is the rectangle from the example in the documentation of wxRect::Inflate().
const wxRect r1(10, 10, 20, 40);
CPPUNIT_ASSERT(r1.Inflate( 10, 10)==wxRect( 0, 0, 40, 60));
CPPUNIT_ASSERT(r1.Inflate( 20, 30)==wxRect(-10, -20, 60, 100));
CPPUNIT_ASSERT(r1.Inflate(-10, -10)==wxRect( 20, 20, 0, 20));
CPPUNIT_ASSERT(r1.Inflate(-15, -15)==wxRect( 20, 25, 0, 10));
CPPUNIT_ASSERT(r1.Inflate( 10, 10)==r1.Deflate(-10, -10));
CPPUNIT_ASSERT(r1.Inflate( 20, 30)==r1.Deflate(-20, -30));
CPPUNIT_ASSERT(r1.Inflate(-10, -10)==r1.Deflate( 10, 10));
CPPUNIT_ASSERT(r1.Inflate(-15, -15)==r1.Deflate( 15, 15));
}
示例2:
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
// rect is in screen coordinates.
wxAccStatus
KeyViewAx::GetLocation(wxRect & rect, int elementId)
{
int line;
if (IdToLine(elementId, line))
{
wxRect rectLine;
rectLine.width = mView->GetClientSize().GetWidth();
// iterate over all visible lines
for (int i = 0; i < line; i++)
{
wxCoord hLine = mView->GetLineHeight(i);
rectLine.height = hLine;
rect = rectLine;
wxPoint margins = mView->GetMargins();
rect.Deflate(margins.x, margins.y);
rectLine.y += hLine;
}
rect.SetPosition(mView->ClientToScreen(rect.GetPosition()));
}
else
{
rect = mView->GetRect();
rect.SetPosition(mView->GetParent()->ClientToScreen(rect.GetPosition()));
}
return wxACC_OK;
}
示例3: Render
virtual bool Render( wxRect rect, wxDC *dc, int state )
{
dc->SetBrush( *wxLIGHT_GREY_BRUSH );
dc->SetPen( *wxTRANSPARENT_PEN );
rect.Deflate(2);
dc->DrawRoundedRectangle( rect, 5 );
RenderText(m_value,
0, // no offset
wxRect(dc->GetTextExtent(m_value)).CentreIn(rect),
dc,
state);
return true;
}
示例4: DrawFore
void CPathCtrl::DrawFore(wxDC &dc, wxRect &rc)
{
rc.Deflate(0, 2);
// rc.SetWidth(rc.GetWidth() - CORNER_LENGTH);
int count = m_PathList.GetCount();
if(count > 0)
{
wxRect rcItem = rc;
int width = rc.GetWidth() / count;
rcItem.SetWidth(width);
ItemList::Node *node = m_PathList.GetFirst();
while (node)
{
CPathItem *item = (CPathItem*)node->GetData();
item->DrawFore(dc, rcItem);
rcItem.Offset(width, 0);
node = node->GetNext();
}
}
}