Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - Title SetFont ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Title SetFont ?

 Post Reply Post Reply
Author
Message
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Topic: Title SetFont ?
    Posted: 16 October 2014 at 6:06pm
Never mind.. Solved.

This might help someone else though

Problem was blank title when setting the font via a CXTPPropertyGridItemFont:

LOGFONT lf;
ZeroMemory(&lf, sizeof(LOGFONT));
((CXTPPropertyGridItemFont*)pItem)->GetFont(&lf);
COLORREF color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();

CXTPChartContent* pContent = GetEditor()->m_wndChartControl.GetContent();
CXTPChartTitle* pTitle = pContent->GetTitles()->GetAt(0);

pTitle->GetFont()->SetLogFont(&lf);

// replaced this
pTitle->SetTextColor(color);
CXTPChartColor titlecolor;
titlecolor.SetFromCOLORREF(color);
pTitle->SetTextColor(titlecolor);

// Added this to update the title
pTitle->OnChartChanged();

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.