The gradient caption extension provides a simple emulation of the smooth gradient caption effects introduced in Microsoft Office for Windows 95. The extension also allows you to control the alignment of caption text.
In order to match the Windows XP look and feel in a themed application, gradient caption extension will be automatically disabled if running under Windows XP and hosting application is themed.
The gradient caption feature is incorporated into the existing SECFrameWnd and SECMDIFrameWnd.
The SECFrameWnd class derives from CFrameWnd and adds support for the gradient caption. The class also adds support for extended docking windows.
The SECMDIFrameWnd class derives from CMDIFrameWnd and adds support for the gradient caption and extended docking window features.
To incorporate the gradient caption into your application:
Change the base class of your main frame window class, which is usually CMainFrame. If you're working with an MDI application, replace the base class (CMDIFrameWnd) with SECMDIFrameWnd. If you're working with an SDI application, replace the base class (CFrameWnd) with SECFrameWnd.
Enable the gradient caption by calling EnableCustomCaption() from your frame window's OnCreate() member.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... // Enable the gradient caption feature. EnableCustomCaption(TRUE); return 0; } |
To change the font of the caption text:
Derive a class from either SECMDIFrameWnd or SECFrameWnd. See the preceding procedure for more information.
Override the CreateCaptionAppFont() method or the CreateCaptionDocFont() method or both. For example, the code below shows how to italicize the document font.
void CMyFrameWnd::CreateCaptionDocFont(CFont& font) { NONCLIENTMETRICS ncm; ncm.cbSize = sizeof(ncm); VERIFY(SystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0)); ncm.lfCaptionFont.lfItalic = TRUE; font.CreateFontIndirect(&ncm.lfCaptionFont); } |
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.