本文整理汇总了C++中BView::PopState方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::PopState方法的具体用法?C++ BView::PopState怎么用?C++ BView::PopState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::PopState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
WorkspacesView::_CleanupParentClipping()
{
// Restore the previous parent state. NOTE: This relies on views
// being detached in exactly the opposite order as them being
// attached. Otherwise we would mess up states if a sibbling view did
// the same thing we did in AttachedToWindow()...
fParentWhichDrawsOnChildren->PopState();
}
示例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
//.........这里部分代码省略.........
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];
message.ReadList(points, 3);
if (message.Read(bounds) != B_OK)
continue;
if (code == RP_STROKE_TRIANGLE) {
offscreen->StrokeTriangle(points[0], points[1], points[2],
bounds, pattern);
bounds.InsetBy(-penSize, -penSize);
} else if (code == RP_FILL_TRIANGLE) {
offscreen->FillTriangle(points[0], points[1], points[2],
bounds, pattern);
} else {
BGradient *gradient;