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.

103 lines
2.9 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 TStatusLine */
  13. /* */
  14. /* Palette layout */
  15. /* 1 = Normal text */
  16. /* 2 = Disabled text */
  17. /* 3 = Shortcut text */
  18. /* 4 = Normal selection */
  19. /* 5 = Disabled selection */
  20. /* 6 = Shortcut selection */
  21. /* ---------------------------------------------------------------------- */
  22. #if defined( Uses_TStatusLine ) && !defined( __TStatusLine )
  23. #define __TStatusLine
  24. class TRect;
  25. struct TEvent;
  26. class TPoint;
  27. class TStatusLine : public TView
  28. {
  29. public:
  30. TStatusLine( const TRect& bounds, TStatusDef& aDefs );
  31. ~TStatusLine();
  32. virtual void draw();
  33. virtual TPalette& getPalette() const;
  34. virtual void handleEvent( TEvent& event );
  35. virtual const char* hint( ushort aHelpCtx );
  36. void update();
  37. void computeLength(); // SET: see compactStatus
  38. virtual void changeBounds(const TRect& bounds);
  39. static char hintSeparator[];
  40. static char ohintSeparator[];
  41. // SET: Look the comments in TMenuView, same purpose
  42. int compactStatus;
  43. protected:
  44. TStatusItem *items;
  45. TStatusDef *defs;
  46. private:
  47. void drawSelect( TStatusItem *selected );
  48. void findItems();
  49. TStatusItem *itemMouseIsIn( TPoint );
  50. void disposeItems( TStatusItem *item );
  51. #if !defined( NO_STREAM )
  52. virtual const char *streamableName() const
  53. { return name; }
  54. static void writeItems( opstream&, TStatusItem * );
  55. static void writeDefs( opstream&, TStatusDef * );
  56. static TStatusItem *readItems( ipstream& );
  57. static TStatusDef *readDefs( ipstream& );
  58. protected:
  59. TStatusLine( StreamableInit );
  60. virtual void write( opstream& );
  61. virtual void *read( ipstream& );
  62. public:
  63. static const char * const name;
  64. static TStreamable *build();
  65. #endif // NO_STREAM
  66. };
  67. #if !defined( NO_STREAM )
  68. inline ipstream& operator >> ( ipstream& is, TStatusLine& cl )
  69. { return is >> (TStreamable&)cl; }
  70. inline ipstream& operator >> ( ipstream& is, TStatusLine*& cl )
  71. { return is >> (void *&)cl; }
  72. inline opstream& operator << ( opstream& os, TStatusLine& cl )
  73. { return os << (TStreamable&)cl; }
  74. inline opstream& operator << ( opstream& os, TStatusLine* cl )
  75. { return os << (TStreamable *)cl; }
  76. #endif // NO_STREAM
  77. #endif // Uses_TStatusLine