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 char* get_caption() { return caption
; };
54 #define SLIDER_BG_UP 0
55 #define SLIDER_BG_HI 1
56 #define SLIDER_BG_DN 2
57 #define SLIDER_IMAGES 6
59 virtual int init_selection(int cursor_x
, int cursor_y
) { return 0; };
60 virtual int update_selection(int cursor_x
, int cursor_y
) { return 0; };
61 int set_images(VFrame
**images
);
63 void show_value_tooltip();
67 int show_number
, vertical
, pointer_motion_range
, pixels
;
68 int keypress_tooltip_timer
;
72 int min_pixel
, max_pixel
;
73 int text_line
, text_height
;
75 char caption
[BCTEXTLEN
];
76 char temp_tooltip_text
[BCTEXTLEN
];
82 class BC_ISlider
: public BC_Slider
89 int pointer_motion_range
,
97 int update(int64_t value
);
98 int update(int pointer_motion_range
, int64_t value
, int64_t minvalue
, int64_t maxvalue
);
100 int64_t get_length();
101 int increase_value();
102 int decrease_value();
103 virtual int handle_event();
104 virtual char* get_caption();
107 int value_to_pixel();
108 int init_selection(int cursor_x
, int cursor_y
);
109 int update_selection(int cursor_x
, int cursor_y
);
110 int64_t minvalue
, maxvalue
, value
;
114 class BC_FSlider
: public BC_Slider
121 int pointer_motion_range
,
128 friend class BC_PercentageSlider
;
130 int update(float value
);
131 int update(int pointer_motion_range
, float value
, float minvalue
, float maxvalue
);
134 virtual int increase_value();
135 virtual int decrease_value();
136 virtual char* get_caption();
137 void set_precision(float value
);
140 int value_to_pixel();
141 int init_selection(int cursor_x
, int cursor_y
);
142 int update_selection(int cursor_x
, int cursor_y
);
143 float minvalue
, maxvalue
, value
;
147 class BC_PercentageSlider
: public BC_FSlider
150 BC_PercentageSlider(int x
,
154 int pointer_motion_range
,
161 virtual int increase_value();
162 virtual int decrease_value();