r1007: Make configure detect and work on amd64.
[cinelerra_cv/mob.git] / guicast / bcscrollbar.h
blob56964f4a1f3510f3aeb378bd7b8ce2f4412f91d5
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
39 class BC_ScrollBar : public BC_SubWindow
41 public:
42 BC_ScrollBar(int x,
43 int y,
44 int orientation,
45 int pixels,
46 int64_t length,
47 int64_t position,
48 int64_t handlelength,
49 VFrame **data = 0);
50 virtual ~BC_ScrollBar();
52 friend class BC_ListBox;
54 virtual int handle_event() { return 0; };
55 int initialize();
56 int cursor_motion_event();
57 int cursor_leave_event();
58 int cursor_enter_event();
59 int button_press_event();
60 int button_release_event();
61 int repeat_event(int64_t repeat_id);
62 int64_t get_value();
63 int64_t get_position();
64 int64_t get_length();
65 int64_t get_handlelength();
66 int get_pixels();
67 void set_images(VFrame **data);
68 int in_use();
69 int update_value(int64_t value);
70 int update_length(int64_t length, int64_t position, int64_t handlelength);
71 int reposition_window(int x, int y, int pixels);
72 int get_span();
73 static int get_span(int orientation);
74 int get_arrow_pixels();
76 private:
77 void calculate_dimensions(int &w, int &h);
78 int activate();
79 void draw();
80 void get_handle_dimensions();
81 int get_cursor_zone(int cursor_x, int cursor_y);
83 int64_t length, position, handlelength; // handle position and size
84 int selection_status, highlight_status;
85 int orientation, pixels;
86 int handle_pixel, handle_pixels;
87 int min_pixel, max_pixel;
88 int64_t repeat_count;
89 // Don't deactivate if bound to another tool
90 BC_WindowBase *bound_to;
91 VFrame **data;
92 BC_Pixmap *images[SCROLL_IMAGES];
103 #endif