本文整理汇总了C++中CBCGPBaseRibbonElement类的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPBaseRibbonElement类的具体用法?C++ CBCGPBaseRibbonElement怎么用?C++ CBCGPBaseRibbonElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBCGPBaseRibbonElement类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseButtonDown
//********************************************************************************
CBCGPBaseRibbonElement* CBCGPRibbonBackstageViewPanel::MouseButtonDown (CPoint point)
{
CBCGPBaseRibbonElement* pHit = CBCGPRibbonMainPanel::MouseButtonDown (point);
if (pHit == NULL || pHit->IsDisabled())
{
return NULL;
}
if (!m_rectPageTransition.IsRectEmpty())
{
StopPageTransition();
OnPageTransitionFinished();
if (pHit->GetRect().PtInRect(point))
{
SelectView(pHit);
return pHit;
}
return NULL;
}
m_bSelectedByMouseClick = TRUE;
SelectView(pHit);
return pHit;
}
示例2: accDoDefaultAction
//*******************************************************************************
HRESULT CBCGPRibbonTabsGroup::accDoDefaultAction(VARIANT varChild)
{
if (varChild.vt != VT_I4)
{
return E_INVALIDARG;
}
if (varChild.lVal != CHILDID_SELF)
{
int nIndex = (int)varChild.lVal - 1;
if (nIndex < 0 || nIndex >= m_arButtons.GetSize())
{
return E_INVALIDARG;
}
CBCGPBaseRibbonElement* pElem = m_arButtons[nIndex];
if (pElem != NULL)
{
ASSERT_VALID (pElem);
pElem->OnAccDefaultAction();
return S_OK;
}
}
return S_FALSE;
}
示例3: ASSERT_VALID
//********************************************************************************
CSize CBCGPRibbonButtonsGroup::GetRegularSize (CDC* pDC)
{
ASSERT_VALID (this);
const BOOL bIsOnStatusBar = IsStatusBarMode();
CSize size (0, 0);
for (int i = 0; i < m_arButtons.GetSize (); i++)
{
CBCGPBaseRibbonElement* pButton = m_arButtons [i];
ASSERT_VALID (pButton);
pButton->SetInitialMode (TRUE);
pButton->OnCalcTextSize (pDC);
CSize sizeButton = pButton->GetSize (pDC);
size.cx += sizeButton.cx;
size.cy = max (size.cy, sizeButton.cy);
}
if (bIsOnStatusBar)
{
size.cx += 2;
}
if (!IsQAT() && !bIsOnStatusBar && m_pParentMenu == NULL)
{
size.cx += CBCGPVisualManager::GetInstance ()->GetRibbonButtonsGroupHorzMargin() * 2;
}
return size;
}
示例4: OnAdd
//**********************************************************************
void CBCGPRibbonCustomizeQATPage::OnAdd()
{
CBCGPBaseRibbonElement* pCmd = m_wndCommandsList.GetSelected ();
if (pCmd == NULL)
{
return;
}
ASSERT_VALID (pCmd);
if (pCmd->IsSeparator () && m_wndQATList.GetCount () == 0)
{
// Don't add separator to the empty QAT
MessageBeep ((UINT)-1);
return;
}
if (!m_wndQATList.AddCommand (pCmd, TRUE, FALSE))
{
return;
}
int nSel = m_wndCommandsList.GetCurSel ();
if (nSel < m_wndCommandsList.GetCount () - 1)
{
m_wndCommandsList.SetCurSel (nSel + 1);
}
OnSelchangeQATCommands();
OnSelchangeCommandsList();
}
示例5: CreateCategoryBackstage
void CBCGPRibbonConstructor::ConstructCategoryBackstage (CBCGPRibbonBar& bar, const CBCGPRibbonInfo::XCategoryBackstage& info) const
{
CBCGPRibbonBackstageViewPanel* pPanel = CreateCategoryBackstage (bar, info);
ASSERT_VALID (pPanel);
CBCGPRibbonCategory* pCategory = bar.GetBackstageCategory ();
ASSERT_VALID (pCategory);
const_cast<CBCGPToolBarImages&>(info.m_SmallImages.m_Image).CopyTo (pCategory->GetSmallImages ());
int i = 0;
for (i = 0; i < info.m_arElements.GetSize (); i++)
{
if (info.m_arElements[i]->GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Command) == 0)
{
CBCGPBaseRibbonElement* pElement =
CreateElement (*(const CBCGPRibbonInfo::XElement*)info.m_arElements[i]);
if (pElement != NULL)
{
ASSERT_VALID (pElement);
pElement->SetBackstageViewMode ();
pPanel->CBCGPRibbonMainPanel::Add (pElement);
}
}
}
}
示例6: OnDraw
virtual void OnDraw (CDC* pDC)
{
ASSERT_VALID (pDC);
CBCGPBaseRibbonElement* pElement = (CBCGPBaseRibbonElement*) m_dwData;
ASSERT_VALID (pElement);
CBCGPToolbarMenuButton dummy;
dummy.m_strText = m_strText;
CString strValue = pElement->GetText ();
if (strValue.GetLength () > nMaxValueLen)
{
strValue = strValue.Left (nMaxValueLen - 1);
}
if (!strValue.IsEmpty ())
{
dummy.m_strText += _T('\t');
dummy.m_strText += strValue;
}
dummy.m_bMenuMode = TRUE;
dummy.m_pWndParent = GetParentWnd ();
if (pElement->IsVisible ())
{
dummy.m_nStyle |= TBBS_CHECKED;
}
dummy.OnDraw (pDC, m_rect, NULL, TRUE, FALSE, m_bIsHighlighted);
}
示例7: ConstructBaseElement
void CBCGPRibbonConstructor::ConstructElement (CBCGPBaseRibbonElement& element, const CBCGPRibbonInfo::XElement& info) const
{
if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Main) == 0 &&
element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonMainButton)))
{
ConstructBaseElement (element, info);
const CBCGPRibbonInfo::XElementButtonMain& infoElement =
(const CBCGPRibbonInfo::XElementButtonMain&)info;
CBCGPRibbonMainButton* pElement = (CBCGPRibbonMainButton*)&element;
ASSERT_VALID (pElement);
const_cast<CBCGPToolBarImages&>(infoElement.m_Image.m_Image).CopyTo (pElement->m_Image);
const_cast<CBCGPToolBarImages&>(infoElement.m_ImageScenic.m_Image).CopyTo (pElement->m_ImageScenic);
}
else if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szButton_Launch) == 0 &&
element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonLaunchButton)))
{
ConstructBaseElement (element, info);
}
else if (info.GetElementName ().Compare (CBCGPRibbonInfo::s_szGroup) == 0 &&
element.IsKindOf (RUNTIME_CLASS (CBCGPRibbonButtonsGroup)))
{
const CBCGPRibbonInfo::XElementGroup& infoElement =
(const CBCGPRibbonInfo::XElementGroup&)info;
CBCGPRibbonButtonsGroup* pElement = (CBCGPRibbonButtonsGroup*)&element;
ASSERT_VALID (pElement);
const_cast<CBCGPToolBarImages&>(infoElement.m_Images.m_Image).CopyTo (pElement->m_Images);
for (int i = 0; i < infoElement.m_arButtons.GetSize (); i++)
{
CBCGPBaseRibbonElement* pButton = CreateElement
(*(const CBCGPRibbonInfo::XElement*)infoElement.m_arButtons[i]);
if (pButton != NULL)
{
ASSERT_VALID (pButton);
pElement->AddButton (pButton);
}
}
}
else
{
ASSERT (FALSE);
}
}
示例8: CopyFrom
//******************************************************************************
void CBCGPRibbonQuickStep::CopyFrom(const CBCGPBaseRibbonElement& src)
{
ASSERT_VALID(this);
CBCGPRibbonPaletteIcon::CopyFrom(src);
m_bIsDisabled = src.IsDisabled();
}
示例9: ASSERT_VALID
//******************************************************************************
int CBCGPRibbonCommandsListBox::GetCommandIndex (UINT uiID) const
{
ASSERT_VALID (this);
for (int i = 0; i < GetCount (); i++)
{
CBCGPBaseRibbonElement* pCommand = (CBCGPBaseRibbonElement*) GetItemData (i);
ASSERT_VALID (pCommand);
if (pCommand->GetID () == uiID)
{
return i;
}
}
return -1;
}
示例10: OnSelchangeCommandsList
//**********************************************************************
void CBCGPRibbonCustomizeQATPage::OnSelchangeCommandsList()
{
BOOL bEnableAddButton = TRUE;
CBCGPBaseRibbonElement* pCmd = m_wndCommandsList.GetSelected ();
if (pCmd == NULL)
{
bEnableAddButton = FALSE;
}
else
{
ASSERT_VALID (pCmd);
bEnableAddButton =
pCmd->GetID () == 0 || m_wndQATList.GetCommandIndex (pCmd->GetID ()) < 0;
}
m_wndAdd.EnableWindow (bEnableAddButton);
}