![]() |
Topic: How to change the CXTPReportControl theme? |
Post Reply
|
| Author | |
pkhach
Newbie
Joined: 30 October 2007 Location: Ukraine Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: Topic: How to change the CXTPReportControl theme?Posted: 06 December 2007 at 12:45pm |
|
Hello,
I post this question to Xtreme ReportControl forum, but without luck. Maybe here I will be more lucky... ****** How can I change the CXTPReportControl's theme on the fly? I have studied how to change the theme for the Ribbon and Docking Panes, but how to do it for the CXTPReportControl? The GetPaintManager()->RefreshMetrics() does not help. I need something like this, but for the CXTPReportControl: https://forum.codejock.com/forum_posts.asp?TID=8452 ****** Thanks, KP |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 December 2007 at 12:48pm |
|
Hi,
Report has only theme for Column headers.
Use GetReportCtrl().GetPaintManager()->SetColumnStyle(); method.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
pkhach
Newbie
Joined: 30 October 2007 Location: Ukraine Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 December 2007 at 1:31pm |
|
Yes,
I am using the: GetReportControl()->GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007); for initially setting up the grid columns to Office 2007 style . But I am unable to switch say from Blue to Silver or to Black mode without restarting the program (for command bars I can do this on the fly). Thanks, KP |
|
![]() |
|
pkhach
Newbie
Joined: 30 October 2007 Location: Ukraine Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 December 2007 at 12:58pm |
|
No chance?
![]() KP |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 December 2007 at 2:32am |
|
Hi, How do you switch ? try to call same line again after you reload images.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
pkhach
Newbie
Joined: 30 October 2007 Location: Ukraine Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 December 2007 at 2:55am |
|
Here is the SetUITheme(UINT nMode) function code:
void CMainFrame::SetUITheme(UINT nMode) { HMODULE hModule = AfxGetInstanceHandle(); LPCTSTR lpszIniFile = 0; switch (nMode) { case ID_VIEW_UITHEMES_BLUE: lpszIniFile = _T("OFFICE2007BLUE.INI"); break; case ID_VIEW_UITHEMES_SILVER: lpszIniFile = _T("OFFICE2007SILVER.INI"); break; case ID_VIEW_UITHEMES_BLACK: lpszIniFile = _T("OFFICE2007BLACK.INI"); break; default: ASSERT(FALSE); return; } ((CXTPOffice2007Theme*)GetCommandBars()->GetPaintManager())->SetImageHandle(hModule, lpszIniFile); ((CXTPOffice2007Theme*)XTPPaintManager())->SetImageHandle(hModule, lpszIniFile); XTPOffice2007Images()->SetHandle(hModule, lpszIniFile); //set thems CXTPPaintManager::SetTheme(xtpThemeOffice2007); XTPPaintManager()->SetTheme(xtpThemeOffice2007); m_paneManager.SetTheme(xtpPaneThemeOffice2007); m_wndSummaryPane.SetTheme(xtpGridThemeOffice2007); m_ctrlGrid.GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007); GetCommandBars()->GetToolTipContext()->SetStyle(xtpToolTipOffice2007); XTPPaintManager()->RefreshMetrics(); GetCommandBars()->GetImageManager()->RefreshAll(); GetCommandBars()->RedrawCommandBars(); m_ctrlGrid.GetPaintManager()->RefreshMetrics(); m_ctrlGrid.RedrawControl(); SendMessage(WM_NCPAINT); RedrawWindow(0, 0, RDW_ALLCHILDREN|RDW_INVALIDATE); } everything works OK, except that the report control (m_ctrlGrid.) does not change it's theme (say from blue to black). Thanks, KP |
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
Posted: 20 January 2008 at 2:27pm |
|
Same problem here. Isn't there a black theme for the report control? And aqua etc?
|
|
![]() |
|
pascal
Groupie
Joined: 07 February 2005 Location: Germany Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 April 2008 at 9:13am |
|
I reach a good result with the following applet:
CXTPReportPaintManager* pPaintManager = pReport->GetPaintManager();
if( pPaintManager ) { XTPPaintTheme paintTheme = GetPaintTheme(); if( (paintTheme == xtpThemeRibbon) || (paintTheme == xtpThemeOffice2007) ) { COLORREF crRef =
XTPOffice2007Images()->GetImageColor( _T("PropertyGrid"),
_T("Background"));
pPaintManager->SetColumnOffice2007CustomThemeBaseColor(crRef); I use the same colors as for the property grid.
cheers
Pascal
|
|
|
Pascal Verdier
Software Engineer Manager |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |