本文整理汇总了C++中BView::Flags方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::Flags方法的具体用法?C++ BView::Flags怎么用?C++ BView::Flags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::Flags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parent
void
WorkspacesView::AttachedToWindow()
{
BView* parent = Parent();
if (parent != NULL && (parent->Flags() & B_DRAW_ON_CHILDREN) != 0) {
fParentWhichDrawsOnChildren = parent;
_ExcludeFromParentClipping();
}
}
示例2: leftTop
void
BPrintJob::_RecurseView(BView* view, BPoint origin, BPicture* picture,
BRect rect)
{
ASSERT(picture != NULL);
BRegion region;
region.Set(BRect(rect.left, rect.top, rect.right, rect.bottom));
view->fState->print_rect = rect;
view->AppendToPicture(picture);
view->PushState();
view->SetOrigin(origin);
view->ConstrainClippingRegion(®ion);
if (view->ViewColor() != B_TRANSPARENT_COLOR) {
rgb_color highColor = view->HighColor();
view->SetHighColor(view->ViewColor());
view->FillRect(rect);
view->SetHighColor(highColor);
}
view->fIsPrinting = true;
view->Draw(rect);
view->fIsPrinting = false;
view->PopState();
view->EndPicture();
BView* child = view->ChildAt(0);
while (child != NULL) {
if ((child->Flags() & B_WILL_DRAW) && !child->IsHidden()) {
BPoint leftTop(view->Bounds().LeftTop() + child->Frame().LeftTop());
BRect printRect(rect.OffsetToCopy(rect.LeftTop() - leftTop)
& child->Bounds());
if (printRect.IsValid())
_RecurseView(child, origin + leftTop, picture, printRect);
}
child = child->NextSibling();
}
if ((view->Flags() & B_DRAW_ON_CHILDREN) != 0) {
view->AppendToPicture(picture);
view->PushState();
view->SetOrigin(origin);
view->ConstrainClippingRegion(®ion);
view->fIsPrinting = true;
view->DrawAfterChildren(rect);
view->fIsPrinting = false;
view->PopState();
view->EndPicture();
}
}
示例3: AttachedToWindow
void SnowView::AttachedToWindow()
{
BView *p;
rgb_color col;
fAttached = true;
/* if (!fMsgRunner)
fMsgRunner = new BMessageRunner(BMessenger(this),
new BMessage(MSG_PULSE_ME),
INTERVAL);
*/
p = Parent();
if (p)
col = B_TRANSPARENT_32_BIT;//Parent()->ViewColor();
else
col = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(col);
// BScreen bs;
// fCachedWsWidth = bs.Frame().IntegerWidth();
// fCachedWsHeight = bs.Frame().IntegerHeight();
fDragger = dynamic_cast<BDragger *>(FindView("_dragger_"));
if (fDragger && p) {
fCachedParent = p;
fCachedWsWidth = p->Frame().IntegerWidth();
fCachedWsHeight = p->Frame().IntegerHeight();
fDragger->SetViewColor(col);
if (fDragger->InShelf()) {
p->SetFlags(p->Flags() | B_DRAW_ON_CHILDREN);
#ifdef B_BEOS_VERSION_DANO
p->SetDoubleBuffering(p->DoubleBuffering() | B_UPDATE_EXPOSED);
#endif
ResizeTo(p->Bounds().Width(), p->Bounds().Height());
MoveTo(0,0);
fDragger->MoveTo(p->Bounds().Width()-7, p->Bounds().Height()-7);
}
BRect fallenRect(p->Bounds());
fallenRect.top = fallenRect.bottom - FALLEN_HEIGHT;
fFallenBmp = new BBitmap(fallenRect, B_BITMAP_ACCEPTS_VIEWS, B_CMAP8);
memset(fFallenBmp->Bits(), B_TRANSPARENT_MAGIC_CMAP8, (size_t)(fallenRect.Height()*fFallenBmp->BytesPerRow()));
fFallenView = new BView(fallenRect, "offscreen fallen snow", B_FOLLOW_NONE, 0);
fFallenBmp->AddChild(fFallenView);
fFallenReg = new BRegion;
fInvalidator = spawn_thread(SnowMakerThread, INVALIDATOR_THREAD_NAME, B_LOW_PRIORITY, (void *)this);
resume_thread(fInvalidator);
printf("BSnow: OK: ws = %ld x %ld\n", fCachedWsWidth, fCachedWsHeight);
#ifdef DEBUG
Window()->AddCommonFilter(new BMessageFilter(B_ANY_DELIVERY, B_ANY_SOURCE, msgfilter));
#endif
}
}
示例4: Read
status_t
CanvasMessage::ReadViewState(BView& view, ::pattern& pattern)
{
bool subPixelPrecise;
float penSize, miterLimit;
drawing_mode drawingMode;
source_alpha sourceAlpha;
alpha_function alphaFunction;
cap_mode capMode;
join_mode joinMode;
rgb_color highColor, lowColor;
Read(penSize);
Read(subPixelPrecise);
Read(drawingMode);
Read(sourceAlpha);
Read(alphaFunction);
Read(pattern);
Read(capMode);
Read(joinMode);
Read(miterLimit);
Read(highColor);
status_t result = Read(lowColor);
if (result != B_OK)
return result;
uint32 flags = view.Flags() & ~B_SUBPIXEL_PRECISE;
view.SetFlags(flags | (subPixelPrecise ? B_SUBPIXEL_PRECISE : 0));
view.SetPenSize(penSize);
view.SetDrawingMode(drawingMode);
view.SetBlendingMode(sourceAlpha, alphaFunction);
view.SetLineMode(capMode, joinMode, miterLimit);
view.SetHighColor(highColor);
view.SetLowColor(lowColor);
return B_OK;
}
示例5: MakeConfigurationView
// ---------------------------------------------------------------
// MakeConfigurationView
//
// Makes a BView object for configuring / displaying info about
// this translator.
//
// Preconditions:
//
// Parameters: ioExtension, configuration options for the
// translator
//
// outView, the view to configure the
// translator is stored here
//
// outExtent, the bounds of the view are
// stored here
//
// Postconditions:
//
// Returns:
// ---------------------------------------------------------------
status_t
BaseTranslator::MakeConfigurationView(BMessage *ioExtension, BView **outView,
BRect *outExtent)
{
if (!outView || !outExtent)
return B_BAD_VALUE;
if (ioExtension && fSettings->LoadSettings(ioExtension) != B_OK)
return B_BAD_VALUE;
BView *view = NewConfigView(AcquireSettings());
// implemented in derived class
if (view) {
*outView = view;
if ((view->Flags() & B_SUPPORTS_LAYOUT) != 0)
view->ResizeTo(view->ExplicitPreferredSize());
*outExtent = view->Bounds();
return B_OK;
} else
return BTranslator::MakeConfigurationView(ioExtension, outView,
outExtent);
}