本文整理汇总了C++中CBCGPBaseRibbonElement::GetText方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPBaseRibbonElement::GetText方法的具体用法?C++ CBCGPBaseRibbonElement::GetText怎么用?C++ CBCGPBaseRibbonElement::GetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPBaseRibbonElement
的用法示例。
在下文中一共展示了CBCGPBaseRibbonElement::GetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: OnShowPopupMenu
void CRibbonListButton::OnShowPopupMenu ()
{
ASSERT_VALID (this);
CBCGPBaseRibbonElement::OnShowPopupMenu ();
if (m_sizeMaxText == CSize (0, 0))
{
CBCGPRibbonBar* pRibbonBar = GetTopLevelRibbonBar ();
ASSERT_VALID (pRibbonBar);
CClientDC dc (pRibbonBar);
CFont* pOldFont = dc.SelectObject (pRibbonBar->GetFont ());
ASSERT (pOldFont != NULL);
int i = 0;
for (i = 0; i < m_arLabels.GetSize (); i++)
{
CSize szText = dc.GetTextExtent (m_arLabels [i]);
m_sizeMaxText.cx = max (m_sizeMaxText.cx, szText.cx);
m_sizeMaxText.cy = max (m_sizeMaxText.cy, szText.cy);
}
const int cxImage = m_listImages.GetImageSize ().cx;
for (i = 0; i < m_arSubItems.GetSize (); i++)
{
CBCGPBaseRibbonElement* pButton = m_arSubItems [i];
ASSERT_VALID (pButton);
CString strText = pButton->GetText ();
CSize szText = dc.GetTextExtent (strText);
m_sizeMaxText.cx = max (m_sizeMaxText.cx, szText.cx - cxImage);
}
dc.SelectObject (pOldFont);
}
CBCGPRibbonPaletteButton::OnShowPopupMenu ();
}
示例3: OnSelchangeCategory
//*************************************************************************************
void CBCGPKeyMapDlg::OnSelchangeCategory()
{
UpdateData ();
ASSERT (m_lpAccel != NULL);
int iIndex = m_wndCategoryList.GetCurSel ();
if (iIndex == LB_ERR)
{
return;
}
HINSTANCE hInstRes = AfxGetResourceHandle ();
#ifndef BCGP_EXCLUDE_RIBBON
if (m_pWndRibbonBar != NULL)
{
CBCGPRibbonCategory* pCategory = NULL;
if (m_pWndRibbonBar->GetMainCategory () != NULL)
{
iIndex--;
if (iIndex < 0)
{
pCategory = m_pWndRibbonBar->GetMainCategory ();
}
}
if (pCategory == NULL)
{
pCategory = m_pWndRibbonBar->GetCategory (iIndex);
}
ASSERT_VALID(pCategory);
CArray<CBCGPBaseRibbonElement*, CBCGPBaseRibbonElement*> arElements;
pCategory->GetElements (arElements);
AfxSetResourceHandle (m_hInstDefault);
int nItem = 0;
m_KeymapList.DeleteAllItems();
for (int i = 0; i < (int)arElements.GetSize (); i++)
{
CBCGPBaseRibbonElement* pElem = arElements [i];
ASSERT_VALID (pElem);
if (!pElem->IsKindOf (RUNTIME_CLASS (CBCGPRibbonSeparator)) && pElem->GetID() > 0 && pElem->GetID() != (UINT) -1)
{
CString strLabel = pElem->GetToolTip();
if (strLabel.IsEmpty ())
{
strLabel = pElem->GetText();
}
if (!strLabel.IsEmpty())
{
OnInsertItem(pElem, nItem);
if (m_bItemWasAdded)
{
nItem++;
}
}
}
}
}
else
#endif
{
CObList* pCategoryButtonsList = (CObList*) m_wndCategoryList.GetItemData (iIndex);
ASSERT_VALID (pCategoryButtonsList);
AfxSetResourceHandle (m_hInstDefault);
int nItem = 0;
m_KeymapList.DeleteAllItems();
for (POSITION pos = pCategoryButtonsList->GetHeadPosition (); pos != NULL;)
{
CBCGPToolbarButton* pButton = (CBCGPToolbarButton*) pCategoryButtonsList->GetNext (pos);
ASSERT (pButton != NULL);
if (pButton->m_nID > 0 && pButton->m_nID != (UINT) -1)
{
OnInsertItem (pButton, nItem);
if (m_bItemWasAdded)
{
nItem++;
}
}
}
}
m_KeymapList.SortItems (listCompareFunc, (LPARAM) this);
AfxSetResourceHandle (hInstRes);
//.........这里部分代码省略.........