本文整理汇总了C++中ContextMenuItem::releasePlatformDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ ContextMenuItem::releasePlatformDescription方法的具体用法?C++ ContextMenuItem::releasePlatformDescription怎么用?C++ ContextMenuItem::releasePlatformDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContextMenuItem
的用法示例。
在下文中一共展示了ContextMenuItem::releasePlatformDescription方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertItem
void ContextMenu::insertItem(unsigned position, ContextMenuItem& item)
{
checkOrEnableIfNeeded( item );
if( item.releasePlatformDescription() != NULL )
m_platformDescription->AddItem( item.releasePlatformDescription(), position );
}
示例2: appendItem
void ContextMenu::appendItem(ContextMenuItem& item)
{
if (!m_platformDescription)
return;
PlatformMenuItemDescription itemDescription = item.releasePlatformDescription();
wxItemKind menuKindWx = ( itemDescription.type == CheckableActionType ) ? wxITEM_CHECK : wxITEM_NORMAL;
wxString titleWx(itemDescription.title);
int idWx = wxID_ANY;
wxMenuItem * itemWx;
ItemActionMap::const_iterator end = s_itemActions.end();
for (ItemActionMap::const_iterator it = s_itemActions.begin(); it != end; ++it) {
if (it->second == itemDescription.action)
idWx = it->first;
}
if (itemDescription.subMenu) {
itemWx = new wxMenuItem(m_platformDescription, idWx, titleWx, wxEmptyString, wxITEM_NORMAL, itemDescription.subMenu);
} else if (itemDescription.type != SeparatorType) {
itemWx = new wxMenuItem(m_platformDescription, idWx, titleWx, wxT(""), menuKindWx);
} else {
itemWx = new wxMenuItem(m_platformDescription);
}
s_itemActions.add(itemWx->GetId(), item.action());
m_platformDescription->Append(itemWx);
m_platformDescription->Enable(itemWx->GetId(), itemDescription.enabled);
if (menuKindWx == wxITEM_CHECK)
m_platformDescription->Check(itemWx->GetId(), itemDescription.checked);
}
示例3: appendItem
void ContextMenu::appendItem(ContextMenuItem& item)
{
checkOrEnableIfNeeded(item);
BMenuItem* menuItem = item.releasePlatformDescription();
if (menuItem)
m_platformDescription->AddItem(menuItem);
}
示例4: insertItem
void ContextMenu::insertItem(unsigned int position, ContextMenuItem& item)
{
if (!m_platformDescription)
return;
checkOrEnableIfNeeded(item);
::InsertMenuItem(m_platformDescription, position, TRUE, item.releasePlatformDescription());
}
示例5: appendItem
void ContextMenu::appendItem(ContextMenuItem& item)
{
ASSERT(m_platformDescription);
GtkMenuItem* platformItem = item.releasePlatformDescription();
ASSERT(platformItem);
gtk_menu_shell_append(GTK_MENU_SHELL(m_platformDescription), GTK_WIDGET(platformItem));
gtk_widget_show(GTK_WIDGET(platformItem));
}
示例6: appendItem
void ContextMenu::appendItem(ContextMenuItem& item)
{
DEBUG("ContextMenu::appendItem\n" );
checkOrEnableIfNeeded( item );
os::MenuItem* pcItem = item.releasePlatformDescription();
if( pcItem != NULL )
m_platformDescription->AddItem( pcItem );
}