CODButtonComponent Class

class CODButtonComponent: public CODControlComponent

This is a windowed component class that encapsulates an button control. It overrides the  CODWndComponent::CreateWnd and creates an button control.

This class contains a number of functions that are simple wrappers around Windows API functions that take a window handle. For complete documentation on the wrapper functions, consult the Windows API documentation.

Defined in: OdWndComp.h

Class Members

 CODButtonComponent(const UINT nCtlID = 1)

Constructor.

 CODButtonComponent(const CODButtonComponent& src)

Copy constructor.

virtual  ~CODButtonComponent()

Destructor.

virtual BOOL  CreateWnd(HWND hParent)

Creates and returns a window object to caller.

CODButtonComponent&  operator=(const CODButtonComponent& src)

Assignment operator.

virtual CODComponent*  Dup() const

Creates a copy of this component.

virtual void  Serialize(CArchive& ar)

Serializes the window component.

inline UINT GetState() const

Retrieves the check state, highlight state, and focus state of a button control.

inline void SetState(BOOL bHighlight)

Sets the highlighting state of a button control.

inline int GetCheck() const

Retrieves the check state of a button control.

inline void SetCheck(int nCheck)

Sets the check state of a button control.

inline UINT GetButtonStyle() const

Retrieves information about the button control style.

inline void SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE)

Changes the style of a button.

inline HICON SetIcon(HICON hIcon)

Specifies an icon to be displayed on the button.

inline HICON GetIcon() const

Retrieves the handle of the icon previously set with SetIcon.

inline HBITMAP SetBitmap(HBITMAP hBitmap)

Specifies a bitmap to be displayed on the button.

inline HBITMAP GetBitmap() const

Retrieves the handle of the bitmap previously set with SetBitmap.

inline HCURSOR SetCursor(HCURSOR hCursor)

Specifies a cursor image to be displayed on the button.

inline HCURSOR GetCursor()

Specifies a cursor image to be displayed on the button.