23 #ifndef BAGEL_BOFLIB_GUI_BUTTON_H 24 #define BAGEL_BOFLIB_GUI_BUTTON_H 26 #include "bagel/boflib/gui/window.h" 27 #include "bagel/boflib/gfx/palette.h" 35 #define BUTTON_FOCUS 2 36 #define BUTTON_DISABLED 3 37 #define BUTTON_CLICKED 4 38 #define BUTTON_ON BUTTON_DOWN 39 #define BUTTON_OFF BUTTON_UP 41 #define BUTTON_CHECKED BUTTON_ON 42 #define BUTTON_UNCHECKED BUTTON_OFF 49 RGBCOLOR _cTextDisabled;
61 virtual ErrorCode paint(
CBofRect *pRect =
nullptr);
63 void enable()
override;
64 void disable()
override;
66 ErrorCode setState(
int nNewState,
bool bRepaintNow =
true);
72 void onPaint(
CBofRect *pRect)
override;
73 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
74 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
77 RGBCOLOR _cHighlightColor;
78 RGBCOLOR _cShadowColor;
80 RGBCOLOR _cTextDisabledColor;
81 RGBCOLOR _cOutlineColor;
88 virtual ErrorCode paint(
CBofRect *pRect =
nullptr);
91 virtual void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
92 virtual void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
97 ErrorCode SetCheck(
bool bChecked);
99 return (_nState == BUTTON_CHECKED);
102 ErrorCode paint(
CBofRect *pRect =
nullptr)
override;
105 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
106 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
119 ErrorCode loadBitmaps(
CBofPalette *pPalette,
const char *pszUp,
const char *pszDown =
nullptr,
const char *pszFocus =
nullptr,
const char *pszDisabled =
nullptr,
int nMaskColor = NOT_TRANSPARENT);
121 ErrorCode paint(
CBofRect *pRect =
nullptr);
123 ErrorCode setState(
int nNewState,
bool bRepaintNow =
true);
133 void onPaint(
CBofRect *pRect)
override;
134 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
135 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;