4 #include "bclistbox.inc"
5 #include "bcsubwindow.h"
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
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
40 class BC_ScrollBar
: public BC_SubWindow
51 virtual ~BC_ScrollBar();
53 friend class BC_ListBox
;
55 virtual int handle_event() { return 0; };
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
);
64 int64_t get_position();
66 int64_t get_handlelength();
68 void set_images(VFrame
**data
);
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
);
74 static int get_span(int orientation
);
75 int get_arrow_pixels();
78 void calculate_dimensions(int &w
, int &h
);
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
;
90 // Don't deactivate if bound to another tool
91 BC_WindowBase
*bound_to
;
93 BC_Pixmap
*images
[SCROLL_IMAGES
];