Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Topic: How to change the CXTPReportControl theme?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic: How to change the CXTPReportControl theme?

 Post Reply Post Reply
Author
Message
pkhach View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Location: Ukraine
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote pkhach Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pkhach View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Location: Ukraine
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote pkhach Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pkhach View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Location: Ukraine
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote pkhach Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2007 at 12:58pm
No chance? 

KP
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pkhach View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Location: Ukraine
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote pkhach Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2008 at 2:27pm
Same problem here. Isn't there a black theme for the report control? And aqua etc?
Back to Top
pascal View Drop Down
Groupie
Groupie


Joined: 07 February 2005
Location: Germany
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote pascal Quote  Post ReplyReply Direct Link To This Post 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
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.062 seconds.