FS2_Open
Open source remastering of the Freespace 2 engine
ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _UI_H
13 #define _UI_H
14 
15 #include "graphics/2d.h"
16 #include "graphics/font.h"
17 
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
30 
31 #define MAX_KEY_BUFFER 32 // for listboxes
32 
33 #define MAX_BMAPS_PER_GADGET 15
34 
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
46 
47 #define UI_GF_MOUSE_CAPTURED (1 << 31) // gadget has all rights to the mouse
48 
49 class UI_WINDOW;
50 class UI_BUTTON;
51 class UI_KEYTRAP;
52 class UI_CHECKBOX;
53 class UI_RADIO;
54 class UI_SCROLLBAR;
55 class UI_LISTBOX;
56 class UI_INPUTBOX;
57 class UI_SLIDER2;
58 class UI_DOT_SLIDER;
59 class UI_DOT_SLIDER_NEW;
60 
61 class UI_GADGET
62 {
63  friend class UI_WINDOW;
64  friend class UI_BUTTON;
65  friend class UI_KEYTRAP;
66  friend class UI_CHECKBOX;
67  friend class UI_RADIO;
68  friend class UI_SCROLLBAR;
69  friend class UI_LISTBOX;
70  friend class UI_INPUTBOX;
71  friend class UI_SLIDER2;
72  friend class UI_DOT_SLIDER;
73  friend class UI_DOT_SLIDER_NEW;
74 
75  protected:
76  char *bm_filename;
77  int kind;
78  int hotkey;
79  int x, y, w, h;
80  int m_flags;
86  int hidden;
87 
88  // Data for supporting linking controls to hotspots
91 
92  // Data for supporting bitmaps associated with different states of the control
95 
96  void drag_with_children( int dx, int dy );
99 
104 
105  int is_mouse_on_children();
106  void remove_from_family();
107  void set_parent(UI_GADGET *_parent);
108 
109  UI_GADGET *get_next();
110  UI_GADGET *get_prev();
112 
113  virtual void process(int focus = 0);
114  virtual void destroy();
115  int check_move();
116 
117  public:
119 
120  UI_GADGET(); // constructor
121  virtual ~UI_GADGET(); // destructor
122 
123  void base_create( UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h );
124  virtual void draw();
125  void set_focus();
126  void clear_focus();
127  int has_focus();
128  void set_hotkey(int keycode);
129  void set_callback(void (*_user_function)(void));
130  void disable();
131  void enable(int n = 1);
132  void capture_mouse();
133  int mouse_captured(UI_GADGET *gadget = NULL);
134  int disabled();
135  int enabled();
136  virtual void hide(int n);
137  virtual void hide();
138  virtual void unhide();
139  void update_dimensions(int _x, int _y, int _w, int _h);
140  void get_dimensions(int *_x, int *_y, int *_w, int *_h);
141  int is_mouse_on();
142  void get_mouse_pos(int *xx, int *yy);
143 
144  void link_hotspot(int num);
145  int get_hotspot();
146  int bmaps_used() { return uses_bmaps; }
147 
148  // loads nframes bitmaps, starting at index start_frame.
149  // anything < start_frame will not be loaded.
150  // this keeps the loading code from trying to load bitmaps which don't exist
151  // and taking an unnecessary disk hit.
152  int set_bmaps(char *ani_filename, int nframes = 3, int start_frame = 1); // extracts MAX_BMAPS_PER_GADGET from .ani file
153 
154  void reset(); // zero out m_flags
155  virtual int is_hidden();
156 };
157 
158 // xstrings for a window
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
162 typedef struct UI_XSTR {
163  char *xstr; // base string
164  int xstr_id; // xstring id
165  int x, y; // coords of the string
166  int clr; // color to use
167  int font_id; // font id
168  UI_GADGET *assoc; // the associated gadget
169 } UI_XSTR;
170 
171 #define MAX_UI_XSTRS 100
172 
173 // Button terminology:
174 // Up = button is in up state (also called pressed)
175 // Down = button is in down state (also called released)
176 // Just pressed = button has just gone from up to down state
177 // Just released = button has just gone from down to up state
178 // Clicked = a trigger type effect caused by 'just pressed' event or repeat while 'down'
179 // Double clicked = 2 'just pressed' events occuring within a short amount of time
180 
181 // Button flags
182 #define BF_UP (1<<0)
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
194 
195 class UI_BUTTON : public UI_GADGET
196 {
197  friend class UI_SCROLLBAR;
198  friend class UI_SLIDER2;
199  friend class UI_DOT_SLIDER;
200  friend class UI_DOT_SLIDER_NEW;
201 
202  char *text;
203  int position; // indicates position of button (0 - up, 1 - down by mouse click 2 - down by keypress
204  int next_repeat; // timestamp for next repeat if held down
205  int m_press_linger; // timestamp for hold a pressed state animation
206  int hotkey_if_focus; // hotkey for button that only works if it has focus
207  int force_draw_frame; // frame number to draw next time (override default)
208  int first_callback; // true until first time callback function is called for button highlight
209 
210  // Used to index into bmap_ids[] array to locate right bitmap for button
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 }; // ms
216 
217  void (*m_just_highlighted_function)(void); // call-back that gets called when button gets highlighted
218  void (*m_disabled_function)(void); // callback that gets called when disabled button gets pressed (sound, popup, etc)
219 
220  void frame_reset();
221  virtual void process(int focus = 0);
222  virtual void destroy();
223 
224  int custom_cursor_bmap; // bmap handle of special cursor used on mouseovers
225  int previous_cursor_bmap; // store old cursor
226  void maybe_show_custom_cursor(); // call this in process()
227  void restore_previous_cursor(); // called in frame_reset()
228 
229  public:
230  virtual void draw();
231  void set_hotkey_if_focus(int key);
232  int pressed(); // has it been selected (ie clicked on)
233  int double_clicked(); // button was double clicked on
234  int just_pressed(); // button has just been selected
235  int just_highlighted(); // button has just had mouse go over it
236  int button_down(); // is the button depressed?
237  int button_hilighted(); // is the mouse over this button?
238  void set_button_hilighted(); // force button to be highlighted
239  void press_button(); // force button to get pressed
240  void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus = 0);
241  void set_highlight_action( void (*_user_function)(void) );
242  void set_disabled_action( void (*_user_function)(void) );
243  void draw_forced(int frame_num);
244  void reset_status();
245  void reset_timestamps();
247  void repeatable(int yes);
248  void set_custom_cursor_bmap(int bmap_id) { custom_cursor_bmap = bmap_id; }
249 };
250 
251 class UI_KEYTRAP : public UI_GADGET
252 {
253  int pressed_down;
254  virtual void draw();
255  virtual void process(int focus = 0);
256 
257  public:
258  int pressed();
259  void create(UI_WINDOW *wnd, int key, void (*_user_function)(void) );
260 };
261 
279 class UI_INPUTBOX : public UI_GADGET
280 {
281  char *text;
282  char *passwd_text;
283  int length;
284  int position;
285  int oldposition;
286  int pressed_down;
287  int changed_flag;
288  int flags;
289  int pixel_limit; // base max characters on how wide the string is (-1 to ignore) in pixels
290  int locked;
291  color *text_color;
292  char *valid_chars;
293  char *invalid_chars;
294 
295  // cursor drawing
296  int cursor_first_frame;
297  int cursor_nframes;
298  int cursor_fps;
299  int cursor_current_frame;
300  int cursor_elapsed_time;
301 
302  int validate_input(int chr);
303  void init_cursor();
304 
305  virtual void draw();
306  virtual void process(int focus = 0);
307  virtual void destroy();
308 
309  public:
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);
311  void set_valid_chars(char *vchars);
312  void set_invalid_chars(char *ichars);
313  int changed();
314  int pressed();
315  void get_text(char *out);
316  void set_text(const char *in);
317 };
318 
319 // Icon flags
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
322 
323 class UI_ICON : public UI_GADGET
324 {
325  char *text;
326 
327  // Used to index into bmap_ids[] array to locate right bitmap for button
328  enum { ICON_NORMAL = 0 };
329  enum { ICON_HIGHLIGHT = 1 };
330  enum { ICON_SELECTED = 2 };
331  enum { ICON_DISABLED = 3 };
332 
333  virtual void draw();
334  virtual void process(int focus = 0);
335  virtual void destroy();
336 
337  public:
338  void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h);
339 };
340 
341 class UI_CHECKBOX : public UI_GADGET
342 {
343  char *text;
344  int position;
345  int pressed_down;
346  int flag;
347  virtual void draw();
348  virtual void process(int focus = 0);
349  virtual void destroy();
350 
351  // Used to index into bmap_ids[] array to locate right bitmap for checkbox
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 };
358 
359  public:
360  int changed();
361  int checked();
362  void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state );
363  void set_state(int _state);
364 };
365 
366 class UI_RADIO : public UI_GADGET
367 {
368  char *text;
369  int position;
370  int pressed_down;
371  int flag;
372  int group;
373  virtual void draw();
374  virtual void process(int focus = 0);
375  virtual void destroy();
376 
377  // Used to index into bmap_ids[] array to locate right bitmap for radio button
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 };
384 
385  public:
386  int changed();
387  int checked();
388  void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state, int _group );
389 };
390 
391 class UI_SCROLLBAR : public UI_GADGET
392 {
393  friend class UI_LISTBOX;
394  friend class UI_BUTTON;
395  int horz;
396  int start;
397  int stop;
398  int position;
399  int window_size;
400  int bar_length;
401  int bar_position;
402  int bar_size;
403  UI_BUTTON up_button;
404  UI_BUTTON down_button;
405  int last_scrolled;
406  int drag_x, drag_y;
407  int drag_starting;
408  int dragging;
409  int moved;
410 
411  virtual void draw();
412  virtual void process(int focus = 0);
413 
414  // Used to index into bmap_ids[] array to locate right bitmap for scrollbar
415  enum { SB_NORMAL = 0 };
416  enum { SB_DISABLED = 1 };
417 
418  public:
419  void create(UI_WINDOW *wnd, int _x, int _y, int _h,int _start, int _stop, int _position, int _window_size );
420  int getpos();
421  int changed();
422  void hide();
423  void unhide();
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);
426 };
427 
428 class UI_SLIDER2 : public UI_GADGET
429 {
430  friend class UI_BUTTON;
431  private:
432  int numberItems; // total range
433  int numberPositions; // total positions (height - bitmapbuttonheight)
434  int currentItem; // current item we are on
435  int currentPosition; // current position
436  int last_scrolled;
437  int mouse_locked;
438  int slider_mode; //
439  UI_BUTTON sliderBackground;// invisible button to detect clicks
440  int bitmapSliderControl; // this is the bitmap of the slider button itself
441  void (*upCallback)();
442  void (*downCallback)();
443  void (*captureCallback)(); // this is called when the mouse is released
444  UI_BUTTON *upButton, *downButton;
445  int slider_w, slider_h, slider_half_h; // this is the width and height and half height of the bitmap used for the slider
446  virtual void draw();
447  virtual void process(int focus = 0);
448 
449  // Used to index into bmap_ids[] array to locate right bitmap for slider
450  enum { S2_NORMAL = 0 };
451  enum { S2_HIGHLIGHT = 1 };
452  enum { S2_PRESSED = 2 };
453  enum { S2_DISABLED = 3 };
454 
455  // Used for slider mode
456  enum { S2M_ON_ME = 0 };
457  enum { S2M_MOVING = 1 };
458  enum { S2M_DEFAULT = 2 };
459 
460  public:
461  // create the slider
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)());
464 
465  // range management
466  int get_numberItems(); // return number of itmes
467  int get_currentPosition(); // return current position
468  int get_currentItem(); // return current item
469  void set_numberItems(int _numberItems, int _reset = 1); // change range. maybe reset back to position 0
470  void set_currentItem(int _currentItem); // force slider to new position manually
471  void force_currentItem(int _currentItem); // force slider to new position manually, _not_ calling any callbacks
472 
473  // force down
474  void forceDown();
475 
476  // force up
477  void forceUp();
478 };
479 
480 // to be phased out eventually in FS2
481 class UI_DOT_SLIDER : public UI_GADGET
482 {
483  friend class UI_BUTTON;
484 
485  UI_BUTTON button;
486  UI_BUTTON up_button;
487  UI_BUTTON down_button;
488  int first_frame, total_frames;
489  int has_end_buttons;
490  int num_pos;
491 
492  public:
493  int pos; // 0 thru 10
494 
495  void create(UI_WINDOW *wnd, int _x, int _y, char *bm, int id, int end_buttons = 1, int _num_pos = 10);
496  virtual void draw();
497  virtual void process(int focus = 0);
498  virtual void destroy();
499 };
500 
502 {
503  friend class UI_BUTTON;
504  UI_BUTTON button;
505  UI_BUTTON up_button;
506  UI_BUTTON down_button;
507  int has_end_buttons;
508  int num_pos;
509  int dot_width;
510 
511  public:
512  int pos; // 0 thru 10
513 
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);
518  virtual void draw();
519  virtual void process(int focus = 0);
520 };
521 
522 class UI_LISTBOX : public UI_GADGET
523 {
524  private:
525  char **list;
526  char *check_list;
527  int max_items;
528  int num_items;
529  int num_items_displayed;
530  int first_item;
531  int old_first_item;
532  int current_item;
533  int selected_item;
534  int toggled_item;
535  int old_current_item;
536  int last_scrolled;
537  int dragging;
538  int textheight;
539  int has_scrollbar;
540  char key_buffer[MAX_KEY_BUFFER];
541  int key_buffer_count;
542  int last_typed;
543  UI_SCROLLBAR scrollbar;
544 
545  // kazan
546  int draw_frame;
547 
548  virtual void draw();
549  virtual void process(int focus = 0);
550 
551  // Used to index into bmap_ids[] array to locate right bitmap for listbox
552  enum { LBOX_NORMAL = 0 };
553  enum { LBOX_DISABLED = 1 };
554 
555  public:
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);
557  int selected(); // selected: Returns >= 0 if an item was selected
558  int current(); // current: Returns which item listbox bar is currently on. This could be -1, if none selected!
559  int toggled(); // toggled: Returns which item was toggled with spacebr or mouse click of check_list is not NULL
560  void set_current(int _index); // sets the current item in the list box
561  void set_first_item(int _index);
562  char *get_string(int _index);
563  void clear_all_items(); // deletes all the items in the list (makes them empty strings)
564  int add_string(char *str);
565  int sel_changed(); // returns > 0 if the selected item has changed
566  void set_new_list(int _numitems, char **_list);
567 
568  // kazan
569  void set_drawframe(int mode);
570  int CurSize();
571  int MaxSize();
572  void RemoveFirstItem();
573  void ScrollEnd();
574 
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);
577 };
578 
579 #define WIN_BORDER 1
580 #define WIN_FILLED 2
581 #define WIN_SAVE_BG 4
582 #define WIN_DIALOG (4+2+1)
583 
585 {
586  friend class UI_GADGET;
587  friend class UI_BUTTON;
588  friend class UI_KEYTRAP;
589  friend class UI_CHECKBOX;
590  friend class UI_RADIO;
591  friend class UI_SCROLLBAR;
592  friend class UI_LISTBOX;
593  friend class UI_INPUTBOX;
594  friend class UI_SLIDER2;
595  friend class UI_DOT_SLIDER;
596  friend class UI_DOT_SLIDER_NEW;
597  friend class UI_ICON;
598 
599 protected:
600  int flags;
601  int x, y;
602  int w, h;
603  int f_id; // font id
606  int tt_group; // which tooltip group this window uses, or -1 if none
608 
612 
613  int mask_bmap_id; // bitmap id of the mask bitmap to define hotspots
614  int foreground_bmap_id; // bitmap id of the foreground bitmap to display
615  bitmap *mask_bmap_ptr; // pointer to bitmap of the mask
616  ubyte *mask_data; // points to raw mask bitmap data
617  int mask_w, mask_h; // width and height of the mask
618 
619  UI_XSTR *xstrs[MAX_UI_XSTRS]; // strings for drawing in code instead of in artwork
620 
621 
622  int keypress; // filled in each frame
623  void capture_mouse(UI_GADGET *gadget = NULL);
624  void release_bitmaps(); // called internally when window destroys gadgets
626  void do_dump_check();
627  void draw_xstrs(); // draw xstrs
628  void draw_one_xstr(UI_XSTR *xstr, int frame);
629 
630 public:
631  UI_WINDOW(); // constructor
632  ~UI_WINDOW(); // destructor
633  void set_mask_bmap(char *fname);
634  void set_mask_bmap(int bmap, char *name);
635  void set_foreground_bmap(char *fname);
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);
638  void draw();
639  void draw_tooltip();
640  void draw_XSTR_forced(UI_GADGET *owner, int frame);
641  int get_current_hotspot();
642  void destroy();
643  ubyte *get_mask_data(int *w_md, int *h_md) { *w_md = mask_w; *h_md = mask_h; return mask_data; }
644  void render_tooltip(char *str);
645  void set_ignore_gadgets(int state);
646  void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id = -1);
647  void add_XSTR(UI_XSTR *xstr);
648 
649  const char *(*tooltip_handler)(const char *text);
650  int last_keypress; // filled in each frame
651  int ttx, tty;
653 };
654 
655 // 2 extremely useful structs
656 typedef struct ui_button_info {
657  char *filename;
658  int x, y, xt, yt;
659  int hotspot;
660  UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
661 
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) {}
664 
665 
666 int ui_getfilelist( int MaxNum, char **list, char *filespec );
667 void ui_sort_filenames( int n, char **list );
668 
669 #endif
UI_GADGET * get_next()
Definition: gadget.cpp:295
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.
Definition: slider.cpp:24
void set_first_item(int _index)
Definition: listbox.cpp:481
void set_text(const char *in)
Definition: inputbox.cpp:490
int y
Definition: ui.h:165
void set_highlight_action(void(*_user_function)(void))
Definition: button.cpp:375
int enabled()
Definition: gadget.cpp:454
int just_pressed()
Definition: button.cpp:341
virtual void draw()
Definition: slider.cpp:232
void reset()
Definition: gadget.cpp:37
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
Definition: window.cpp:476
int button_hilighted()
Definition: button.cpp:387
virtual ~UI_GADGET()
Definition: gadget.cpp:25
void reset_status()
Definition: button.cpp:78
int y
Definition: ui.h:601
int pos
Definition: ui.h:493
int tt_group
Definition: ui.h:606
void set_button_hilighted()
Definition: button.cpp:393
int hotkey
Definition: ui.h:78
int base_start_x
Definition: ui.h:85
int x
Definition: ui.h:658
int get_current_hotspot()
Definition: window.cpp:290
virtual void process(int focus=0)
Definition: gadget.cpp:352
int is_mouse_on()
Definition: gadget.cpp:371
int base_start_y
Definition: ui.h:85
void release_bitmaps()
Definition: window.cpp:167
int moved
Definition: fredview.cpp:101
int ignore_gadgets
Definition: ui.h:607
int foreground_bmap_id
Definition: ui.h:614
int y
Definition: ui.h:658
int changed()
Definition: scroll.cpp:273
int mouse_captured(UI_GADGET *gadget=NULL)
Definition: gadget.cpp:234
int check_move()
Definition: gadget.cpp:510
UI_WINDOW * my_wnd
Definition: ui.h:111
char * bm_filename
Definition: ui.h:76
void check_focus_switch_keys()
Definition: window.cpp:461
int bmap_ids[MAX_BMAPS_PER_GADGET]
Definition: ui.h:118
void set_foreground_bmap(char *fname)
Definition: window.cpp:127
virtual void unhide()
Definition: gadget.cpp:217
void hide()
Definition: scroll.cpp:59
int double_clicked()
Definition: button.cpp:333
virtual void draw()
Definition: button.cpp:120
#define MAX_KEY_BUFFER
Definition: ui.h:31
UI_GADGET * children
Definition: ui.h:101
Definition: ui.h:61
Definition: 2d.h:95
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)
Definition: listbox.cpp:51
int flags
Definition: ui.h:600
void clear_focus()
Definition: gadget.cpp:328
void set_focus()
Definition: gadget.cpp:321
GLboolean GLuint group
Definition: Glext.h:10591
void base_create(UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h)
Definition: gadget.cpp:244
int changed()
Definition: radio.cpp:206
int pressed()
Definition: keytrap.cpp:50
void forceUp()
Definition: slider2.cpp:309
void set_callback(void(*_user_function)(void))
Definition: gadget.cpp:288
int h
Definition: ui.h:79
int checked()
Definition: checkbox.cpp:186
int changed()
Definition: inputbox.cpp:474
GLenum mode
Definition: Glext.h:5794
UI_GADGET * assoc
Definition: ui.h:168
Definition: ui.h:366
void set_ignore_gadgets(int state)
Definition: window.cpp:471
UI_WINDOW()
Definition: window.cpp:43
Definition: ui.h:195
int key
int font_id
Definition: ui.h:167
virtual void process(int focus=0)
Definition: slider.cpp:243
GLuint in
Definition: Glext.h:9087
int linked_to_hotspot
Definition: ui.h:89
UI_GADGET()
Definition: gadget.cpp:19
void do_dump_check()
Definition: window.cpp:668
void create(UI_WINDOW *wnd, int _x, int _y, int _h, int _start, int _stop, int _position, int _window_size)
Definition: scroll.cpp:73
void set_state(int _state)
Definition: checkbox.cpp:191
char * xstr
Definition: ui.h:163
UI_GADGET * prev
Definition: ui.h:102
void forceDown()
Definition: slider2.cpp:302
int get_currentPosition()
Definition: slider2.cpp:207
int ui_getfilelist(int MaxNum, char **list, char *filespec)
int hotspot_num
Definition: ui.h:90
int m_num_frames
Definition: ui.h:94
void draw_forced(int frame_num)
Definition: button.cpp:104
void ScrollEnd()
Definition: listbox.cpp:514
void destroy()
Definition: window.cpp:189
UI_GADGET * first_gadget
Definition: ui.h:609
void press_button()
Definition: button.cpp:399
void set_mask_bmap(char *fname)
Definition: window.cpp:75
void skip_first_highlight_callback()
Definition: button.cpp:414
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Definition: gadget.cpp:71
virtual void destroy()
Definition: gadget.cpp:160
int mask_w
Definition: ui.h:617
ubyte * mask_data
Definition: ui.h:616
int base_dragging
Definition: ui.h:83
void set_hotkey_if_focus(int key)
Definition: button.cpp:73
void set_numberItems(int _numberItems, int _reset=1)
Definition: slider2.cpp:217
void set_drawframe(int mode)
Definition: listbox.cpp:95
UI_GADGET * mouse_captured_gadget
Definition: ui.h:611
unsigned int uint
Definition: pstypes.h:64
void get_dimensions(int *_x, int *_y, int *_w, int *_h)
Definition: gadget.cpp:195
int get_currentItem()
Definition: slider2.cpp:212
void set_current(int _index)
Definition: listbox.cpp:476
int pressed()
Definition: inputbox.cpp:479
int mask_h
Definition: ui.h:617
int w
Definition: ui.h:79
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state, int _group)
Definition: radio.cpp:18
int disabled()
Definition: gadget.cpp:447
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _h, int _numberItems, char *_bitmapSliderControl, void(*_upCallback)(), void(*_downCallback)(), void(*_captureCallback)())
Definition: slider2.cpp:21
int y
Definition: ui.h:79
void link_hotspot(int up_button_num, int down_button_num)
Definition: scroll.cpp:23
int x
Definition: ui.h:79
#define MAX_UI_XSTRS
Definition: ui.h:171
int hotspot
Definition: ui.h:659
int pressed()
Definition: button.cpp:325
struct UI_XSTR UI_XSTR
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.
Definition: slider.cpp:162
void ui_sort_filenames(int n, char **list)
int base_drag_y
Definition: ui.h:84
UI_GADGET * next
Definition: ui.h:103
int w
Definition: ui.h:602
Definition: bmpman.h:101
char * get_string(int _index)
Definition: listbox.cpp:491
Definition: ui.h:428
~UI_WINDOW()
Definition: window.cpp:65
UI_BUTTON button
Definition: ui.h:660
int use_hack_to_get_around_stupid_problem_flag
Definition: ui.h:652
int h
Definition: ui.h:602
void remove_from_family()
Definition: gadget.cpp:549
#define MAX_BMAPS_PER_GADGET
Definition: ui.h:33
void RemoveFirstItem()
Definition: listbox.cpp:520
int add_string(char *str)
Definition: listbox.cpp:537
int get_numberItems()
Definition: slider2.cpp:202
void render_tooltip(char *str)
Definition: window.cpp:374
int uses_bmaps
Definition: ui.h:93
GLclampd n
Definition: Glext.h:7286
unsigned char ubyte
Definition: pstypes.h:62
int yt
Definition: ui.h:658
int mask_bmap_id
Definition: ui.h:613
void force_currentItem(int _currentItem)
Definition: slider2.cpp:279
int bmaps_used()
Definition: ui.h:146
int base_drag_x
Definition: ui.h:84
int is_mouse_on_children()
Definition: gadget.cpp:412
GLuint start
Definition: Gl.h:1502
void reset_timestamps()
Definition: button.cpp:408
UI_GADGET * get_prev()
Definition: gadget.cpp:308
int CurSize()
Definition: listbox.cpp:532
GLbitfield flags
Definition: Glext.h:6722
void set_hotkey(int keycode)
Definition: gadget.cpp:280
typedef void(APIENTRY *PFNGLARRAYELEMENTEXTPROC)(GLint i)
int get_hotspot()
Definition: gadget.cpp:29
void capture_mouse()
Definition: gadget.cpp:225
GLuint const GLchar * name
Definition: Glext.h:5608
int MaxSize()
Definition: listbox.cpp:527
int just_highlighted()
Definition: button.cpp:349
int hidden
Definition: ui.h:86
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _state)
Definition: checkbox.cpp:16
int disabled_flag
Definition: ui.h:82
void update_dimensions(int _x, int _y, int _w, int _h)
Definition: gadget.cpp:187
int set_bmaps(char *up_button_fname, char *down_button_fname, char *line_fname)
Definition: scroll.cpp:42
void set_parent(UI_GADGET *_parent)
Definition: gadget.cpp:580
GLuint GLuint num
Definition: Glext.h:9089
UI_GADGET * parent
Definition: ui.h:100
int sel_changed()
Definition: listbox.cpp:554
void link_hotspot(int num)
Definition: gadget.cpp:50
int xt
Definition: ui.h:658
uint last_tooltip_time
Definition: ui.h:605
ubyte * get_mask_data(int *w_md, int *h_md)
Definition: ui.h:643
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
Definition: button.cpp:26
int last_keypress
Definition: ui.h:650
ui_button_info(char *name, int x1, int y1, int xt1, int yt1, int h)
Definition: ui.h:662
void draw_one_xstr(UI_XSTR *xstr, int frame)
Definition: window.cpp:568
int button_down()
Definition: button.cpp:363
int m_flags
Definition: ui.h:80
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
Definition: window.cpp:140
int kind
Definition: ui.h:77
Definition: ui.h:584
int clr
Definition: ui.h:166
void set_invalid_chars(char *ichars)
Definition: inputbox.cpp:163
Definition: ui.h:162
void capture_mouse(UI_GADGET *gadget=NULL)
Definition: window.cpp:466
void enable(int n=1)
Definition: gadget.cpp:440
void set_currentItem(int _currentItem)
Definition: slider2.cpp:241
int set_bmaps(char *lbox_fname, char *b_up_fname, char *b_down_fname, char *sb_fname)
Definition: listbox.cpp:39
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)
Definition: inputbox.cpp:101
virtual void hide()
Definition: gadget.cpp:212
void start_drag_with_children()
Definition: gadget.cpp:476
void drag_with_children(int dx, int dy)
Definition: gadget.cpp:459
int has_focus()
Definition: gadget.cpp:334
void get_mouse_pos(int *xx, int *yy)
Definition: gadget.cpp:341
void stop_drag_with_children()
Definition: gadget.cpp:494
void draw_tooltip()
Definition: window.cpp:304
void clear_all_items()
Definition: listbox.cpp:496
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h)
Definition: icon.cpp:22
void draw_XSTR_forced(UI_GADGET *owner, int frame)
Definition: window.cpp:278
void create(UI_WINDOW *wnd, int key, void(*_user_function)(void))
Definition: keytrap.cpp:17
int selected()
Definition: listbox.cpp:462
char * filename
Definition: ui.h:657
GLenum GLuint GLenum GLsizei length
Definition: Glext.h:5156
int x
Definition: ui.h:165
void set_new_list(int _numitems, char **_list)
Definition: listbox.cpp:507
virtual void destroy()
Definition: slider.cpp:224
void get_text(char *out)
Definition: inputbox.cpp:484
Definition: ui.h:323
bitmap * mask_bmap_ptr
Definition: ui.h:615
void set_valid_chars(char *vchars)
Definition: inputbox.cpp:152
UI_XSTR * xstrs[MAX_UI_XSTRS]
Definition: ui.h:619
void unhide()
Definition: scroll.cpp:66
void(* user_function)(void)
Definition: ui.h:81
int ttx
Definition: ui.h:651
void set_disabled_action(void(*_user_function)(void))
Definition: button.cpp:380
int checked()
Definition: radio.cpp:211
virtual void process(int focus=0)
Definition: slider.cpp:93
void disable()
Definition: gadget.cpp:432
void draw()
Definition: window.cpp:220
struct ui_button_info ui_button_info
int getpos()
Definition: scroll.cpp:268
int last_tooltip_hotspot
Definition: ui.h:604
void link_hotspot(int up_button_num, int down_button_num)
Definition: listbox.cpp:26
int keypress
Definition: ui.h:622
int process(int key_in=-1, int process_mouse=1)
Definition: window.cpp:401
Definition: ui.h:251
Definition: ui.h:522
int f_id
Definition: ui.h:603
int current()
Definition: listbox.cpp:471
virtual void draw()
Definition: gadget.cpp:139
int x
Definition: ui.h:601
void repeatable(int yes)
Definition: button.cpp:420
virtual int is_hidden()
Definition: gadget.cpp:42
int tty
Definition: ui.h:651
virtual void draw()
Definition: slider.cpp:74
int changed()
Definition: checkbox.cpp:181
void draw_xstrs()
Definition: window.cpp:653
int toggled()
Definition: listbox.cpp:453
void set_custom_cursor_bmap(int bmap_id)
Definition: ui.h:248
int xstr_id
Definition: ui.h:164
UI_GADGET * selected_gadget
Definition: ui.h:610