4 #include "bcbitmap.inc"
5 #include "bcsubwindow.h"
9 class BC_PercentageSlider
;
11 class BC_Slider
: public BC_SubWindow
17 int pointer_motion_range
,
24 friend class BC_ISlider
;
25 friend class BC_FSlider
;
26 friend class BC_PercentageSlider
;
28 virtual int handle_event() { return 0; };
31 static int get_span(int vertical
);
32 int get_button_pixels();
33 virtual int value_to_pixel() { return 0; };
35 int cursor_enter_event();
36 int cursor_leave_event();
37 int button_press_event();
38 virtual int button_release_event();
39 int get_pointer_motion_range();
40 int cursor_motion_event();
41 int repeat_event(int64_t repeat_id
);
42 int reposition_window(int x
, int y
, int w
= -1, int h
= -1);
45 virtual int increase_value() { return 0; };
46 virtual int decrease_value() { return 0; };
47 virtual int increase_value_big() { return 0; };
48 virtual int decrease_value_big() { return 0; };
49 virtual char* get_caption() { return caption
; };
56 #define SLIDER_BG_UP 0
57 #define SLIDER_BG_HI 1
58 #define SLIDER_BG_DN 2
59 #define SLIDER_IMAGES 6
61 virtual int init_selection(int cursor_x
, int cursor_y
) { return 0; };
62 virtual int update_selection(int cursor_x
, int cursor_y
) { return 0; };
63 int set_images(VFrame
**images
);
65 void show_value_tooltip();
69 int show_number
, vertical
, pointer_motion_range
, pixels
;
70 int keypress_tooltip_timer
;
74 int min_pixel
, max_pixel
;
75 int text_line
, text_height
;
77 char caption
[BCTEXTLEN
];
78 char temp_tooltip_text
[BCTEXTLEN
];
84 class BC_ISlider
: public BC_Slider
91 int pointer_motion_range
,
99 int update(int64_t value
);
100 int update(int pointer_motion_range
, int64_t value
, int64_t minvalue
, int64_t maxvalue
);
102 int64_t get_length();
103 int increase_value();
104 int decrease_value();
105 int increase_value_big();
106 int decrease_value_big();
107 virtual int handle_event();
108 virtual char* get_caption();
111 int value_to_pixel();
112 int init_selection(int cursor_x
, int cursor_y
);
113 int update_selection(int cursor_x
, int cursor_y
);
114 int64_t minvalue
, maxvalue
, value
;
118 class BC_FSlider
: public BC_Slider
125 int pointer_motion_range
,
132 friend class BC_PercentageSlider
;
134 int update(float value
);
135 int update(int pointer_motion_range
, float value
, float minvalue
, float maxvalue
);
138 virtual int increase_value();
139 virtual int decrease_value();
140 virtual int increase_value_big();
141 virtual int decrease_value_big();
142 virtual char* get_caption();
143 void set_precision(float value
);
144 void set_pagination(float small_change
, float big_change
);
147 int value_to_pixel();
148 int init_selection(int cursor_x
, int cursor_y
);
149 int update_selection(int cursor_x
, int cursor_y
);
150 float minvalue
, maxvalue
, value
;
152 float small_change
, big_change
;
155 class BC_PercentageSlider
: public BC_FSlider
158 BC_PercentageSlider(int x
,
162 int pointer_motion_range
,