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.

95 lines
2.4 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 TScroller */
  13. /* */
  14. /* Palette layout */
  15. /* 1 = Normal text */
  16. /* 2 = Selected text */
  17. /* ---------------------------------------------------------------------- */
  18. #if defined( Uses_TScroller ) && !defined( __TScroller )
  19. #define __TScroller
  20. class TRect;
  21. class TScrollBar;
  22. struct TEvent;
  23. class TScroller : public TView
  24. {
  25. public:
  26. TScroller( const TRect& bounds,
  27. TScrollBar *aHScrollBar,
  28. TScrollBar *aVScrollBar
  29. );
  30. virtual void changeBounds( const TRect& bounds );
  31. virtual TPalette& getPalette() const;
  32. virtual void handleEvent( TEvent& event );
  33. virtual void scrollDraw();
  34. void scrollTo( int32 x, int32 y );
  35. void setLimit( int32 x, int32 y );
  36. virtual void setState( ushort aState, Boolean enable );
  37. void checkDraw();
  38. virtual void shutDown();
  39. // How many lines we will scroll when the mouse wheel is used.
  40. static int defaultWheelStep;
  41. int wheelStep;
  42. protected:
  43. uchar drawLock;
  44. Boolean drawFlag;
  45. TScrollBar *hScrollBar;
  46. TScrollBar *vScrollBar;
  47. TPoint delta;
  48. TPoint limit;
  49. private:
  50. void showSBar( TScrollBar *sBar );
  51. #if !defined( NO_STREAM )
  52. virtual const char *streamableName() const
  53. { return name; }
  54. protected:
  55. TScroller( StreamableInit );
  56. virtual void write( opstream& );
  57. virtual void *read( ipstream& );
  58. public:
  59. static const char * const name;
  60. static TStreamable *build();
  61. #endif // NO_STREAM
  62. };
  63. #if !defined( NO_STREAM )
  64. inline ipstream& operator >> ( ipstream& is, TScroller& cl )
  65. { return is >> (TStreamable&)cl; }
  66. inline ipstream& operator >> ( ipstream& is, TScroller*& cl )
  67. { return is >> (void *&)cl; }
  68. inline opstream& operator << ( opstream& os, TScroller& cl )
  69. { return os << (TStreamable&)cl; }
  70. inline opstream& operator << ( opstream& os, TScroller* cl )
  71. { return os << (TStreamable *)cl; }
  72. #endif // NO_STREAM
  73. #endif // Uses_TScroller