Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - ReportControl skin
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportControl skin

 Post Reply Post Reply
Author
Message
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Topic: ReportControl skin
    Posted: 17 February 2009 at 2:47pm
I'm using code below to skin my application, and it's working great except it doesn't affect XTPReportControl's headers? How to paint those header to be like my whole application (report control is using Office2007 theme)?

XTPSkinManager()->LoadSkin(_T("C:\\Office2007.cjstyles"),_T("NormalBlue.ini"));
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 18 February 2009 at 1:14am
Hi,
 
Add
GetReportCtrl().GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2009 at 2:02pm
I've already done that, Office2007 style is shown but colors of the headings are wrong (e.g. my theme is Office2007Black, but color of ReportControl is still blue). How to tell ReportControl that it has to change its color according to application main theme? Thanks for helping.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2009 at 8:49pm
To customize colors you can use functions:
GetReportCtrl().GetPaintManager()->SetColumnOffice2007CustomThemeBaseColor(COLORREF color) or PaintManager public members:

CXTPPaintManagerColor m_clrHighlight; // Background color of the highlighted row.

CXTPPaintManagerColor m_clrGridLine; // Grid lines color.

CXTPPaintManagerColor m_clrWindowText; // Report items default text color.

CXTPPaintManagerColor m_clrHighlightText; // Text color of the highlighted text.

CXTPPaintManagerColor m_clrHeaderControl; // Background color of the report header.

CXTPPaintManagerColor m_clrCaptionText; // Column header text color.

CXTPPaintManagerColor m_clrControlBack; // Background color of the control report area.

CXTPPaintManagerColor m_clrGroupRowText; // Row text color.

CXTPPaintManagerColor m_clrGroupShadeBack; // Group row background color when indentation shade is enabled.

CXTPPaintManagerColor m_clrGroupShadeText; // Group row foreground color when indentation shade is enabled.

CXTPPaintManagerColor m_clrGroupShadeBorder;// Color for group border's shade.

CXTPPaintManagerColor m_clrGroupBoxBack; // Color of group box.

CXTPPaintManagerColor m_clrControlDark; // Dark background color of the report control (used on Group By area).

CXTPPaintManagerColor m_clrControlLightLight;// Light background color used for drawing shades (used on column header area).

CXTPPaintManagerColor m_clrHotDivider; // Color of the column hot divider window (2 arrows).

CXTPPaintManagerColor m_clrHyper; // Hyperlink color.

CXTPPaintManagerColor m_clrIndentControl; // Color of the tree indentation area.

CXTPPaintManagerColor m_clrItemShade; // Color of the shade on sorted by column items.

CXTPPaintManagerColor m_clrBtnFace; // Standard button face color.

CXTPPaintManagerColor m_clrBtnText; // Standard button text color.

CXTPPaintManagerColor m_clrPreviewText; // Preview text color.

CXTPPaintManagerColor m_clrSelectedRow; // Selected row background color.

CXTPPaintManagerColor m_clrSelectedRowText; // Selected row text color.

CXTPPaintManagerColorGradient m_grcGradientColumn; // Color of column used with xtpReportColumnOffice2003 style

CXTPPaintManagerColorGradient m_grcGradientColumnHot; // HotTracking Color of column used with xtpReportColumnOffice2003 style

CXTPPaintManagerColorGradient m_grcGradientColumnPushed; // Pushed Color of column used with xtpReportColumnOffice2003 style

CXTPPaintManagerColor m_clrGradientColumnShadow; // Bottom shadow of column used with xtpReportColumnOffice2003 style

CXTPPaintManagerColor m_clrGradientColumnSeparator; // Separator of column used with xtpReportColumnOffice2003 style

CXTPPaintManagerColor m_crlNoGroupByText; // A color for "No items" text in GroupBy area (see m_strNoGroupBy member)

CXTPPaintManagerColor m_clrFreezeColsDivider; // Freeze Columns Divider color.

CXTPPaintManagerColor m_clrHeaderRowsDivider; // Color of header divider.

CXTPPaintManagerColor m_clrFooterRowsDivider; // Color of footer divider.

COLORREF m_clrColumnOffice2007CustomTheme; // Base color for Office2007 custom theme.

Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2009 at 2:13pm
I guess I have to use CXTPPaintManagerColor m_clrHeaderControl (but that's minor problem). How can I get that m_clrHeaderControl value from current theme (let say my application uses Office2007 Black theme)? Thanks for helping!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2009 at 2:33pm

You still can use function GetReportCtrl().GetPaintManager()->SetColumnOffice2007CustomThemeBaseColor(COLORREF color) which assign your color to m_clrColumnOffice2007CustomTheme. But after this some special logic applied:

if (m_clrColumnOffice2007CustomTheme != COLORREF_NULL)

{

COLORREF clrHsl = XTPDrawHelpers()->RGBtoHSL(m_clrColumnOffice2007CustomTheme);

BYTE Hue = GetRValue(clrHsl);

BYTE Sat = GetGValue(clrHsl);

m_grcGradientColumnPushed.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 212)), XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 239)));

m_grcGradientColumn.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 239)), XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 212)));

m_clrGradientColumnShadow.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, (BYTE)(Sat * 0.525f), 145)));

m_clrGradientColumnSeparator.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 192)));

m_clrGroupBoxBack.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, Sat, 227)));

m_crlNoGroupByText.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, (BYTE)(Sat * 0.75f), 79)));

m_clrGroupShadeBack.SetStandardValue(XTPDrawHelpers()->HSLtoRGB(RGB(Hue, (BYTE)(Sat * 0.88f), 208)));

}

Tested cases

m_wndReport.GetPaintManager()->SetColumnOffice2007CustomThemeBaseColor(RGB(0,0,255));

 
Another case:
m_wndReport.GetPaintManager()->SetColumnOffice2007CustomThemeBaseColor(RGB(255,0,0));
 

 

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2009 at 4:48pm
PaintManager public members I commented early (e.g. CXTPPaintManagerColor m_clrHeaderControl) used in non-Office2007 themes.
E.g. I reached green header if use such initialization:

//m_wndReport.GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);

wndReport.GetPaintManager()->m_clrHeaderControl = RGB(0,255,0);

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.156 seconds.