本文整理汇总了C++中BView::PushState方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::PushState方法的具体用法?C++ BView::PushState怎么用?C++ BView::PushState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::PushState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clipping
void
WorkspacesView::_ExcludeFromParentClipping()
{
// Prevent the parent view to draw over us. Do so in a way that allows
// restoring the parent to the previous state.
fParentWhichDrawsOnChildren->PushState();
BRegion clipping(fParentWhichDrawsOnChildren->Bounds());
clipping.Exclude(Frame());
fParentWhichDrawsOnChildren->ConstrainClippingRegion(&clipping);
}
示例2: DrawStatusBar
void wxStatusBarBeOS::DrawStatusBar()
{
int i=0;
int leftPos=0;
wxArrayInt widthsAbs;
wxString text;
m_view->Clear();
BRect bounds(m_view->bounds());
BView * drawview = m_view->GetBack();
if(drawview->LockLooper())
{
rgb_color clr;
drawview->PushState();
clr = drawview->ViewColor();
clr.red-=50; clr.green-=50; clr.blue-=50;
drawview->SetHighColor(clr);
drawview->StrokeLine(BPoint(bounds.left, bounds.top), BPoint(bounds.right, bounds.top));
clr.red+=100; clr.green+=100; clr.blue+=100;
drawview->SetHighColor(clr);
drawview->StrokeLine(BPoint(bounds.left, bounds.top+1), BPoint(bounds.right, bounds.top+1));
drawview->PopState();
if(m_nFields>0)
widthsAbs = CalculateAbsWidths(bounds.IntegerWidth() - 2*(m_nFields - 1));
drawview->SetDrawingMode(B_OP_OVER);
for(i=0;i<m_nFields;i++)
{
text = GetStatusBufferText(i);
drawview->DrawString(text, BPoint(leftPos, bounds.bottom-2));
leftPos+=widthsAbs[i]+2;
}
drawview->UnlockLooper();
}
m_view->flush();
}
示例3: reply
//.........这里部分代码省略.........
case RP_FILL_SHAPE:
case RP_FILL_SHAPE_GRADIENT:
{
BRect bounds;
int32 opCount, pointCount;
message.Read(bounds);
if (message.Read(opCount) != B_OK)
continue;
BMessage archive;
for (int32 i = 0; i < opCount; i++) {
int32 op;
message.Read(op);
archive.AddInt32("ops", op);
}
if (message.Read(pointCount) != B_OK)
continue;
for (int32 i = 0; i < pointCount; i++) {
BPoint point;
message.Read(point);
archive.AddPoint("pts", point);
}
BPoint offset;
message.Read(offset);
float scale;
if (message.Read(scale) != B_OK)
continue;
offscreen->PushState();
offscreen->MovePenTo(offset);
offscreen->SetScale(scale);
BShape shape(&archive);
if (code == RP_STROKE_SHAPE) {
offscreen->StrokeShape(&shape, pattern);
bounds.InsetBy(-penSize, -penSize);
} else if (code == RP_FILL_SHAPE)
offscreen->FillShape(&shape, pattern);
else {
BGradient *gradient;
if (message.ReadGradient(&gradient) != B_OK) {
offscreen->PopState();
continue;
}
offscreen->FillShape(&shape, *gradient);
delete gradient;
}
offscreen->PopState();
invalidRegion.Include(bounds);
break;
}
case RP_STROKE_TRIANGLE:
case RP_FILL_TRIANGLE:
case RP_FILL_TRIANGLE_GRADIENT:
{
BRect bounds;
BPoint points[3];