当前位置: 首页>>代码示例>>C++>>正文


C++ MenuItem::GetName方法代码示例

本文整理汇总了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;
    }
}
开发者ID:authenticate,项目名称:GWEN,代码行数:16,代码来源:ComboBox.cpp

示例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;
}
开发者ID:Kreyl,项目名称:nute,代码行数:80,代码来源:ItemsListFormBase.cpp


注:本文中的MenuItem::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。