本文整理汇总了C++中CBCGPBaseRibbonElement::SetKeys方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPBaseRibbonElement::SetKeys方法的具体用法?C++ CBCGPBaseRibbonElement::SetKeys怎么用?C++ CBCGPBaseRibbonElement::SetKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPBaseRibbonElement
的用法示例。
在下文中一共展示了CBCGPBaseRibbonElement::SetKeys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructBaseElement
void CBCGPRibbonConstructor::ConstructBaseElement (CBCGPBaseRibbonElement& element,
const CBCGPRibbonInfo::XElement& info,
BOOL bSubItems) const
{
element.SetText (info.m_strText);
element.SetToolTipText (info.m_strToolTip);
element.SetDescription (info.m_strDescription);
element.SetKeys (info.m_strKeys, info.m_strMenuKeys);
SetID (element, info.m_ID);
CBCGPRibbonButton* pButton = DYNAMIC_DOWNCAST (CBCGPRibbonButton, &element);
if (pButton != NULL)
{
const CBCGPRibbonInfo::XElementButton& infoElement =
(const CBCGPRibbonInfo::XElementButton&)info;
if (pButton->GetIcon (FALSE) == NULL && pButton->GetIcon (TRUE) == NULL)
{
pButton->SetImageIndex (infoElement.m_nSmallImageIndex, FALSE);
pButton->SetImageIndex (infoElement.m_nLargeImageIndex, TRUE);
}
pButton->SetAlwaysLargeImage (info.m_bIsAlwaysLarge);
pButton->SetDefaultCommand (infoElement.m_bIsDefaultCommand);
pButton->SetQATType (infoElement.m_QATType);
if (bSubItems)
{
CBCGPRibbonPaletteButton* pButtonPalette =
DYNAMIC_DOWNCAST (CBCGPRibbonPaletteButton, pButton);
for (int i = 0; i < infoElement.m_arSubItems.GetSize (); i++)
{
CBCGPBaseRibbonElement* pSubItem =
CreateElement (*(const CBCGPRibbonInfo::XElement*)infoElement.m_arSubItems[i]);
if (pSubItem == NULL)
{
continue;
}
if (pButtonPalette != NULL)
{
pButtonPalette->AddSubItem (pSubItem, -1, infoElement.m_bIsOnPaletteTop);
}
else
{
pButton->AddSubItem (pSubItem);
if (pSubItem->GetID() >= AFX_IDM_WINDOW_FIRST && pSubItem->GetID() <= AFX_IDM_WINDOW_LAST)
{
pButton->m_bIsWindowsMenu = TRUE;
}
}
}
}
}
}