#ifndef WIDGETBUTTON_H #define WIDGETBUTTON_H #include #include "widget.h" //! A Button class class CButton: public CWidget { public: /*! Constructor */ CButton(); /*! Create Button \param parent HANDLE of the parent window on which to draw \param name Name of the Button \param x Top left x coordinate \param y Top left y coordinate \param w Form width \param h Form height \param style Style flags\n WGF_NO_BORDER: Button has no border\n WGF_BORDER_ON_MOUSE_OVER: Buttons has border on mouseover \param ID ID sent to parent when Button is pressed (MSG_COMMAND) \return Success: S_OK\n Failure: E_HANDLE */ HRESULT Create(HANDLE parent, char * name, int x, int y, int w, int h, int style, unsigned int ID); /*! Enable Button */ HRESULT Enable(); /*! Disable Button */ HRESULT Disable(); HRESULT OwnerDraw(char bOwnerDraw, void * pCookie); /*! Change Text on Button \param text New text to display */ HRESULT SetText(char * text); /*! Get Text on Button \return Text */ char * GetText(); /*! Set background bitmap \param dib Bitmap to draw */ HRESULT SetBackground(DIB * dib); /*! Get background bitmap \return Pointer to background bitmap */ DIB * GetBackground(); HRESULT SetBackgroundBlit(int bPressed, sBlit * pBlit); sBlit * GetBackgroundBlit(); /*! Set foreground bitmap \param dib Bitmap to draw */ HRESULT SetForeground(DIB * dib); /*! Get foreground bitmap \return Pointer to foreground bitmap */ DIB * GetForeground(); HRESULT SetIcon(s_gi_icon * icon); s_gi_icon * GetIcon(); /*! Set bitmap to be drawn when Button is clicked \param dib Bitmap to draw when Button is clicked */ HRESULT SetPressedDIB(DIB * dib); /*! Get bitmap to be drawn when Button is clicked \return Pointer to bitmap */ DIB * GetPressedDIB(); HRESULT SetStyle(unsigned int flags); HRESULT SetTextColor(COLOR color); COLOR GetTextColor(); HRESULT UseParentBackground(char use); friend class CTooltip; protected: char Text[64]; s_gi_icon * Icon; DIB * Foreground; DIB * Background; sBlit * BackgroundBlit; DIB * PressedDIB; COLOR TextColor; }; #endif