r1005: Increase the number of displayed digits for resample audio dialog box
[cinelerra_cv/mob.git] / guicast / bcslider.h
blob5f761da3d6329b1587792d77b0147f1f7c7478c7
1 #ifndef BCSLIDER_H
2 #define BCSLIDER_H
4 #include "bcbitmap.inc"
5 #include "bcsubwindow.h"
7 class BC_ISlider;
8 class BC_FSlider;
9 class BC_PercentageSlider;
11 class BC_Slider : public BC_SubWindow
13 public:
14 BC_Slider(int x,
15 int y,
16 int pixels,
17 int pointer_motion_range,
18 VFrame **images,
19 int show_number,
20 int vertical,
21 int use_caption);
22 virtual ~BC_Slider();
24 friend class BC_ISlider;
25 friend class BC_FSlider;
26 friend class BC_PercentageSlider;
28 virtual int handle_event() { return 0; };
30 int initialize();
31 static int get_span(int vertical);
32 int get_button_pixels();
33 virtual int value_to_pixel() { return 0; };
34 int keypress_event();
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);
43 int activate();
44 int deactivate();
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; };
51 private:
53 #define SLIDER_UP 0
54 #define SLIDER_HI 1
55 #define SLIDER_DN 2
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);
64 int draw_face();
65 void show_value_tooltip();
67 VFrame **images;
68 BC_Pixmap **pixmaps;
69 int show_number, vertical, pointer_motion_range, pixels;
70 int keypress_tooltip_timer;
71 int button_pixel;
72 int status;
73 int button_down;
74 int min_pixel, max_pixel;
75 int text_line, text_height;
76 int use_caption;
77 char caption[BCTEXTLEN];
78 char temp_tooltip_text[BCTEXTLEN];
79 int active;
80 int enabled;
84 class BC_ISlider : public BC_Slider
86 public:
87 BC_ISlider(int x,
88 int y,
89 int vertical,
90 int pixels,
91 int pointer_motion_range,
92 int64_t minvalue,
93 int64_t maxvalue,
94 int64_t value,
95 int use_caption = 0,
96 VFrame **data = 0,
97 int *output = 0);
99 int update(int64_t value);
100 int update(int pointer_motion_range, int64_t value, int64_t minvalue, int64_t maxvalue);
101 int64_t get_value();
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();
110 private:
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;
115 int *output;
118 class BC_FSlider : public BC_Slider
120 public:
121 BC_FSlider(int x,
122 int y,
123 int vertical,
124 int pixels,
125 int pointer_motion_range,
126 float minvalue,
127 float maxvalue,
128 float value,
129 int use_caption = 0,
130 VFrame **data = 0);
132 friend class BC_PercentageSlider;
134 int update(float value);
135 int update(int pointer_motion_range, float value, float minvalue, float maxvalue);
136 float get_value();
137 float get_length();
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);
146 private:
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;
151 float precision;
152 float small_change, big_change;
155 class BC_PercentageSlider : public BC_FSlider
157 public:
158 BC_PercentageSlider(int x,
159 int y,
160 int vertical,
161 int pixels,
162 int pointer_motion_range,
163 float minvalue,
164 float maxvalue,
165 float value,
166 int use_caption = 0,
167 VFrame **data = 0);
169 char* get_caption();
170 private:
174 #endif