You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.5 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. *
  9. *
  10. */
  11. /* ---------------------------------------------------------------------- */
  12. /* class TScrollBar */
  13. /* */
  14. /* Palette layout */
  15. /* 1 = Page areas */
  16. /* 2 = Arrows */
  17. /* 3 = Indicator */
  18. /* ---------------------------------------------------------------------- */
  19. #if defined( Uses_TScrollBar ) && !defined( __TScrollBar )
  20. #define __TScrollBar
  21. class TRect;
  22. struct TEvent;
  23. typedef char TScrollChars[5];
  24. class TScrollBar : public TView
  25. {
  26. public:
  27. TScrollBar( const TRect& bounds );
  28. virtual void draw();
  29. virtual TPalette& getPalette() const;
  30. virtual void handleEvent( TEvent& event );
  31. virtual void scrollDraw();
  32. virtual int scrollStep( int part );
  33. void setParams( int32 aValue, int32 aMin, int32 aMax,
  34. int aPgStep, int aArStep );
  35. void setRange( int32 aMin, int32 aMax );
  36. void setStep( int aPgStep, int aArStep );
  37. void setValue( int32 aValue );
  38. void drawPos( int pos );
  39. int32 getPos();
  40. int getSize();
  41. int32 value;
  42. TScrollChars chars;
  43. int32 minVal;
  44. int32 maxVal;
  45. int pgStep;
  46. int arStep;
  47. static TScrollChars vChars;
  48. static TScrollChars hChars;
  49. static TScrollChars ovChars;
  50. static TScrollChars ohChars;
  51. private:
  52. int getPartCode(void);
  53. #if !defined( NO_STREAM )
  54. virtual const char *streamableName() const
  55. { return name; }
  56. protected:
  57. TScrollBar( StreamableInit );
  58. virtual void write( opstream& );
  59. virtual void *read( ipstream& );
  60. public:
  61. static const char * const name;
  62. static TStreamable *build();
  63. #endif // NO_STREAM
  64. };
  65. #if !defined( NO_STREAM )
  66. inline ipstream& operator >> ( ipstream& is, TScrollBar& cl )
  67. { return is >> (TStreamable&)cl; }
  68. inline ipstream& operator >> ( ipstream& is, TScrollBar*& cl )
  69. { return is >> (void *&)cl; }
  70. inline opstream& operator << ( opstream& os, TScrollBar& cl )
  71. { return os << (TStreamable&)cl; }
  72. inline opstream& operator << ( opstream& os, TScrollBar* cl )
  73. { return os << (TStreamable *)cl; }
  74. #endif // NO_STREAM
  75. #endif // Uses_TScrollBar