|
#ifndef _SINGLELINECAPTION_H
#define _SINGLELINECAPTION_H
////////////////////////////////////////////////////////////////
//
// class CSingleLineCaption
//
// Generic caption painter. Handles WM_NCPAINT, WM_NCACTIVATE, etc. to
// handle drawing custom captions. To use it:
//
// - call Install from your frame's OnCreate function.
// - Set a custom CaptionBackground if desired
// - Set custom TextAttributes if required
//
// Derive from this class for custom single line caption layouts.
//
// If you are drawing custom caption buttons, you must handle WM_NCLBUTTONDOWN & co.
// yourself. CSingleLineCaption does not handle the mouse for custom caption buttons.
//
// Author: Dave Lorde (dlorde@cix.compulink.co.uk)
//
// Copyright January 2000
//
// - based on a 1997 Microsoft Systems Journal
// C++ Q&A article by Paul DiLascia.
//
////////////////////////////////////////////////////////////////
//
#include "Caption.h"
// forward declarations
class CCaptionBackground;
class CCaptionTextAttributes;
class AFX_EXT_CLASS CSingleLineCaption : public CCaption
{
public:
CSingleLineCaption();
BOOL Install(CWnd* pWnd);
void SetIcon(HICON hIcon = 0); // For dialogs
protected:
HICON m_hIcon;
DECLARE_DYNAMIC(CSingleLineCaption);
// Helpers
//
int GetIconWidth();
// Override these in derived classes if necessary
//
virtual int PaintIcon(CDC* pDC = 0);
// Paul DiLascia says:
// "These are similar to, but NOT the same as the equivalent CWnd fns. Don't
// override unless you're a guru, and even THEN I wouldn't recommend it."
virtual LRESULT WindowProc (UINT msg, WPARAM wp, LPARAM lp);
virtual BOOL OnNcActivate (BOOL bActive);
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.