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.

96 lines
2.6 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. Modified by Salvador E. Tropea: added i18n support, T1Label inspired in
  9. TVTools but reworked.
  10. *
  11. *
  12. */
  13. /* ---------------------------------------------------------------------- */
  14. /* class TLabel */
  15. /* */
  16. /* Palette layout */
  17. /* 1 = Normal text */
  18. /* 2 = Selected text */
  19. /* 3 = Normal shortcut */
  20. /* 4 = Selected shortcut */
  21. /* ---------------------------------------------------------------------- */
  22. #if defined( Uses_TLabel ) && !defined( TLabel_defined )
  23. #define TLabel_defined
  24. class TRect;
  25. struct TEvent;
  26. class TView;
  27. class TLabel : public TStaticText
  28. {
  29. public:
  30. TLabel( const TRect& bounds, const char *aText, TView *aLink );
  31. TLabel( const TRect& bounds, const char *aText, TView *aLink, stTVIntl *aIntlText );
  32. virtual void draw();
  33. virtual TPalette& getPalette() const;
  34. virtual void handleEvent( TEvent& event );
  35. virtual void shutDown();
  36. TView *link;
  37. protected:
  38. Boolean light;
  39. void init( TView *aLink );
  40. #if !defined( NO_STREAM )
  41. private:
  42. virtual const char *streamableName() const
  43. { return name; }
  44. protected:
  45. TLabel( StreamableInit );
  46. virtual void write( opstream& );
  47. virtual void *read( ipstream& );
  48. public:
  49. static const char * const name;
  50. static TStreamable *build();
  51. #endif // NO_STREAM
  52. };
  53. #if !defined( NO_STREAM )
  54. inline ipstream& operator >> ( ipstream& is, TLabel& cl )
  55. { return is >> (TStreamable&)cl; }
  56. inline ipstream& operator >> ( ipstream& is, TLabel*& cl )
  57. { return is >> (void *&)cl; }
  58. inline opstream& operator << ( opstream& os, TLabel& cl )
  59. { return os << (TStreamable&)cl; }
  60. inline opstream& operator << ( opstream& os, TLabel* cl )
  61. { return os << (TStreamable *)cl; }
  62. #endif // NO_STREAM
  63. #endif // Uses_TLabel
  64. #if defined( Uses_T1Label ) && !defined( T1Label_defined )
  65. #define T1Label_defined
  66. class T1Label : public TLabel
  67. {
  68. public:
  69. T1Label(int x, int y, const char *aText, TView *aLink) :
  70. TLabel(TRect(x,y,x,y),aText,aLink)
  71. { growTo(cstrlen(TVIntl::getText(aText,intlText))+1,1); };
  72. };
  73. #endif // Uses_T1Label