📄 caption.h
字号:
#ifndef _CAPTION_H#define _CAPTION_H//////////////////////////////////////////////////////////////////// class RxCaption//// 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 caption layouts.// // If you are drawing custom caption buttons, you must handle WM_NCLBUTTONDOWN & co.// yourself. RxCaption 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 "Subclass.h"class RxCaption : public RxSubclassWnd { BOOL m_bActive; // active/inactive state CBitmap m_bmpCaption[2]; // bitmaps for active/inactive captions CSize m_szCaption; // size of caption rectangle COLORREF m_crMask; COLORREF m_crActive; COLORREF m_crInactive; COLORREF m_crActiveText; COLORREF m_crInactiveText; CFont m_font; CFont m_fontSys;public: RxCaption(); // Protected ctor makes class abstract virtual ~RxCaption(); // Protected dtor makes class abstract DECLARE_DYNAMIC(RxCaption);protected: // 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 void OnNcPaint (HRGN hUpdateRgn); virtual BOOL OnNcActivate (BOOL bActive); virtual void OnSetText (LPCTSTR lpText); virtual void OnColorChange (); void PaintCaption (); void PaintRect (CDC* pDC, CRect rect, COLORREF color); CRect GetCaptionRect ();public: void SetActiveColor (COLORREF crActive); void SetInactiveColor (COLORREF crInactive); COLORREF GetActiveColor () const; COLORREF GetInactiveColor () const; void SetCustomColors (COLORREF crActive, COLORREF crInactive); void UseSystemActiveColor (); void UseSystemInactiveColor (); void UseSystemColors (); BOOL IsUsingSystemColors (); COLORREF GetTextColor (BOOL bActive); void SetActiveTextColor (COLORREF crActiveText); void SetInactiveTextColor (COLORREF crInactiveText); COLORREF GetActiveTextColor () const; COLORREF GetInactiveTextColor () const; void SetFont (CFont& font); CFont* GetFont (); BOOL Install (CFrameWnd* pFrameWnd); void Uninstall (); void Refresh (); void Invalidate ();};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -