void CBCGPMSOffice2007DemoView::OnFontColor() { CBCGPRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame ())->GetRibbonBar (); ASSERT_VALID (pRibbon); CBCGPRibbonColorButton* pFontColorBtn = DYNAMIC_DOWNCAST ( CBCGPRibbonColorButton, pRibbon->FindByID (ID_FONT_COLOR)); if (pFontColorBtn != NULL) { COLORREF color = pFontColorBtn->GetColor (); CRichEditView::OnColorPick (color == -1 ? ::GetSysColor (COLOR_WINDOWTEXT) : color); } }
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); } } }