23 #ifndef BAGEL_BOFLIB_GUI_BUTTON_H 24 #define BAGEL_BOFLIB_GUI_BUTTON_H 26 #include "bagel/spacebar/boflib/gui/window.h" 27 #include "bagel/boflib/palette.h" 36 #define BUTTON_FOCUS 2 37 #define BUTTON_DISABLED 3 38 #define BUTTON_CLICKED 4 39 #define BUTTON_ON BUTTON_DOWN 40 #define BUTTON_OFF BUTTON_UP 42 #define BUTTON_CHECKED BUTTON_ON 43 #define BUTTON_UNCHECKED BUTTON_OFF 50 COLORREF _cTextDisabled;
62 virtual ErrorCode paint(
CBofRect *pRect =
nullptr);
64 void enable()
override;
65 void disable()
override;
67 ErrorCode setState(
int nNewState,
bool bRepaintNow =
true);
73 void onPaint(
CBofRect *pRect)
override;
74 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
75 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
78 COLORREF _cHighlightColor;
79 COLORREF _cShadowColor;
81 COLORREF _cTextDisabledColor;
82 COLORREF _cOutlineColor;
89 virtual ErrorCode paint(
CBofRect *pRect =
nullptr);
92 virtual void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
93 virtual void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr);
98 ErrorCode SetCheck(
bool bChecked);
100 return (_nState == BUTTON_CHECKED);
103 ErrorCode paint(
CBofRect *pRect =
nullptr)
override;
106 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
107 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
120 ErrorCode loadBitmaps(
CBofPalette *pPalette,
const char *pszUp,
const char *pszDown =
nullptr,
const char *pszFocus =
nullptr,
const char *pszDisabled =
nullptr,
int nMaskColor = NOT_TRANSPARENT);
122 ErrorCode paint(
CBofRect *pRect =
nullptr);
124 ErrorCode setState(
int nNewState,
bool bRepaintNow =
true);
134 void onPaint(
CBofRect *pRect)
override;
135 void onLButtonDown(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;
136 void onLButtonUp(uint32 nFlags,
CBofPoint *pPoint,
void * =
nullptr)
override;