class SECBitmapButton: public SECOwnerDrawButton
The SECBitmapButton class implements a button which displays a bitmap and an optional caption on the button face.
Defined in: SECBTNS.h
See the COLOR sample in the \\OT\\SAMPLES\\STANDARD\\CONTROLSCOLRWELL directory for a demonstration of this class.
m_bmpButton.AttachButton(IDC_BUTTON1, SECBitmapButton::Al_Left, IDB_BMP, this);You can dynamically create an SECBitmapButton button control with
m_bmpButton.Create("Help", WS_VISIBLE|WS_TABSTOP|WS_CHILD, SECBitmapButton::Al_Left, IDB_HELP, rect, this, IDC_BUTTON1);
enum Alignment
The alignment modes.
FOUNDATION_API SECBitmapButton()
Creates a bitmap button object.
FOUNDATION_API virtual BOOL AttachButton(int nCtlID, Alignment alignment, int nIDBmp, CWnd* pParentWnd, int iFlags=0)
Attaches the bitmap button object to an existing button.
FOUNDATION_API virtual BOOL AttachButton(int nCtlID, Alignment alignment, LPCTSTR lpszBmpName, CWnd* pParentWnd, int iFlags=0)
Attaches the bitmap button object to an existing button.
FOUNDATION_API virtual BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, Alignment alignment, LPCTSTR lpszBmpName, const CRect& rect, CWnd* pParentWnd, int nID, int iFlags=0)
Dynamically creates a bitmap button control.
FOUNDATION_API virtual BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, Alignment alignment, int nIDBmp, const CRect& rect, CWnd* pParentWnd, int nID, int iFlags=0)
Dynamically creates a bitmap button control.
FOUNDATION_API void SetIndents(CSize sz)
Sets the bitmap margin offsets.
FOUNDATION_API CSize GetIndents() const
Returns the bitmap margin offsets.
FOUNDATION_API void SizeToContent()
Size the button to fit it's contents.
FOUNDATION_API BOOL SetBitmap(LPCTSTR lpszBmp)
Change the current bitmap
FOUNDATION_API BOOL SetBitmap(int nIDBmp)
Change the current bitmap
FOUNDATION_API virtual void CalcLayout()
Calculates the position of the bitmap and text.
FOUNDATION_API virtual void DrawSpecific(CDC* pDC, LPDRAWITEMSTRUCT lpDS, CRect& rect)
Draws the face of the button.
FOUNDATION_API virtual void DrawFocus(CDC* pDC, CRect& rect)
Draws the focus rectangle.
LPCTSTR m_lpszBmpName
Resource name for bitmap.
CBitmap m_bmp
The bitmap for the button.
CSize m_indents
Indentations of bitmap from edge of button face.
CRect m_bmpRect
Window rectangle for the bitmap
CRect m_textRect
Window rectangle for the text
Alignment m_alignment
The alignment mode.