r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / guicast / bcscrollbar.h
blob3283cab4d0fbe2f295615a00c712764ce447602c
1 #ifndef BCSCROLLBAR_H
2 #define BCSCROLLBAR_H
4 #include "bclistbox.inc"
5 #include "bcsubwindow.h"
7 // Orientations
8 #define SCROLL_HORIZ 0
9 #define SCROLL_VERT 1
11 // Selection identifiers
12 #define SCROLL_HANDLE 1
13 #define SCROLL_BACKPAGE 2
14 #define SCROLL_FWDPAGE 3
15 #define SCROLL_BACKARROW 4
16 #define SCROLL_FWDARROW 5
18 // Image identifiers
19 #define SCROLL_HANDLE_UP 0
20 #define SCROLL_HANDLE_HI 1
21 #define SCROLL_HANDLE_DN 2
22 #define SCROLL_HANDLE_BG 3
23 #define SCROLL_BACKARROW_UP 4
24 #define SCROLL_BACKARROW_HI 5
25 #define SCROLL_BACKARROW_DN 6
26 #define SCROLL_FWDARROW_UP 7
27 #define SCROLL_FWDARROW_HI 8
28 #define SCROLL_FWDARROW_DN 9
29 #define SCROLL_IMAGES 10
38 #define MINHANDLE 10
40 class BC_ScrollBar : public BC_SubWindow
42 public:
43 BC_ScrollBar(int x,
44 int y,
45 int orientation,
46 int pixels,
47 int64_t length,
48 int64_t position,
49 int64_t handlelength,
50 VFrame **data = 0);
51 virtual ~BC_ScrollBar();
53 friend class BC_ListBox;
55 virtual int handle_event() { return 0; };
56 int initialize();
57 int cursor_motion_event();
58 int cursor_leave_event();
59 int cursor_enter_event();
60 int button_press_event();
61 int button_release_event();
62 int repeat_event(int64_t repeat_id);
63 int64_t get_value();
64 int64_t get_position();
65 int64_t get_length();
66 int64_t get_handlelength();
67 int get_pixels();
68 void set_images(VFrame **data);
69 int in_use();
70 int update_value(int64_t value);
71 int update_length(int64_t length, int64_t position, int64_t handlelength);
72 int reposition_window(int x, int y, int pixels);
73 int get_span();
74 static int get_span(int orientation);
75 int get_arrow_pixels();
77 private:
78 void calculate_dimensions(int &w, int &h);
79 int activate();
80 void draw();
81 void get_handle_dimensions();
82 int get_cursor_zone(int cursor_x, int cursor_y);
84 int64_t length, position, handlelength; // handle position and size
85 int selection_status, highlight_status;
86 int orientation, pixels;
87 int handle_pixel, handle_pixels;
88 int min_pixel, max_pixel;
89 int64_t repeat_count;
90 // Don't deactivate if bound to another tool
91 BC_WindowBase *bound_to;
92 VFrame **data;
93 BC_Pixmap *images[SCROLL_IMAGES];
104 #endif