31 if ( _text[0] !=
'\0' ) {
42 m_just_highlighted_function = NULL;
43 m_disabled_function = NULL;
58 custom_cursor_bmap = -1;
59 previous_cursor_bmap = -1;
62 void UI_BUTTON::destroy()
75 hotkey_if_focus =
key;
89 void UI_BUTTON::frame_reset()
100 restore_previous_cursor();
122 int offset, frame_num = -1;
129 frame_num = B_PRESSED;
134 frame_num = B_DISABLED;
139 frame_num = B_HIGHLIGHT;
144 frame_num = B_NORMAL;
148 if (frame_num >= 0) {
190 void UI_BUTTON::process(
int focus)
192 int mouse_on_me, old_flags;
218 if (m_disabled_function != NULL) {
219 m_disabled_function();
232 maybe_show_custom_cursor();
234 if ( !mouse_on_me ) {
242 if (m_just_highlighted_function) {
245 if ( first_callback ) {
252 m_just_highlighted_function();
272 if ( focus && (hotkey_if_focus >= 0) ) {
284 if ( (old_flags & BF_DOWN) && !(old_flags &
BF_CLICKED) )
297 if ( !(old_flags & BF_DOWN) ) {
304 next_repeat =
timestamp(B_REPEAT_TIME * 3);
377 m_just_highlighted_function = _user_function;
382 m_disabled_function = _user_function;
431 void UI_BUTTON::maybe_show_custom_cursor()
438 if ((custom_cursor_bmap >= 0) && (previous_cursor_bmap < 0)) {
445 void UI_BUTTON::restore_previous_cursor()
447 if (previous_cursor_bmap >= 0) {
449 previous_cursor_bmap = -1;
void set_highlight_action(void(*_user_function)(void))
int timestamp(int delta_ms)
void set_button_hilighted()
GLfloat GLfloat GLfloat GLfloat h
int bmap_ids[MAX_BMAPS_PER_GADGET]
general failure sound for any event
void base_create(UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h)
void gr_set_color_fast(color *dst)
void ui_draw_box_in(int x1, int y1, int x2, int y2)
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
void ui_draw_box_out(int x1, int y1, int x2, int y2)
__inline void gr_set_clip(int x, int y, int w, int h, int resize_mode=GR_RESIZE_FULL)
void draw_forced(int frame_num)
void skip_first_highlight_callback()
void set_hotkey_if_focus(int key)
#define BF_SKIP_FIRST_HIGHLIGHT_CALLBACK
int use_hack_to_get_around_stupid_problem_flag
#define B1_DOUBLE_CLICKED
GLint GLint GLint GLint GLint x
int gr_get_cursor_bitmap()
void gr_set_cursor_bitmap(int n, int lock)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
GLubyte GLubyte GLubyte GLubyte w
#define BF_JUST_HIGHLIGHTED
#define timestamp_elapsed(stamp)
void draw_XSTR_forced(UI_GADGET *owner, int frame)
void gr_bitmap(int _x, int _y, int resize_mode)
#define BF_HOTKEY_JUST_PRESSED
void ui_string_centered(int x, int y, char *s)
void(* user_function)(void)
void set_disabled_action(void(*_user_function)(void))
void gamesnd_play_iface(int n)
void gr_set_font(int fontnum)
#define BF_DOUBLE_CLICKED
UI_GADGET * selected_gadget