Пример #1
0
MenuItem* Menu::AddItem( const TextObject & strName, const TextObject & strIconName, const TextObject & strAccelerator )
{
	MenuItem* pItem = new MenuItem( this );
	pItem->SetPadding( Padding( 2, 4, 4, 4 ) );
	pItem->SetText( strName );
	pItem->SetImage( strIconName );
	pItem->SetAccelerator( strAccelerator );
	OnAddItem( pItem );
	return pItem;
}
Пример #2
0
MenuItem* Menu::AddItem(const std::string& name, const std::string& icon_name, const std::string& accelerator)
{
    MenuItem* item = new MenuItem(this);
    item->SetPadding(Padding(2, 4, 4, 4));
    item->SetText(name);
    item->SetImage(icon_name);
    item->SetAccelerator(accelerator);

    _OnAddItem(item);

    return item;
}
Пример #3
0
MenuItem* Menu::AddItem( const Gwen::UnicodeString& strName, const UnicodeString& strIconName, Gwen::Event::Handler* pHandler, Gwen::Event::Handler::Function fn )
{
	MenuItem* pItem = new MenuItem( this );
		pItem->SetText( strName );
		pItem->SetImage( strIconName );

		if ( fn && pHandler )
		{
			pItem->onMenuItemSelected.Add( pHandler, fn );
		}
		
		OnAddItem( pItem );

	return pItem;
}