本文整理汇总了C++中CBCGPRibbonBar::GetElementsByID方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRibbonBar::GetElementsByID方法的具体用法?C++ CBCGPRibbonBar::GetElementsByID怎么用?C++ CBCGPRibbonBar::GetElementsByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRibbonBar
的用法示例。
在下文中一共展示了CBCGPRibbonBar::GetElementsByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectItem
//**************************************************************************
BOOL CBCGPRibbonComboBox::SelectItem (int iIndex)
{
ASSERT_VALID (this);
if (iIndex >= m_lstItems.GetCount ())
{
return FALSE;
}
m_iSelIndex = max (-1, iIndex);
LPCTSTR lpszText = GetItem (m_iSelIndex);
m_strEdit = lpszText == NULL ? _T("") : lpszText;
if (m_pWndEdit->GetSafeHwnd () != NULL)
{
m_pWndEdit->SetWindowText (m_strEdit);
}
if (!m_bDontNotify)
{
CBCGPRibbonBar* pRibbonBar = GetTopLevelRibbonBar ();
if (pRibbonBar != NULL)
{
ASSERT_VALID (pRibbonBar);
CArray<CBCGPBaseRibbonElement*, CBCGPBaseRibbonElement*> arButtons;
pRibbonBar->GetElementsByID (m_nID, arButtons, TRUE);
for (int i = 0; i < arButtons.GetSize (); i++)
{
CBCGPRibbonComboBox* pOther =
DYNAMIC_DOWNCAST (CBCGPRibbonComboBox, arButtons [i]);
if (pOther != NULL && pOther != this)
{
ASSERT_VALID (pOther);
pOther->m_bDontNotify = TRUE;
pOther->SelectItem (iIndex);
pOther->m_bDontNotify = FALSE;
pOther->m_RecentChangeEvt = m_RecentChangeEvt;
}
}
}
}
Redraw ();
return TRUE;
}
示例2: SetPos
//*****************************************************************************
void CBCGPRibbonSlider::SetPos (int nPos, BOOL bRedraw)
{
ASSERT_VALID (this);
m_nPos = min (max (m_nMin, nPos), m_nMax);
SetThumbRect ();
if (!m_bDontNotify)
{
CBCGPRibbonBar* pRibbonBar = GetTopLevelRibbonBar ();
if (pRibbonBar != NULL)
{
ASSERT_VALID (pRibbonBar);
CArray<CBCGPBaseRibbonElement*, CBCGPBaseRibbonElement*> arButtons;
pRibbonBar->GetElementsByID (m_nID, arButtons);
for (int i = 0; i < arButtons.GetSize (); i++)
{
CBCGPRibbonSlider* pOther =
DYNAMIC_DOWNCAST (CBCGPRibbonSlider, arButtons [i]);
if (pOther != NULL && pOther != this)
{
ASSERT_VALID (pOther);
pOther->m_bDontNotify = TRUE;
pOther->SetPos (nPos);
pOther->m_bDontNotify = FALSE;
}
}
}
}
if (bRedraw)
{
Redraw ();
}
}