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
39 class BC_ScrollBar
: public BC_SubWindow
50 virtual ~BC_ScrollBar();
52 friend class BC_ListBox
;
54 virtual int handle_event() { return 0; };
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
);
63 int64_t get_position();
65 int64_t get_handlelength();
67 void set_images(VFrame
**data
);
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
);
73 static int get_span(int orientation
);
74 int get_arrow_pixels();
77 void calculate_dimensions(int &w
, int &h
);
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
;
89 // Don't deactivate if bound to another tool
90 BC_WindowBase
*bound_to
;
92 BC_Pixmap
*images
[SCROLL_IMAGES
];