51 ((
UI_GADGET*)
this)->set_bmaps(line_fname);
81 up_button.
create( wnd, up, _x, _y, bw, bw, 1 );
85 down_button.
create( wnd, down, _x, _y + _h - bw, bw, bw, 1 );
93 window_size = _window_size;
100 bar_size = (window_size *
h) / (stop -
start + window_size + 1);
107 bar_position = position -
start;
108 bar_position *=
h - bar_size;
109 bar_position /= stop - start;
116 void UI_SCROLLBAR::draw()
123 if (
bmap_ids[SB_DISABLED] != -1 ) {
152 void UI_SCROLLBAR::process(
int focus)
165 up_button.process(focus);
166 down_button.process(focus);
178 if (position <
start)
181 bar_position = position -
start;
182 bar_position *=
h - bar_size;
183 bar_position /= stop - start;
192 bar_position = position -
start;
193 bar_position *=
h - bar_size;
194 bar_position /= stop - start;
211 drag_starting = bar_position;
220 position -= window_size;
221 if (position <
start)
226 position += window_size;
231 bar_position = position -
start;
232 bar_position *=
h - bar_size;
233 bar_position /= stop - start;
238 bar_position = drag_starting +
ui_mouse.
y - drag_y;
240 if (bar_position < 0) {
244 if (bar_position >
h - bar_size) {
245 bar_position =
h - bar_size;
248 position = bar_position;
249 position *= stop -
start;
250 position /=
h - bar_size;
256 if (position < start)
GLfloat GLfloat GLfloat GLfloat h
int bmap_ids[MAX_BMAPS_PER_GADGET]
void base_create(UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h)
void gr_set_color_fast(color *dst)
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)
void create(UI_WINDOW *wnd, int _x, int _y, int _h, int _start, int _stop, int _position, int _window_size)
__inline void gr_set_clip(int x, int y, int w, int h, int resize_mode=GR_RESIZE_FULL)
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void set_hotkey_if_focus(int key)
void get_dimensions(int *_x, int *_y, int *_w, int *_h)
void link_hotspot(int up_button_num, int down_button_num)
#define UI_KIND_SCROLLBAR
GLint GLint GLint GLint GLint x
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)
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
void ui_rect(int x1, int y1, int x2, int y2)
void gr_bitmap(int _x, int _y, int resize_mode)
void gr_set_font(int fontnum)
int timer_get_milliseconds()
UI_GADGET * selected_gadget