24 #ifndef NUVIE_GUI_GUI_BUTTON_H 25 #define NUVIE_GUI_GUI_BUTTON_H 27 #include "ultima/nuvie/gui/widgets/gui_widget.h" 28 #include "ultima/nuvie/gui/gui_font.h" 37 #define BUTTON3D_DOWN 2 39 #define BUTTON2D_DOWN 4 42 enum ButtonTextAlign {
43 BUTTON_TEXTALIGN_LEFT = 1,
44 BUTTON_TEXTALIGN_CENTER = 2,
45 BUTTON_TEXTALIGN_RIGHT = 3,
50 static const uint16 BUTTON_CB = 0x1;
55 static const uint8 BF_R = 183, BF_G = 185, BF_B = 150;
57 static const uint8 BL_R = 245, BL_G = 247, BL_B = 201;
59 static const uint8 BS_R = 115, BS_G = 116, BS_B = 94;
61 static const uint8 BI1_R = 255, BI1_G = 255, BI1_B = 255;
63 static const uint8 BI2_R = 0, BI2_G = 0, BI2_B = 0;
65 #define GUI_BUTTON_DONT_FREE_SURFACES false 68 typedef GUI_status(*GUI_ActiveProc)(
void *data);
78 GUI_Button(
void *data,
int x,
int y,
int w,
int h,
84 GUI_Button(
void *data,
int x,
int y,
int w,
int h,
const char *text,
85 GUI_Font *font, ButtonTextAlign alignment,
bool is_checkbutton,
91 virtual void ChangeTextButton(
int x,
int y,
int w,
int h,
const char *text, ButtonTextAlign alignment);
94 void Display(
bool full_redraw)
override;
97 GUI_status MouseDown(
int x,
int y, Shared::MouseButton button)
override;
98 GUI_status MouseUp(
int x,
int y, Shared::MouseButton button)
override;
99 GUI_status MouseMotion(
int x,
int y, uint8 state)
override;
102 virtual void Disable();
103 virtual void Enable(
bool flag =
true);
106 virtual bool Enabled() {
111 virtual bool IsCheckButton() {
114 virtual void set_highlighted(
bool val) {
115 is_highlighted = val;
117 virtual GUI_status Activate_button(
int x = 0,
int y = 0, Shared::MouseButton button = Shared::BUTTON_LEFT);
Definition: managed_surface.h:51
Definition: gui_font.h:36
Definition: detection.h:27
Definition: gui_callback.h:31