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.

102 lines
2.8 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 TCluster */
  13. /* */
  14. /* Palette layout */
  15. /* 1 = Normal text */
  16. /* 2 = Selected text */
  17. /* 3 = Normal shortcut */
  18. /* 4 = Selected shortcut */
  19. /* ---------------------------------------------------------------------- */
  20. #if defined( Uses_TCluster ) && !defined( __TCluster )
  21. #define __TCluster
  22. class TRect;
  23. class TSItem;
  24. struct TEvent;
  25. class TPoint;
  26. class TStringCollection;
  27. class TCluster : public TView
  28. {
  29. public:
  30. TCluster( const TRect& bounds, TSItem *aStrings );
  31. ~TCluster();
  32. virtual uint32 dataSize();
  33. void drawBox( const char *icon, char marker );
  34. virtual void getData( void *rec );
  35. ushort getHelpCtx();
  36. virtual TPalette& getPalette() const;
  37. virtual void handleEvent( TEvent& event );
  38. virtual Boolean mark( int item );
  39. virtual void press( int item );
  40. virtual void movedTo( int item );
  41. virtual void setData( void *rec );
  42. virtual void setState( ushort aState, Boolean enable );
  43. // SET: see tcluster.cc for more information
  44. unsigned getExtraOptions() { return extraOptions; }
  45. void setExtraOptions(unsigned ops) { extraOptions=ops; }
  46. // SET: for i18n support
  47. const char *getItemText( ccIndex item );
  48. protected:
  49. static unsigned extraOptions;
  50. uint32 value;
  51. int sel;
  52. // SET: i18n cache
  53. TStringCollection *intlStrings;
  54. TStringCollection *strings;
  55. private:
  56. int column( int item );
  57. int findSel( TPoint p );
  58. int row( int item );
  59. #if !defined( NO_STREAM )
  60. virtual const char *streamableName() const
  61. { return name; }
  62. protected:
  63. TCluster( StreamableInit );
  64. virtual void write( opstream& );
  65. virtual void *read( ipstream& );
  66. public:
  67. static const char * const name;
  68. static TStreamable *build();
  69. #endif
  70. };
  71. #if !defined( NO_STREAM )
  72. inline ipstream& operator >> ( ipstream& is, TCluster& cl )
  73. { return is >> (TStreamable&)cl; }
  74. inline ipstream& operator >> ( ipstream& is, TCluster*& cl )
  75. { return is >> (void *&)cl; }
  76. inline opstream& operator << ( opstream& os, TCluster& cl )
  77. { return os << (TStreamable&)cl; }
  78. inline opstream& operator << ( opstream& os, TCluster* cl )
  79. { return os << (TStreamable *)cl; }
  80. #endif // NO_STREAM
  81. #endif // Uses_TCluster