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.

77 lines
1.5 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. More operators and append. Also i18n support.
  9. *
  10. *
  11. */
  12. #if defined( Uses_TMenuItem ) && !defined( __TMenuItem )
  13. #define __TMenuItem
  14. class TMenu;
  15. class TMenuItem
  16. {
  17. public:
  18. TMenuItem( const char *aName,
  19. ushort aCommand,
  20. ushort aKeyCode,
  21. ushort aHelpCtx = hcNoContext,
  22. char *p = 0,
  23. TMenuItem *aNext = 0
  24. );
  25. TMenuItem( const char *aName,
  26. ushort aKeyCode,
  27. TMenu *aSubMenu,
  28. ushort aHelpCtx = hcNoContext,
  29. TMenuItem *aNext = 0
  30. );
  31. ~TMenuItem();
  32. void append( TMenuItem *aNext );
  33. TMenuItem *next;
  34. const char *name;
  35. stTVIntl *intlName;
  36. ushort command;
  37. Boolean disabled;
  38. ushort keyCode;
  39. ushort helpCtx;
  40. union
  41. {
  42. const char *param;
  43. TMenu *subMenu;
  44. };
  45. };
  46. // SET: Sugested by Dean Wakerley <dean@wakerley.com> looks like
  47. // Borland deprecated it without reasons.
  48. inline TMenuItem& operator + ( TMenuItem& s, TMenuItem& i )
  49. {
  50. s.append(&i);
  51. return s;
  52. }
  53. // SET: From TVTools
  54. inline void operator += ( TMenuItem& i1, TMenuItem& i2 )
  55. {
  56. i1 = i1 + i2;
  57. }
  58. inline TMenuItem &newLine()
  59. {
  60. return *new TMenuItem( 0, 0, 0, hcNoContext, 0, 0 );
  61. }
  62. #endif // Uses_TMenuItem