home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / SCROLBAR.H < prev    next >
C/C++ Source or Header  |  1993-09-14  |  1KB  |  42 lines

  1. // -------- scrolbar.h 
  2.  
  3. #ifndef SCROLBAR_H
  4. #define SCROLBAR_H
  5.  
  6. #include "dfwindow.h"
  7.  
  8. class TextBox;
  9.  
  10. /* ------------- scroll bar characters ------------ */
  11. const unsigned char UPSCROLLBOX    = '\x1e';
  12. const unsigned char DOWNSCROLLBOX  = '\x1f';
  13. const unsigned char LEFTSCROLLBOX  = '\x11';
  14. const unsigned char RIGHTSCROLLBOX = '\x10';
  15. const unsigned char SCROLLBARCHAR  = 176 ;
  16. const unsigned char SCROLLBOXCHAR  = 178;
  17.  
  18. enum BarPlane { HORIZONTAL, VERTICAL };
  19.  
  20. class ScrollBar : public DFWindow    {
  21.     int scrollbox;            // position of scroll box
  22.     Bool sliding;            // True while siding the scroll box
  23.     BarPlane plane;            // HORIZONTAL or VERTICAL
  24.     void ParentSized(int xdif, int ydif);
  25. protected:
  26. public:
  27.     ScrollBar(BarPlane Plane, TextBox *par);
  28.     // -------- ScrollBar API messages
  29.     void Paint();
  30.     Bool SetFocus();
  31.     void LeftButton(int mx, int my);
  32.     void MouseMoved(int mx, int my);
  33.     void ButtonReleased(int mx, int my);
  34.     void TextPosition(int TxPct);
  35.     void MoveScrollBox(int sb);
  36. };
  37.  
  38. #endif
  39.  
  40.  
  41.  
  42.