Print Page | Close Window

ReportControl skin

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=13433
Printed Date: 17 May 2024 at 5:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl skin
Posted By: gmail
Subject: ReportControl skin
Date 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"));



Replies:
Posted By: Oleg
Date Posted: 18 February 2009 at 1:14am
Hi,
 
Add
GetReportCtrl().GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


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


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



-------------
Mark Doubson, Ph.D.


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


Posted By: mdoubson
Date 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));
 

 



-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date 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);



-------------
Mark Doubson, Ph.D.



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