本文整理汇总了C++中CBCGPRibbonBar::FindByID方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRibbonBar::FindByID方法的具体用法?C++ CBCGPRibbonBar::FindByID怎么用?C++ CBCGPRibbonBar::FindByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRibbonBar
的用法示例。
在下文中一共展示了CBCGPRibbonBar::FindByID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTopLevelFrame
void CBCGPMSOffice2007DemoView::OnFontname()
{
USES_CONVERSION;
CBCGPRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame ())->GetRibbonBar ();
ASSERT_VALID (pRibbon);
CBCGPRibbonFontComboBox* pFontCombo = DYNAMIC_DOWNCAST (
CBCGPRibbonFontComboBox, pRibbon->FindByID (ID_FONT_FONT));
if (pFontCombo == NULL)
{
return;
}
CCharFormat cf;
cf.szFaceName[0] = NULL;
cf.dwMask = CFM_FACE | CFM_CHARSET;
const CBCGPFontDesc* pDesc = pFontCombo->GetFontDesc ();
ASSERT_VALID (pDesc);
ASSERT(pDesc->m_strName.GetLength() < LF_FACESIZE);
#if _MSC_VER >= 1300
lstrcpyn(cf.szFaceName, pDesc->m_strName, LF_FACESIZE);
#else
lstrcpynA(cf.szFaceName,
T2A((LPTSTR) (LPCTSTR) pDesc->m_strName), LF_FACESIZE);
#endif
cf.bCharSet = pDesc->m_nCharSet;
cf.bPitchAndFamily = pDesc->m_nPitchAndFamily;
SetCharFormat (cf);
}
示例2: OnFontSize
void CEditFrameView::OnFontSize ()
{
CBCGPRibbonBar* pRibbon = ((CEditFrameDialog*) GetTopLevelFrame ())->GetRibbonBar ();
ASSERT_VALID (pRibbon);
CBCGPRibbonComboBox* pSizeCombo = DYNAMIC_DOWNCAST (
CBCGPRibbonComboBox, pRibbon->FindByID (ID_FONT_SIZE));
if (pSizeCombo == NULL)
{
return;
}
int nSize = GetTwipSize (pSizeCombo->GetItem (-1));
if (nSize == -2)
{
return;
}
if ((nSize >= 0 && nSize < 20) || nSize > 32760)
{
return;
}
if (nSize > 0)
{
CCharFormat cf;
cf.dwMask = CFM_SIZE;
cf.yHeight = nSize;
SetCharFormat (cf);
}
}
示例3: GetCharFormatSelection
void CBCGPMSOffice2007DemoView::SyncFont ()
{
USES_CONVERSION;
CString strFontName;
// get the current font from the view and update
WPD_CHARFORMAT cf = GetCharFormatSelection ();
CBCGPRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame ())->GetRibbonBar ();
ASSERT_VALID (pRibbon);
// sync font name:
CBCGPRibbonFontComboBox* pFontCombo = DYNAMIC_DOWNCAST (
CBCGPRibbonFontComboBox, pRibbon->FindByID (ID_FONT_FONT));
if (pFontCombo != NULL && !pFontCombo->HasFocus ())
{
if ((cf.dwMask & (CFM_FACE|CFM_CHARSET)) == (CFM_FACE|CFM_CHARSET))
{
#if _MSC_VER >= 1300
strFontName = cf.szFaceName;
#else
strFontName = A2T(cf.szFaceName);
#endif
pFontCombo->SetFont (strFontName, DEFAULT_CHARSET, TRUE);
}
else
{
pFontCombo->SetText(_T(""));
}
}
// sync font size:
CBCGPRibbonComboBox* pFontSizeCombo = DYNAMIC_DOWNCAST (
CBCGPRibbonComboBox, pRibbon->FindByID (ID_FONT_FONTSIZE));
if (pFontSizeCombo != NULL && !pFontSizeCombo->HasFocus ())
{
pFontSizeCombo->SetEditText (TwipsToPointString (cf.yHeight));
}
SetFocus ();
}
示例4: ReSetLangLabel
void CSynBCGPEditView::ReSetLangLabel()
{
CBCGPRibbonBar *pRibbonBar = ((CMainFrame*)GetTopLevelFrame())->GetRibbonBar();
ASSERT_VALID(pRibbonBar);
CMyBCGPRibbonLabel *pRibbonLabel = DYNAMIC_DOWNCAST(CMyBCGPRibbonLabel, pRibbonBar->FindByID(ID_NOW_LANG));
if (pRibbonLabel)
{
CString strLabelText;
strLabelText.Format(_T("%16s"), m_pEdit->GetSelectLangString());
pRibbonLabel->SetTextEx(strLabelText);
pRibbonLabel->Redraw();
}
}
示例5: OnFontSizeDecrease
void CEditFrameView::OnFontSizeDecrease()
{
CBCGPRibbonBar* pRibbon = ((CEditFrameDialog*) GetTopLevelFrame ())->GetRibbonBar ();
ASSERT_VALID (pRibbon);
CBCGPRibbonComboBox* pSizeCombo = DYNAMIC_DOWNCAST (
CBCGPRibbonComboBox, pRibbon->FindByID (ID_FONT_SIZE));
if (pSizeCombo == NULL)
{
return;
}
int nItem = pSizeCombo->GetCurSel ();
if (nItem > 0)
{
pSizeCombo->SelectItem (nItem - 1);
OnFontSize ();
}
}
示例6: OnFontColor
void CEditFrameView::OnFontColor()
{
CBCGPRibbonBar* pRibbon = ((CEditFrameDialog*) GetTopLevelFrame ())->GetRibbonBar ();
ASSERT_VALID (pRibbon);
CBCGPRibbonColorButton* pColorBtn = DYNAMIC_DOWNCAST (
CBCGPRibbonColorButton, pRibbon->FindByID (ID_FONT_COLOR));
if (pColorBtn != NULL)
{
COLORREF color = pColorBtn->GetColor ();
if (color == -1)
{
CRichEditView::OnColorDefault ();
}
else
{
CRichEditView::OnColorPick (color);
}
}
}
示例7: OnEditUndo
void CSynBCGPEditView::OnEditUndo()
{
CBCGPRibbonBar *pRibbon = ((CMainFrame*) GetTopLevelFrame())->GetRibbonBar();
ASSERT_VALID(pRibbon);
CBCGPRibbonUndoButton *pEditUndo = DYNAMIC_DOWNCAST(CBCGPRibbonUndoButton, pRibbon->FindByID(ID_EDIT_UNDO));
ASSERT_VALID(pEditUndo);
int nActionNumber = pEditUndo->GetActionNumber();
if (-1 == nActionNumber)
{
m_pEdit->OnUndo();
return;
}
for (int i = 0; i < nActionNumber; i++)
{
if (!m_pEdit->OnUndo())
{
break;
}
}
}