本文整理汇总了C++中MenuItem::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItem::GetName方法的具体用法?C++ MenuItem::GetName怎么用?C++ MenuItem::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectItemByName
void ComboBox::SelectItemByName(const std::string& name, bool do_events)
{
std::list<Base*>& children = _menu->GetChildren();
auto begin = children.begin();
while (begin != children.end())
{
MenuItem* child = dynamic_cast<MenuItem*>(*begin);
if (child->GetName() == name)
{
return SelectItem(child, do_events);
}
++begin;
}
}
示例2: CreateMenu
fresult ItemsListFormBase::CreateMenu( IMenu** o_mnu )
{
fresult fres;
MenuFactory* mf = _Factories->GetMenuFactory();
//ready factory
mf->CurrentInterlaced = true;
mf->CurrentTextFormatHandle = TF_MENU;
mf->CurrentEvenTextFormatHandle = TF_MENUEVEN;
mf->ClearSettings();
//Set up menu
MenuItemSettings* settings = mf->Settings;
MenuItemSettings* mis;
//ItemOriginX
mis = &settings[ItemOriginX];
mis->ImgHandle = scroll_up;
mis->Handler = _AutoDispatchMenuHandler;
mis->Empty = FALSE;
//ItemOriginZ
mis = &settings[ItemOriginZ];
mis->ImgHandle = scroll_down;
mis->Handler = _AutoDispatchMenuHandler;
mis->Empty = FALSE;
//ItemOriginL
mis = &settings[ItemOriginL];
mis->ImgHandle = small_arrow_bottom;
mis->Text = _prevText;
mis->Handler = _AutoDispatchMenuHandler;
mis->Empty = FALSE;
//ItemOriginE
mis = &settings[ItemOriginE];
mis->ImgHandle = small_arrow_bottom;
mis->Text = "назад";
fres = _FormManager->GetCloseFormHandler(&mis->Handler, fsrCancel);
ENSURESUCCESS(fres);
mis->Empty = FALSE;
//ItemOriginR
mis = &settings[ItemOriginR];
mis->ImgHandle = small_arrow_bottom;
mis->Text = _nextText;
mis->Handler = _AutoDispatchMenuHandler;
mis->Empty = FALSE;
//call derived update settings
UpdateMenuSettings(settings);
//create mnu
IMenu* mnu = NULL;
fres = mf->GetMenu(ABCXYZLER, &mnu);
ENSURESUCCESS(fres);
for (ubyte_t i=0; i<mnu->GetItemsCount();i++)
{
MenuItem* mi = (MenuItem*)(mnu->GetItem(i));
if (StringEquals(mi->GetName(), "L") == TRUE)
{
_mnuBack = mi;
}
if (StringEquals(mi->GetName(), "R") == TRUE)
{
_mnuNext = mi;
}
}
//Clean up
mf->ClearSettings();
mf->DefaultInterlaced=mf->CurrentInterlaced;
mf->DefaultTextFormatHandle=mf->CurrentTextFormatHandle;
mf->DefaultEvenTextFormatHandle=mf->CurrentEvenTextFormatHandle;
//Get menu Items
*o_mnu = mnu;
return SUCCESS;
}