home *** CD-ROM | disk | FTP | other *** search
/ Geek 6 / Geek-006.iso / linux / video / xmovie-1.5.3.tar.gz / xmovie-1.5.3.tar / xmovie-1.5.3 / guicast / bcscrollbar.h < prev    next >
C/C++ Source or Header  |  2000-11-29  |  1KB  |  69 lines

  1. #ifndef BCSCROLLBAR_H
  2. #define BCSCROLLBAR_H
  3.  
  4. #include "bclistbox.inc"
  5. #include "bcsubwindow.h"
  6.  
  7. // Orientations
  8. #define SCROLL_HORIZ 0
  9. #define SCROLL_VERT  1
  10.  
  11. #define SCROLL_HANDLE 1
  12. #define SCROLL_BACKPAGE 2
  13. #define SCROLL_FWDPAGE 3
  14. #define SCROLL_BACKARROW 4
  15. #define SCROLL_FWDARROW 5
  16.  
  17. #define SCROLL_SPAN 17
  18. #define SCROLL_MARGIN 2
  19. #define MINHANDLE 10
  20.  
  21. class BC_ScrollBar : public BC_SubWindow
  22. {
  23. public:
  24.     BC_ScrollBar(int x, 
  25.         int y, 
  26.         int orientation, 
  27.         int pixels, 
  28.         long length, 
  29.         long position, 
  30.         long handlelength);
  31.     virtual ~BC_ScrollBar();
  32.  
  33.     friend BC_ListBox;
  34.  
  35.     virtual int handle_event() { return 0; };
  36.     int initialize();
  37.     int cursor_motion_event();
  38.     int cursor_leave_event();
  39.     int cursor_enter_event();
  40.     int button_press_event();
  41.     int button_release_event();
  42.     int repeat_event(long repeat_id);
  43.     long get_value();
  44.     long get_position();
  45.     long get_length();
  46.     long get_handlelength();
  47.     int in_use();
  48.     int update_value(long value);
  49.     int update_length(long length, long position, long handlelength);
  50.     int reposition_window(int x, int y, int w = -1, int h = -1);
  51.  
  52. private:
  53.     int activate();
  54.     void draw();
  55.     void get_handle_dimensions();
  56.     int get_cursor_zone(int cursor_x, int cursor_y);
  57.  
  58.     long length, position, handlelength;   // handle position and size
  59.     int selection_status, highlight_status;
  60.     int orientation, pixels;
  61.     int handle_pixel, handle_pixels;
  62.     int min_pixel, max_pixel;
  63.     long repeat_count;
  64. // Don't deactivate if bound to another tool
  65.     BC_WindowBase *bound_to;
  66. };
  67.  
  68. #endif
  69.