ReportControl skin |
Post Reply |
Author | |
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
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")); |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Add
GetReportCtrl().GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
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.
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 styleCXTPPaintManagerColorGradient m_grcGradientColumnHot; // HotTracking Color of column used with xtpReportColumnOffice2003 styleCXTPPaintManagerColorGradient m_grcGradientColumnPushed; // Pushed Color of column used with xtpReportColumnOffice2003 styleCXTPPaintManagerColor m_clrGradientColumnShadow; // Bottom shadow of column used with xtpReportColumnOffice2003 styleCXTPPaintManagerColor m_clrGradientColumnSeparator; // Separator of column used with xtpReportColumnOffice2003 styleCXTPPaintManagerColor 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. |
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
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!
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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));
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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); |
|
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 |