![]() |
how to skin CXTCaption ? |
Post Reply
|
| Author | |
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Topic: how to skin CXTCaption ?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 !
|
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 July 2007 at 12:05pm |
|
I am talking about this caption, from an outlookbar type frame.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2007 at 7:47am |
|
I want the background to be drawn with a gradient instead of fixed color.
|
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
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 splitterm_wndSplitter2.SetRowInfo (0, 28, 0); return TRUE;} |
|
![]() |
|
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 |