18 #define UI_KIND_BUTTON 1
19 #define UI_KIND_KEYTRAP 2
20 #define UI_KIND_CHECKBOX 3
21 #define UI_KIND_RADIO 4
22 #define UI_KIND_SCROLLBAR 5
23 #define UI_KIND_LISTBOX 6
24 #define UI_KIND_INPUTBOX 7
25 #define UI_KIND_SLIDER 8
26 #define UI_KIND_ICON 9
27 #define UI_KIND_DOT_SLIDER 10
28 #define UI_KIND_SLIDER2 11
29 #define UI_KIND_DOT_SLIDER_NEW 12
31 #define MAX_KEY_BUFFER 32 // for listboxes
33 #define MAX_BMAPS_PER_GADGET 15
35 #define UI_INPUTBOX_FLAG_INVIS (1 << 0) // don't draw the input box boarders
36 #define UI_INPUTBOX_FLAG_KEYTHRU (1 << 1) // pass all keypresses through to parent
37 #define UI_INPUTBOX_FLAG_ESC_CLR (1 << 2) // allow escape key to clear input box
38 #define UI_INPUTBOX_FLAG_ESC_FOC (1 << 3) // escape loses focus for the input box
39 #define UI_INPUTBOX_FLAG_PASSWD (1 << 4) // display all characters as special "password" characters
40 #define UI_INPUTBOX_FLAG_EAT_USED (1 << 5) // don't return any characters actually used by inputbox
41 #define UI_INPUTBOX_FLAG_LETTER_FIRST (1 << 6) // require input string to begin with a letter.
42 #define UI_INPUTBOX_FLAG_NO_LETTERS (1 << 7) // don't allow [a-z,A-Z] at all, no matter what
43 #define UI_INPUTBOX_FLAG_NO_NUMERALS (1 << 8) // don't allow [0-9] at all, no matter what
44 #define UI_INPUTBOX_FLAG_TEXT_CEN (1 << 9) // always draw text centered in the inputbox
45 #define UI_INPUTBOX_FLAG_NO_BACK (1 << 10) // don't draw a black background rectangle
47 #define UI_GF_MOUSE_CAPTURED (1 << 31) // gadget has all rights to the mouse
113 virtual void process(
int focus = 0);
136 virtual void hide(
int n);
152 int set_bmaps(
char *ani_filename,
int nframes = 3,
int start_frame = 1);
159 #define UI_NUM_XSTR_COLORS 2
160 #define UI_XSTR_COLOR_GREEN 0 // shades of green/gray
161 #define UI_XSTR_COLOR_PINK 1 // pinkish hue
171 #define MAX_UI_XSTRS 100
183 #define BF_DOWN (1<<1)
184 #define BF_JUST_PRESSED (1<<2)
185 #define BF_JUST_RELEASED (1<<3)
186 #define BF_CLICKED (1<<4)
187 #define BF_DOUBLE_CLICKED (1<<5)
188 #define BF_HIGHLIGHTED (1<<6) // button is not highlighted (ie mouse is not over)
189 #define BF_JUST_HIGHLIGHTED (1<<7) // button has just been highlighted, true for 1 frame
190 #define BF_IGNORE_FOCUS (1<<8) // button should not use focus to accept space/enter keypresses
191 #define BF_HOTKEY_JUST_PRESSED (1<<9) // button hotkey was just pressed
192 #define BF_REPEATS (1<<10) // if held down, generates repeating presses
193 #define BF_SKIP_FIRST_HIGHLIGHT_CALLBACK (1<<11) // skip first callback for mouse over event
207 int force_draw_frame;
211 enum { B_NORMAL = 0 };
212 enum { B_HIGHLIGHT = 1 };
213 enum { B_PRESSED = 2 };
214 enum { B_DISABLED = 3 };
215 enum { B_REPEAT_TIME = 100 };
217 void (*m_just_highlighted_function)(
void);
221 virtual void process(
int focus = 0);
224 int custom_cursor_bmap;
225 int previous_cursor_bmap;
226 void maybe_show_custom_cursor();
227 void restore_previous_cursor();
240 void create(
UI_WINDOW *wnd,
char *_text,
int _x,
int _y,
int _w,
int _h,
int do_repeat=0,
int ignore_focus = 0);
255 virtual void process(
int focus = 0);
296 int cursor_first_frame;
299 int cursor_current_frame;
300 int cursor_elapsed_time;
302 int validate_input(
int chr);
306 virtual void process(
int focus = 0);
307 virtual void destroy();
310 void create(
UI_WINDOW *wnd,
int _x,
int _y,
int _w,
int _textlen,
char *_text,
int _flags = 0,
int pixel_lim = -1,
color *clr = NULL);
320 #define ICON_NOT_HIGHLIGHTED (1<<0) // icon is not highlighted (ie mouse is not over)
321 #define ICON_JUST_HIGHLIGHTED (1<<1) // icon has just been highlighted, true for 1 frame
328 enum { ICON_NORMAL = 0 };
329 enum { ICON_HIGHLIGHT = 1 };
330 enum { ICON_SELECTED = 2 };
331 enum { ICON_DISABLED = 3 };
334 virtual void process(
int focus = 0);
335 virtual void destroy();
338 void create(
UI_WINDOW *wnd,
char *_text,
int _x,
int _y,
int _w,
int _h);
348 virtual void process(
int focus = 0);
349 virtual void destroy();
352 enum { CBOX_UP_CLEAR = 0 };
353 enum { CBOX_DOWN_CLEAR = 1 };
354 enum { CBOX_UP_MARKED = 2 };
355 enum { CBOX_DOWN_MARKED = 3 };
356 enum { CBOX_DISABLED_CLEAR = 4 };
357 enum { CBOX_DISABLED_MARKED = 5 };
374 virtual void process(
int focus = 0);
375 virtual void destroy();
378 enum { RADIO_UP_CLEAR = 0 };
379 enum { RADIO_DOWN_CLEAR = 1 };
380 enum { RADIO_UP_MARKED = 2 };
381 enum { RADIO_DOWN_MARKED = 3 };
382 enum { RADIO_DISABLED_CLEAR = 4 };
383 enum { RADIO_DISABLED_MARKED = 5 };
388 void create(
UI_WINDOW *wnd,
char *_text,
int _x,
int _y,
int _state,
int _group );
412 virtual void process(
int focus = 0);
415 enum { SB_NORMAL = 0 };
416 enum { SB_DISABLED = 1 };
419 void create(
UI_WINDOW *wnd,
int _x,
int _y,
int _h,
int _start,
int _stop,
int _position,
int _window_size );
424 void link_hotspot(
int up_button_num,
int down_button_num);
425 int set_bmaps(
char *up_button_fname,
char *down_button_fname,
char *line_fname);
440 int bitmapSliderControl;
441 void (*upCallback)();
442 void (*downCallback)();
443 void (*captureCallback)();
445 int slider_w, slider_h, slider_half_h;
447 virtual void process(
int focus = 0);
450 enum { S2_NORMAL = 0 };
451 enum { S2_HIGHLIGHT = 1 };
452 enum { S2_PRESSED = 2 };
453 enum { S2_DISABLED = 3 };
456 enum { S2M_ON_ME = 0 };
457 enum { S2M_MOVING = 1 };
458 enum { S2M_DEFAULT = 2 };
462 void create(
UI_WINDOW *wnd,
int _x,
int _y,
int _w,
int _h,
int _numberItems,
char *_bitmapSliderControl,
463 void (*_upCallback)(),
void (*_downCallback)(),
void (*_captureCallback)());
488 int first_frame, total_frames;
495 void create(
UI_WINDOW *wnd,
int _x,
int _y,
char *bm,
int id,
int end_buttons = 1,
int _num_pos = 10);
497 virtual void process(
int focus = 0);
514 void create(
UI_WINDOW *wnd,
int _x,
int _y,
int _num_pos,
char *bm_slider,
int slider_mask,
515 char *bm_left = NULL,
int left_mask = -1,
int left_x = -1,
int left_y = -1,
516 char *bm_right = NULL,
int right_mask = -1,
int right_x = -1,
int right_y = -1,
517 int _dot_width = 19);
519 virtual void process(
int focus = 0);
529 int num_items_displayed;
535 int old_current_item;
541 int key_buffer_count;
549 virtual void process(
int focus = 0);
552 enum { LBOX_NORMAL = 0 };
553 enum { LBOX_DISABLED = 1 };
556 void create(
UI_WINDOW *wnd,
int _x,
int _y,
int _w,
int _h,
int _numitem,
char **_list,
char *_check_list = NULL,
int _max_items = -1);
575 int set_bmaps(
char *lbox_fname,
char *b_up_fname,
char *b_down_fname,
char *sb_fname);
576 void link_hotspot(
int up_button_num,
int down_button_num);
581 #define WIN_SAVE_BG 4
582 #define WIN_DIALOG (4+2+1)
636 void create(
int _x,
int _y,
int _w,
int _h,
int _flags,
int _f_id = -1 );
637 int process(
int key_in = -1,
int process_mouse = 1);
646 void add_XSTR(
char *
string,
int _xstr_id,
int _x,
int _y,
UI_GADGET *_assoc,
int _color_type,
int _font_id = -1);
649 const char *(*tooltip_handler)(
const char *text);
662 ui_button_info(
char *
name,
int x1,
int y1,
int xt1,
int yt1,
int h) : filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h) {}
void create(UI_WINDOW *wnd, int _x, int _y, int _num_pos, char *bm_slider, int slider_mask, char *bm_left=NULL, int left_mask=-1, int left_x=-1, int left_y=-1, char *bm_right=NULL, int right_mask=-1, int right_x=-1, int right_y=-1, int _dot_width=19)
DOT_SLIDER class down here.
void set_first_item(int _index)
void set_text(const char *in)
void set_highlight_action(void(*_user_function)(void))
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
void set_button_hilighted()
int get_current_hotspot()
virtual void process(int focus=0)
int mouse_captured(UI_GADGET *gadget=NULL)
void check_focus_switch_keys()
int bmap_ids[MAX_BMAPS_PER_GADGET]
void set_foreground_bmap(char *fname)
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _h, int _numitem, char **_list, char *_check_list=NULL, int _max_items=-1)
void base_create(UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h)
void set_callback(void(*_user_function)(void))
void set_ignore_gadgets(int state)
virtual void process(int focus=0)
void create(UI_WINDOW *wnd, int _x, int _y, int _h, int _start, int _stop, int _position, int _window_size)
void set_state(int _state)
int get_currentPosition()
int ui_getfilelist(int MaxNum, char **list, char *filespec)
void draw_forced(int frame_num)
void set_mask_bmap(char *fname)
void skip_first_highlight_callback()
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void set_hotkey_if_focus(int key)
void set_numberItems(int _numberItems, int _reset=1)
void set_drawframe(int mode)
UI_GADGET * mouse_captured_gadget
void get_dimensions(int *_x, int *_y, int *_w, int *_h)
void set_current(int _index)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state, int _group)
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _h, int _numberItems, char *_bitmapSliderControl, void(*_upCallback)(), void(*_downCallback)(), void(*_captureCallback)())
void link_hotspot(int up_button_num, int down_button_num)
void create(UI_WINDOW *wnd, int _x, int _y, char *bm, int id, int end_buttons=1, int _num_pos=10)
DOT_SLIDER class down here.
void ui_sort_filenames(int n, char **list)
char * get_string(int _index)
int use_hack_to_get_around_stupid_problem_flag
void remove_from_family()
#define MAX_BMAPS_PER_GADGET
int add_string(char *str)
void render_tooltip(char *str)
void force_currentItem(int _currentItem)
int is_mouse_on_children()
void set_hotkey(int keycode)
typedef void(APIENTRY *PFNGLARRAYELEMENTEXTPROC)(GLint i)
GLuint const GLchar * name
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state)
void update_dimensions(int _x, int _y, int _w, int _h)
int set_bmaps(char *up_button_fname, char *down_button_fname, char *line_fname)
void set_parent(UI_GADGET *_parent)
void link_hotspot(int num)
ubyte * get_mask_data(int *w_md, int *h_md)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
void draw_one_xstr(UI_XSTR *xstr, int frame)
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
void set_invalid_chars(char *ichars)
void capture_mouse(UI_GADGET *gadget=NULL)
void set_currentItem(int _currentItem)
int set_bmaps(char *lbox_fname, char *b_up_fname, char *b_down_fname, char *sb_fname)
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _textlen, char *_text, int _flags=0, int pixel_lim=-1, color *clr=NULL)
void start_drag_with_children()
void drag_with_children(int dx, int dy)
void get_mouse_pos(int *xx, int *yy)
void stop_drag_with_children()
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h)
void draw_XSTR_forced(UI_GADGET *owner, int frame)
void create(UI_WINDOW *wnd, int key, void(*_user_function)(void))
GLenum GLuint GLenum GLsizei length
void set_new_list(int _numitems, char **_list)
void set_valid_chars(char *vchars)
UI_XSTR * xstrs[MAX_UI_XSTRS]
void(* user_function)(void)
void set_disabled_action(void(*_user_function)(void))
virtual void process(int focus=0)
struct ui_button_info ui_button_info
void link_hotspot(int up_button_num, int down_button_num)
int process(int key_in=-1, int process_mouse=1)
void set_custom_cursor_bmap(int bmap_id)
UI_GADGET * selected_gadget