本文整理汇总了C++中BMenu::Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenu::Invalidate方法的具体用法?C++ BMenu::Invalidate怎么用?C++ BMenu::Invalidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMenu
的用法示例。
在下文中一共展示了BMenu::Invalidate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetColor
void SetColor(rgb_color col)
{
if (!CompareColors (fColor, col)) {
fColor = col;
BMenu* parent = Menu();
if (parent) parent->Invalidate(Frame());
}
}
示例2: ResetColors
void ResetColors(rgb_color col, rgb_color initial)
{
if (!CompareColors(fColor, col) || !CompareColors (fInitialColor, initial)) {
fColor = col;
fInitialColor = initial;
BMenu* parent = Menu();
if (parent) parent->Invalidate(Frame());
}
}
示例3: Menu
void
IconMenuItem::SetMarked(bool mark)
{
_inherited::SetMarked(mark);
if (!mark)
return;
// we are marking the item
BMenu* menu = Menu();
if (menu == NULL)
return;
// we have a parent menu
BMenu* _menu = menu;
while ((_menu = _menu->Supermenu()) != NULL)
menu = _menu;
// went up the hierarchy to found the topmost menu
if (menu == NULL || menu->Parent() == NULL)
return;
// our topmost menu has a parent
if (dynamic_cast<BMenuField*>(menu->Parent()) == NULL)
return;
// our topmost menu's parent is a BMenuField
BMenuItem* topLevelItem = menu->ItemAt((int32)0);
if (topLevelItem == NULL)
return;
// our topmost menu has a menu item
IconMenuItem* topLevelIconMenuItem
= dynamic_cast<IconMenuItem*>(topLevelItem);
if (topLevelIconMenuItem == NULL)
return;
// our topmost menu's item is an IconMenuItem
// update the icon
topLevelIconMenuItem->SetIcon(fDeviceIcon);
menu->Invalidate();
}
示例4: Menu
void
BMenuItem::SetEnabled(bool state)
{
if (fEnabled == state)
return;
fEnabled = state;
if (fSubmenu != NULL)
fSubmenu->SetEnabled(state);
BMenu *menu = Menu();
if (menu != NULL && menu->LockLooper()) {
menu->Invalidate(fBounds);
menu->UnlockLooper();
}
}