本文整理汇总了C++中CBCGPBaseRibbonElement::GetIDispatch方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPBaseRibbonElement::GetIDispatch方法的具体用法?C++ CBCGPBaseRibbonElement::GetIDispatch怎么用?C++ CBCGPBaseRibbonElement::GetIDispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPBaseRibbonElement
的用法示例。
在下文中一共展示了CBCGPBaseRibbonElement::GetIDispatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accNavigate
//*******************************************************************************
HRESULT CBCGPRibbonTabsGroup::accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEndUpAt)
{
pvarEndUpAt->vt = VT_EMPTY;
if (varStart.vt != VT_I4)
{
return E_INVALIDARG;
}
if (m_pRibbonBar->GetSafeHwnd() == NULL)
{
return S_FALSE;
}
switch (navDir)
{
case NAVDIR_FIRSTCHILD:
if (varStart.lVal == CHILDID_SELF)
{
pvarEndUpAt->vt = VT_I4;
pvarEndUpAt->lVal = 1;
return S_OK;
}
break;
case NAVDIR_LASTCHILD:
if (varStart.lVal == CHILDID_SELF)
{
pvarEndUpAt->vt = VT_I4;
pvarEndUpAt->lVal = (long)m_arButtons.GetSize();
return S_OK;
}
break;
case NAVDIR_NEXT:
case NAVDIR_RIGHT:
if (varStart.lVal != CHILDID_SELF)
{
pvarEndUpAt->vt = VT_I4;
pvarEndUpAt->lVal = varStart.lVal + 1;
if (pvarEndUpAt->lVal > m_arButtons.GetSize())
{
pvarEndUpAt->vt = VT_EMPTY;
return S_FALSE;
}
return S_OK;
}
else
{
if (m_pRibbonBar->m_TabElements.GetCount() > 0)
{
CBCGPBaseRibbonElement* pTabElement = m_pRibbonBar->m_TabElements.GetButton(0);
if (pTabElement != NULL)
{
ASSERT_VALID(pTabElement);
pvarEndUpAt->vt = VT_DISPATCH;
pvarEndUpAt->pdispVal = pTabElement->GetIDispatch(TRUE);
return S_OK;
}
}
else
{
CBCGPRibbonCategory* pCatrgory = m_pRibbonBar->GetActiveCategory();
if (pCatrgory != NULL)
{
ASSERT_VALID(pCatrgory);
pvarEndUpAt->vt = VT_DISPATCH;
pvarEndUpAt->pdispVal = pCatrgory->GetIDispatch(TRUE);
return S_OK;
}
}
}
break;
case NAVDIR_PREVIOUS:
case NAVDIR_LEFT:
if (varStart.lVal != CHILDID_SELF)
{
pvarEndUpAt->vt = VT_I4;
pvarEndUpAt->lVal = varStart.lVal - 1;
if (pvarEndUpAt->lVal <= 0)
{
pvarEndUpAt->vt = VT_EMPTY;
return S_FALSE;
}
return S_OK;
}
else
{
if (m_pRibbonBar->m_QAToolbar.IsVisible())
{
pvarEndUpAt->vt = VT_DISPATCH;
pvarEndUpAt->pdispVal = m_pRibbonBar->m_QAToolbar.GetIDispatch(TRUE);
//.........这里部分代码省略.........