Print Page | Close Window

Topic: How to change the CXTPReportControl theme?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9024
Printed Date: 14 November 2025 at 8:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Topic: How to change the CXTPReportControl theme?
Posted By: pkhach
Subject: Topic: How to change the CXTPReportControl theme?
Date Posted: 06 December 2007 at 12:45pm
Hello,

I post this question to forum_topics.asp?FID=38 - 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



Replies:
Posted By: Oleg
Date 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


Posted By: pkhach
Date 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


Posted By: pkhach
Date Posted: 07 December 2007 at 12:58pm
No chance? 

KP


Posted By: Oleg
Date 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


Posted By: pkhach
Date 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


Posted By: znakeeye
Date Posted: 20 January 2008 at 2:27pm
Same problem here. Isn't there a black theme for the report control? And aqua etc?


Posted By: pascal
Date 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);
  }// If
 
 
pReport->RedrawControl();
}

I use the same colors as for the property grid.
cheers
Pascal


-------------
Pascal Verdier
Software Engineer Manager



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net