PushBtn.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. //
  20. // PushBtn.h
  21. //
  22. // History:
  23. // 02/04/97 JMI Started.
  24. //
  25. // 03/19/97 JMI Converted to using the RHot::m_iecUser (was using
  26. // RHot::m_epcUser) so HotCall and CursorEvent now take
  27. // RInputEvent ptrs.
  28. //
  29. //////////////////////////////////////////////////////////////////////////////
  30. //
  31. // Please see the CPP file for an explanation of this API.
  32. //
  33. //////////////////////////////////////////////////////////////////////////////
  34. #ifndef PUSHBTN_H
  35. #define PUSHBTN_H
  36. //////////////////////////////////////////////////////////////////////////////
  37. // Headers.
  38. //////////////////////////////////////////////////////////////////////////////
  39. #include "System.h"
  40. // If PATHS_IN_INCLUDES macro is defined, we can utilized relative
  41. // paths to a header file. In this case we generally go off of our
  42. // RSPiX root directory. System.h MUST be included before this macro
  43. // is evaluated. System.h is the header that, based on the current
  44. // platform (or more so in this case on the compiler), defines
  45. // PATHS_IN_INCLUDES. Blue.h includes system.h so you can include that
  46. // instead.
  47. #ifdef PATHS_IN_INCLUDES
  48. #include "ORANGE/GUI/guiItem.h"
  49. #else
  50. #include "GuiItem.h"
  51. #endif // PATHS_IN_INCLUDES
  52. //////////////////////////////////////////////////////////////////////////////
  53. // Macros.
  54. //////////////////////////////////////////////////////////////////////////////
  55. //////////////////////////////////////////////////////////////////////////////
  56. // Typedefs.
  57. //////////////////////////////////////////////////////////////////////////////
  58. //////////////////////////////////////////////////////////////////////////////
  59. class RPushBtn : public RGuiItem
  60. {
  61. public: // Construction/Destruction.
  62. // Default constructor.
  63. RPushBtn(void);
  64. // Destructor.
  65. ~RPushBtn(void);
  66. //////////////////////////////////////////////////////////////////////////////
  67. public: // Typedefs/enums.
  68. typedef enum
  69. {
  70. On,
  71. Off
  72. } State;
  73. //////////////////////////////////////////////////////////////////////////////
  74. public: // Methods.
  75. ////////////////////////////////////////////////////////////////////////
  76. // Methods.
  77. ////////////////////////////////////////////////////////////////////////
  78. // Compose item.
  79. virtual // If you override this, call this base if possible.
  80. void Compose( // Returns nothing.
  81. RImage* pim = NULL); // Dest image, uses m_im if NULL.
  82. // Cursor event notification.
  83. // Events in event area.
  84. virtual // If you override this, call this base if possible.
  85. void CursorEvent( // Returns nothing.
  86. RInputEvent* pie); // In: Most recent user input event.
  87. // Out: pie->sUsed = TRUE, if used.
  88. // Draw border.
  89. virtual // Overridden here.
  90. void DrawBorder( // Returns nothing.
  91. RImage* pim = NULL, // Dest image, uses m_im if NULL.
  92. short sInvert = FALSE); // Inverts border if TRUE.
  93. ////////////////////////////////////////////////////////////////////////
  94. // Querries.
  95. ////////////////////////////////////////////////////////////////////////
  96. // Gets the thickness of the top/left border (including border edge effect).
  97. virtual // Overridden here.
  98. short GetTopLeftBorderThickness(void); // Returns border thickness
  99. // including edge effect.
  100. // Gets the thickness of the bottom/right border (including border edge effect).
  101. virtual // Overridden here.
  102. short GetBottomRightBorderThickness(void); // Returns border thickness
  103. // including edge effect.
  104. //////////////////////////////////////////////////////////////////////////////
  105. public: // Static
  106. //////////////////////////////////////////////////////////////////////////////
  107. public: // Querries.
  108. //////////////////////////////////////////////////////////////////////////////
  109. protected: // Internal functions.
  110. //////////////////////////////////////////////////////////////////////////////
  111. public: // Member variables.
  112. State m_state; // The button's current state (On or Off (see enums)).
  113. protected: // Internal typedefs.
  114. protected: // Protected member variables.
  115. };
  116. #endif // PUSHBTN_H
  117. //////////////////////////////////////////////////////////////////////////////
  118. // EOF
  119. //////////////////////////////////////////////////////////////////////////////