Print Page | Close Window

how to skin CXTCaption ?

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=7661
Printed Date: 13 November 2025 at 9:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to skin CXTCaption ?
Posted By: evoX
Subject: how to skin CXTCaption ?
Date Posted: 25 July 2007 at 11:09am
how can I change the skin to CXTCaption ?
there is no sample in the library to demonstrate this.
 
thanks !



Replies:
Posted By: evoX
Date Posted: 25 July 2007 at 12:05pm
I am talking about this caption, from an outlookbar type frame.
 


Posted By: Oleg
Date Posted: 26 July 2007 at 7:10am
Hello,
You can derive from CXTCaption and override its DrawCaptionBack method.
 
How do you want to skin it ?


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


Posted By: evoX
Date Posted: 26 July 2007 at 7:47am
I want the background to be drawn with a gradient instead of fixed color.


Posted By: evoX
Date Posted: 28 July 2007 at 8:54am
also how can I change the caption icon to make it bigger ?
I use this line to extract an icon from an imagelist with large icons

m_wndCaption.UpdateCaption(m_xRes.LoadString(IDS_SYS_TITLE_OS), m_ImageLarge.ExtractIcon(1));

but the icons are drawn to small on the caption bar



Posted By: Oleg
Date Posted: 30 July 2007 at 8:02am
Hi,
 
You can call  m_wndCaption.SetTheme(xtThemeOffice2003); to use gradient colors.


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


Posted By: jimmy
Date Posted: 30 July 2007 at 8:12am
Set in our derive constructor
    m_sizeIcon.cx = 32;
    m_sizeIcon.cy = 32;

    Jimmy

PS: Look into the source XTCaption.cpp




Posted By: evoX
Date Posted: 30 July 2007 at 8:54am

m_wndCaption.SetTheme(xtThemeOffice2003);  has no effect at all on the background color.

thanks jimmy for the icon size tip.


Posted By: evoX
Date Posted: 30 July 2007 at 8:57am
This is how it looks now, and any theme I apply to it remains the same, just the font size, font color and background color is changing.
 
 
here is the initialization code
 

BOOL CMainFrame::InitializeCaptionBar()

{

if (!m_wndCaption.Create(&m_wndSplitter2, _T("System Overview"), NULL,

WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, CRect(0,0,0,0), m_wndSplitter2.IdFromRowCol(0, 0)))

{

TRACE0("Failed to caption window.\n");

return FALSE;

}

HICON hIcon = AfxGetApp()->LoadIcon(IDI_SYSTEM_OVERVIEW);

m_wndCaption.SetTheme(xtThemeOffice2003);

// set the caption colors.

m_wndCaption.SetCaptionColors (GetXtremeColor(COLOR_3DFACE),

GetXtremeColor(COLOR_3DSHADOW), GetXtremeColor(COLOR_WINDOW) );

LOGFONT lf;

XTAuxData().fontBold.GetLogFont(&lf);

lf.lfHeight = 25;

m_fontCaption.CreateFontIndirect(&lf);

// set the font and initial icon.

m_wndCaption.ModifyCaptionStyle(0,

&m_fontCaption, NULL, hIcon);

// Sizing for splitter

m_wndSplitter2.SetRowInfo (0, 28, 0);

return TRUE;

}




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