本文整理汇总了C++中BMenu::IsRedrawAfterSticky方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenu::IsRedrawAfterSticky方法的具体用法?C++ BMenu::IsRedrawAfterSticky怎么用?C++ BMenu::IsRedrawAfterSticky使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMenu
的用法示例。
在下文中一共展示了BMenu::IsRedrawAfterSticky方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frame
void
TWindowMenuItem::Draw()
{
if (!fExpanded) {
BMenuItem::Draw();
return;
}
// TODO: Tint this smartly based on the low color, this does
// nothing to black.
rgb_color menuColor = tint_color(Menu()->LowColor(), 1.07);
BRect frame(Frame());
BMenu* menu = Menu();
menu->PushState();
// if not selected or being tracked on, fill with gray
TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView();
if ((!IsSelected() && !menu->IsRedrawAfterSticky())
|| barview->Dragging() || !IsEnabled()) {
rgb_color shadow = tint_color(menuColor, 1.09);
menu->SetHighColor(shadow);
frame.right = frame.left + kHPad / 2;
menu->FillRect(frame);
menu->SetHighColor(menuColor);
frame.left = frame.right + 1;
frame.right = Frame().right;
menu->FillRect(frame);
}
if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) {
// fill
rgb_color backColor = tint_color(menuColor,
B_HIGHLIGHT_BACKGROUND_TINT);
menu->SetLowColor(backColor);
menu->SetHighColor(backColor);
menu->FillRect(frame);
} else {
menu->SetLowColor(menuColor);
menu->SetHighColor(menuColor);
}
DrawContent();
menu->PopState();
}
示例2: frame
void
TTeamMenuItem::Draw()
{
BRect frame(Frame());
BMenu* menu = Menu();
menu->PushState();
rgb_color menuColor = menu->LowColor();
TBarView* barView = (static_cast<TBarApp*>(be_app))->BarView();
bool canHandle = !barView->Dragging()
|| barView->AppCanHandleTypes(Signature());
if (be_control_look != NULL) {
uint32 flags = 0;
if (_IsSelected() && canHandle)
flags |= BControlLook::B_ACTIVATED;
uint32 borders = BControlLook::B_TOP_BORDER;
if (fVertical) {
menu->SetHighColor(tint_color(menuColor, B_DARKEN_1_TINT));
borders |= BControlLook::B_LEFT_BORDER
| BControlLook::B_RIGHT_BORDER;
menu->StrokeLine(frame.LeftBottom(), frame.RightBottom());
frame.bottom--;
be_control_look->DrawMenuBarBackground(menu, frame, frame,
menuColor, flags, borders);
} else {
if (flags & BControlLook::B_ACTIVATED)
menu->SetHighColor(tint_color(menuColor, B_DARKEN_3_TINT));
else
menu->SetHighColor(tint_color(menuColor, 1.22));
borders |= BControlLook::B_BOTTOM_BORDER;
menu->StrokeLine(frame.LeftTop(), frame.LeftBottom());
frame.left++;
be_control_look->DrawButtonBackground(menu, frame, frame,
menuColor, flags, borders);
}
menu->MovePenTo(ContentLocation());
DrawContent();
menu->PopState();
return;
}
// if not selected or being tracked on, fill with gray
if ((!_IsSelected() && !menu->IsRedrawAfterSticky()) || !canHandle
|| !IsEnabled()) {
frame.InsetBy(1, 1);
menu->SetHighColor(menuColor);
menu->FillRect(frame);
}
// draw the gray, unselected item, border
if (!_IsSelected() || !IsEnabled()) {
rgb_color shadow = tint_color(menuColor, B_DARKEN_1_TINT);
rgb_color light = tint_color(menuColor, B_LIGHTEN_2_TINT);
frame = Frame();
menu->SetHighColor(shadow);
if (fVertical)
menu->StrokeLine(frame.LeftBottom(), frame.RightBottom());
else
menu->StrokeLine(frame.LeftBottom() + BPoint(1, 0),
frame.RightBottom());
menu->StrokeLine(frame.RightBottom(), frame.RightTop());
menu->SetHighColor(light);
menu->StrokeLine(frame.RightTop() + BPoint(-1, 0), frame.LeftTop());
if (fVertical)
menu->StrokeLine(frame.LeftTop(), frame.LeftBottom()
+ BPoint(0, -1));
else
menu->StrokeLine(frame.LeftTop(), frame.LeftBottom());
}
// if selected or being tracked on, fill with the hilite gray color
if (IsEnabled() && _IsSelected() && !menu->IsRedrawAfterSticky()
&& canHandle) {
// fill
menu->SetHighColor(tint_color(menuColor, B_HIGHLIGHT_BACKGROUND_TINT));
menu->FillRect(frame);
// these continue the dark grey border on the left or top edge
menu->SetHighColor(tint_color(menuColor, B_DARKEN_4_TINT));
if (fVertical) {
// dark line at top
menu->StrokeLine(frame.LeftTop(), frame.RightTop());
} else {
// dark line on the left
menu->StrokeLine(frame.LeftTop(), frame.LeftBottom());
}
} else
menu->SetLowColor(menuColor);
menu->MovePenTo(ContentLocation());
DrawContent();
//.........这里部分代码省略.........