r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / guicast / bcslider.h
blob42031e157905aec4c9526bf5d48d6d8adda5b243
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 int get_button_pixels();
32 virtual int value_to_pixel() { return 0; };
33 int keypress_event();
34 int cursor_enter_event();
35 int cursor_leave_event();
36 int button_press_event();
37 int button_release_event();
38 int get_pointer_motion_range();
39 int cursor_motion_event();
40 int repeat_event(int64_t repeat_id);
41 int reposition_window(int x, int y, int w = -1, int h = -1);
42 int activate();
43 int deactivate();
44 virtual int increase_value() { return 0; };
45 virtual int decrease_value() { return 0; };
46 virtual char* get_caption() { return caption; };
48 private:
50 #define SLIDER_UP 0
51 #define SLIDER_HI 1
52 #define SLIDER_DN 2
53 #define SLIDER_BG_UP 0
54 #define SLIDER_BG_HI 1
55 #define SLIDER_BG_DN 2
56 #define SLIDER_IMAGES 6
58 virtual int init_selection(int cursor_x, int cursor_y) { return 0; };
59 virtual int update_selection(int cursor_x, int cursor_y) { return 0; };
60 int set_images(VFrame **images);
61 int draw_face();
62 void show_value_tooltip();
64 VFrame **images;
65 BC_Pixmap **pixmaps;
66 int show_number, vertical, pointer_motion_range, pixels;
67 int keypress_tooltip_timer;
68 int button_pixel;
69 int status;
70 int button_down;
71 int min_pixel, max_pixel;
72 int text_line, text_height;
73 int use_caption;
74 char caption[BCTEXTLEN];
75 char temp_tooltip_text[BCTEXTLEN];
76 int active;
77 int enabled;
81 class BC_ISlider : public BC_Slider
83 public:
84 BC_ISlider(int x,
85 int y,
86 int vertical,
87 int pixels,
88 int pointer_motion_range,
89 int64_t minvalue,
90 int64_t maxvalue,
91 int64_t value,
92 int use_caption = 0,
93 VFrame **data = 0,
94 int *output = 0);
96 int update(int64_t value);
97 int update(int pointer_motion_range, int64_t value, int64_t minvalue, int64_t maxvalue);
98 int64_t get_value();
99 int64_t get_length();
100 int increase_value();
101 int decrease_value();
102 virtual int handle_event();
103 char* get_caption();
105 private:
106 int value_to_pixel();
107 int init_selection(int cursor_x, int cursor_y);
108 int update_selection(int cursor_x, int cursor_y);
109 int64_t minvalue, maxvalue, value;
110 int *output;
113 class BC_FSlider : public BC_Slider
115 public:
116 BC_FSlider(int x,
117 int y,
118 int vertical,
119 int pixels,
120 int pointer_motion_range,
121 float minvalue,
122 float maxvalue,
123 float value,
124 int use_caption = 0,
125 VFrame **data = 0);
127 friend class BC_PercentageSlider;
129 int update(float value);
130 int update(int pointer_motion_range, float value, float minvalue, float maxvalue);
131 float get_value();
132 float get_length();
133 virtual int increase_value();
134 virtual int decrease_value();
135 virtual char* get_caption();
136 void set_precision(float value);
138 private:
139 int value_to_pixel();
140 int init_selection(int cursor_x, int cursor_y);
141 int update_selection(int cursor_x, int cursor_y);
142 float minvalue, maxvalue, value;
143 float precision;
146 class BC_PercentageSlider : public BC_FSlider
148 public:
149 BC_PercentageSlider(int x,
150 int y,
151 int vertical,
152 int pixels,
153 int pointer_motion_range,
154 float minvalue,
155 float maxvalue,
156 float value,
157 int use_caption = 0,
158 VFrame **data = 0);
160 virtual int increase_value();
161 virtual int decrease_value();
162 char* get_caption();
163 private:
167 #endif