本文整理汇总了C++中CFontDialog::GetColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CFontDialog::GetColor方法的具体用法?C++ CFontDialog::GetColor怎么用?C++ CFontDialog::GetColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFontDialog
的用法示例。
在下文中一共展示了CFontDialog::GetColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClicked
BOOL COXFontPickerButton::OnClicked()
{
ASSERT(::IsWindow(m_hWnd));
// Use font common dialog
CFontDialog* pFontDlg;
CFont* pFont=GetBuddyFont();
LOGFONT lf;
if(pFont==NULL)
{
pFontDlg=new CFontDialog();
}
else
{
pFont->GetLogFont(&lf);
pFontDlg=new CFontDialog(&lf);
}
pFontDlg->m_cf.rgbColors=GetBuddyTextColor();
if(pFontDlg->DoModal()==IDOK && m_pBuddy!=NULL)
{
pFontDlg->GetCurrentFont(&lf);
SetBuddyLogFont(&lf,FALSE);
COLORREF clr=pFontDlg->GetColor();
SetBuddyTextColor(clr,TRUE);
}
delete pFontDlg;
return FALSE;
}
示例2: SetItemFont
void CListOptionCtrl::SetItemFont()
{
if(!UpdateData(TRUE))
return;
int nIndex = m_listBoxEx.GetCurSel();
COLORREF colorItemText;
CFont fontItem;
CFont* pFont= m_arrFonts[nIndex];
ASSERT(pFont!=NULL);
LOGFONT lf;
CFontDialog dlgFont;
dlgFont.m_cf.lpLogFont = &lf;
if(dlgFont.DoModal() == IDOK)
{
//VERIFY(fontItem.GetLogFont(&lf));
colorItemText = dlgFont.GetColor();
if(pFont->m_hObject!=NULL)
VERIFY(pFont->DeleteObject());
VERIFY(pFont->CreateFontIndirect(&lf));
VERIFY(m_listBoxEx.SetItemFont(nIndex, pFont));
VERIFY(m_listBoxEx.SetItemTextColor(nIndex, colorItemText));
}
}
示例3: OnBnClickedFontsetbtn
void CTextPadDlg::OnBnClickedFontsetbtn()
{
// TODO: Add your control notification handler code here
CFontDialog dlg;
//CFontDialog로 현재 폰트 변경
if(dlg.DoModal() == IDOK){
color = dlg.GetColor();
dlg.GetCurrentFont(&log);
font.DeleteObject();
font.CreateFontIndirect(&log);
GetDlgItem(IDC_EDIT1)->SetFont(&font);
}
}
示例4: OnFont
void CLabelDlg::OnFont()
{
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
LOGFONT logFont;
dlg.GetCurrentFont (&logFont);
m_pLabel->SetFont (&logFont);
m_pLabel->SetTextColor(dlg.GetColor ());
OnChanged();
}
}
示例5: OnClickButton
//*****************************************************************************************
void CFontItem::OnClickButton (CPoint /*point*/)
{
CBCGPGridCtrl* pGridCtrl = GetOwnerList();
ASSERT_VALID (pGridCtrl);
ASSERT_VALID (this);
ASSERT_VALID (m_pWndInPlace);
ASSERT (::IsWindow (m_pWndInPlace->GetSafeHwnd ()));
m_bButtonIsDown = TRUE;
Redraw ();
CFontDialog dlg (&m_lf);
if (m_Color != (COLORREF)-1)
{
dlg.m_cf.rgbColors = m_Color;
}
if (dlg.DoModal () == IDOK)
{
dlg.GetCurrentFont (&m_lf);
m_Color = dlg.GetColor ();
if (m_pWndInPlace != NULL)
{
m_pWndInPlace->SetWindowText (FormatProperty ());
}
else
{
m_varValue = (LPCTSTR) FormatProperty ();
}
}
if (m_pWndInPlace != NULL)
{
m_pWndInPlace->SetFocus ();
}
else
{
pGridCtrl->SetFocus ();
}
m_bButtonIsDown = FALSE;
Redraw ();
}