当前位置: 首页>>代码示例>>C++>>正文


C++ CBCGPRibbonBar::FindByID方法代码示例

本文整理汇总了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);
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:34,代码来源:BCGPMSOffice2007DemoView.cpp

示例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);
	}
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:33,代码来源:EditFrameView.cpp

示例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 ();
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:44,代码来源:BCGPMSOffice2007DemoView.cpp

示例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();
	}
}
开发者ID:20400992,项目名称:CoolFormat,代码行数:14,代码来源:SynBCGPEditView.cpp

示例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 ();
	}
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:20,代码来源:EditFrameView.cpp

示例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);
		}	
	}
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:22,代码来源:EditFrameView.cpp

示例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;
		 }
	 }
}
开发者ID:20400992,项目名称:CoolFormat,代码行数:24,代码来源:SynBCGPEditView.cpp


注:本文中的CBCGPRibbonBar::FindByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。