Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - how to skin CXTCaption ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to skin CXTCaption ?

 Post Reply Post Reply
Author
Message
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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 !
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2007 at 12:05pm
I am talking about this caption, from an outlookbar type frame.
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 7:47am
I want the background to be drawn with a gradient instead of fixed color.
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 30 July 2007 at 8:02am
Hi,
 
You can call  m_wndCaption.SetTheme(xtThemeOffice2003); to use gradient colors.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 516
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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


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

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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;

}

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