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.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. #if defined( Uses_TListViewer ) && !defined( __TListViewer )
  12. #define __TListViewer
  13. class TRect;
  14. class TScrollBar;
  15. struct TEvent;
  16. class TListViewer : public TView
  17. {
  18. public:
  19. TListViewer( const TRect& bounds,
  20. ushort aNumCols,
  21. TScrollBar *aHScrollBar,
  22. TScrollBar *aVScrollBar
  23. );
  24. virtual void changeBounds( const TRect& bounds );
  25. virtual void draw();
  26. virtual void focusItem( ccIndex item );
  27. virtual TPalette& getPalette() const;
  28. virtual void getText( char *dest, ccIndex item, short maxLen );
  29. virtual Boolean isSelected( ccIndex item );
  30. virtual void handleEvent( TEvent& event );
  31. virtual void selectItem( ccIndex item );
  32. void setRange( ccIndex aRange );
  33. virtual void setState( ushort aState, Boolean enable );
  34. virtual void focusItemNum( ccIndex item );
  35. virtual void shutDown();
  36. TScrollBar *hScrollBar;
  37. TScrollBar *vScrollBar;
  38. short numCols;
  39. ccIndex topItem;
  40. ccIndex focused;
  41. ccIndex range;
  42. Boolean handleSpace;
  43. static uchar columnSeparator;
  44. static uchar ocolumnSeparator;
  45. // SET: see tlistvie.cc for more information
  46. unsigned getExtraOptions() { return extraOptions; }
  47. void setExtraOptions(unsigned ops) { extraOptions=ops; }
  48. protected:
  49. // SET: extra options ored by default to all objects of this class.
  50. static unsigned extraOptions;
  51. // SET: neede to change the scroll bars too.
  52. void setNumCols(int aNumCols);
  53. #if !defined( NO_STREAM )
  54. private:
  55. virtual const char *streamableName() const
  56. { return name; }
  57. protected:
  58. TListViewer( StreamableInit );
  59. virtual void write( opstream& );
  60. virtual void *read( ipstream& );
  61. public:
  62. static const char * const name;
  63. static TStreamable *build();
  64. #endif // NO_STREAM
  65. };
  66. #if !defined( NO_STREAM )
  67. inline ipstream& operator >> ( ipstream& is, TListViewer& cl )
  68. { return is >> (TStreamable&)cl; }
  69. inline ipstream& operator >> ( ipstream& is, TListViewer*& cl )
  70. { return is >> (void *&)cl; }
  71. inline opstream& operator << ( opstream& os, TListViewer& cl )
  72. { return os << (TStreamable&)cl; }
  73. inline opstream& operator << ( opstream& os, TListViewer* cl )
  74. { return os << (TStreamable *)cl; }
  75. #endif // NO_STREAM
  76. #endif // Uses_TListViewer