本文整理汇总了C++中wxRegion::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRegion::Contains方法的具体用法?C++ wxRegion::Contains怎么用?C++ wxRegion::Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRegion
的用法示例。
在下文中一共展示了wxRegion::Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawToDCClippedRgn
void wxPseudoDC::DrawToDCClippedRgn(wxDC *dc, const wxRegion& region)
{
pdcObjectList::Node *pt = m_objectlist.GetFirst();
pdcObject *obj;
while (pt)
{
obj = pt->GetData();
if (!obj->IsBounded() ||
(region.Contains(obj->GetBounds()) != wxOutRegion))
obj->DrawToDC(dc);
pt = pt->GetNext();
}
}
示例2: DrawWindowInfo
void WxGraphs::DrawWindowInfo(wxDC * dc, const wxRegion & repainted_region)
{
if (repainted_region.IsEmpty())
return;
int info_left_marg = m_screen_margins.leftmargin + 8;
int param_name_shift = 5;
if (m_draws.size() < 1)
return;
int w, h;
dc->GetSize(&w, &h);
DrawInfo *info = m_draws[0]->GetDrawInfo();
wxString name = info->GetSetName().c_str();
int namew, nameh;
dc->GetTextExtent(name, &namew, &nameh);
if (repainted_region.Contains(info_left_marg, m_screen_margins.infotopmargin, w - m_screen_margins.infotopmargin, nameh) == wxOutRegion)
return;
dc->SetTextForeground(*wxWHITE);
dc->DrawText(name, info_left_marg, m_screen_margins.infotopmargin);
wxColor color = dc->GetTextForeground();
int xpos = info_left_marg + namew + param_name_shift;
for (int i = 0; i < (int)m_draws.size(); ++i) {
if (!m_draws[i]->GetEnable())
continue;
DrawInfo *info = m_draws[i]->GetDrawInfo();
dc->SetTextForeground(info->GetDrawColor());
name = info->GetShortName().c_str();
dc->GetTextExtent(name, &namew, &nameh);
dc->DrawText(name, xpos, m_screen_margins.infotopmargin);
xpos += namew + param_name_shift;
}
dc->SetTextForeground(color);
}
示例3: Paint
void wxIFMComponent::Paint(wxDC &dc, const wxRegion ®ion)
{
// get component rect first
wxRect rect = m_rect;
// set clipping region of DC
dc.DestroyClippingRegion();
dc.SetClippingRegion(region);
// paint background first
wxIFMPaintEvent bgevt(wxEVT_IFM_PAINTBG, this, region, dc);
m_ip->ProcessPluginEvent(bgevt);
// paint border second
wxIFMPaintEvent bdevt(wxEVT_IFM_PAINTBORDER, this, region, dc);
m_ip->ProcessPluginEvent(bdevt);
// paint decorations last
wxIFMPaintEvent dcevt(wxEVT_IFM_PAINTDECOR, this, region, dc);
m_ip->ProcessPluginEvent(dcevt);
// recursively paint children of this component
for( size_t i = 0; i < m_children.GetCount(); i++ )
//for( wxIFMComponentArray::const_iterator i = m_children.begin(), end = m_children.end(); i != end; ++i )
{
//wxIFMComponent *child = *i;
wxIFMComponent *child = m_children[i];
// only paint the child if needed
if( child->IsVisible() )
{
wxRegionContain result = region.Contains(child->m_rect);
if( result == wxPartRegion || result == wxInRegion )
{
//wxRegion new_region = region;
//new_region.Intersect(child->m_rect);
child->Paint(dc, region);
}
}
}
}