GadgetCheckBox.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: GadgetCheckBox.h /////////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Westwood Studios Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2001 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // Project: RTS3
  34. //
  35. // File name: GadgetCheckBox.h
  36. //
  37. // Created: Colin Day, June 2001
  38. //
  39. // Desc: Helpful interface for checkboxes
  40. //
  41. // CheckBox IMAGE/COLOR organization
  42. // When control is enabled:
  43. // enabledDrawData[ 0 ] is the background image for the whole enabled control
  44. // enabledDrawData[ 1 ] is the enabled, unselected check box
  45. // enabledDrawData[ 2 ] is the enabled, selected check box
  46. //
  47. // When control is disabled:
  48. // disabledDrawData[ 0 ] is the background image for the whole disabled control
  49. // disabledDrawData[ 1 ] is the disabled, unselected check box
  50. // disabledDrawData[ 2 ] si the disabled, selected check box
  51. //
  52. // When control is hilited (mouse over it and enabled)
  53. // hiliteDrawData[ 0 ] is the background image for the whole hilited control
  54. // hiliteDrawData[ 1 ] is the hilited, unselected check box
  55. // hiliteDrawData[ 2 ] is the hilited, selected check box
  56. //
  57. //-----------------------------------------------------------------------------
  58. ///////////////////////////////////////////////////////////////////////////////
  59. #pragma once
  60. #ifndef __GADGETCHECKBOX_H_
  61. #define __GADGETCHECKBOX_H_
  62. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  63. // USER INCLUDES //////////////////////////////////////////////////////////////
  64. #include "GameClient/GameWindow.h"
  65. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  66. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  67. ///////////////////////////////////////////////////////////////////////////////
  68. // INLINING ///////////////////////////////////////////////////////////////////
  69. ///////////////////////////////////////////////////////////////////////////////
  70. extern void GadgetCheckBoxSetText( GameWindow *g, UnicodeString text );
  71. extern Bool GadgetCheckBoxIsChecked( GameWindow *g );
  72. extern void GadgetCheckBoxSetChecked( GameWindow *g, Bool isChecked);
  73. extern void GadgetCheckBoxToggle( GameWindow *g);
  74. inline void GadgetCheckBoxSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
  75. inline void GadgetCheckBoxSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
  76. inline void GadgetCheckBoxSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
  77. inline void GadgetCheckBoxSetEnabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
  78. inline void GadgetCheckBoxSetEnabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
  79. inline void GadgetCheckBoxSetEnabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
  80. inline void GadgetCheckBoxSetEnabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
  81. inline void GadgetCheckBoxSetEnabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 2, color ); }
  82. inline void GadgetCheckBoxSetEnabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 2, color ); }
  83. inline const Image *GadgetCheckBoxGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
  84. inline Color GadgetCheckBoxGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
  85. inline Color GadgetCheckBoxGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
  86. inline const Image *GadgetCheckBoxGetEnabledUncheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
  87. inline Color GadgetCheckBoxGetEnabledUncheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
  88. inline Color GadgetCheckBoxGetEnabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
  89. inline const Image *GadgetCheckBoxGetEnabledCheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
  90. inline Color GadgetCheckBoxGetEnabledCheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 2 ); }
  91. inline Color GadgetCheckBoxGetEnabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 2 ); }
  92. inline void GadgetCheckBoxSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
  93. inline void GadgetCheckBoxSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
  94. inline void GadgetCheckBoxSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
  95. inline void GadgetCheckBoxSetDisabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
  96. inline void GadgetCheckBoxSetDisabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
  97. inline void GadgetCheckBoxSetDisabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
  98. inline void GadgetCheckBoxSetDisabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
  99. inline void GadgetCheckBoxSetDisabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 2, color ); }
  100. inline void GadgetCheckBoxSetDisabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 2, color ); }
  101. inline const Image *GadgetCheckBoxGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
  102. inline Color GadgetCheckBoxGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
  103. inline Color GadgetCheckBoxGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
  104. inline const Image *GadgetCheckBoxGetDisabledUncheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
  105. inline Color GadgetCheckBoxGetDisabledUncheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
  106. inline Color GadgetCheckBoxGetDisabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
  107. inline const Image *GadgetCheckBoxGetDisabledCheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
  108. inline Color GadgetCheckBoxGetDisabledCheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 2 ); }
  109. inline Color GadgetCheckBoxGetDisabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 2 ); }
  110. inline void GadgetCheckBoxSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
  111. inline void GadgetCheckBoxSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
  112. inline void GadgetCheckBoxSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
  113. inline void GadgetCheckBoxSetHiliteUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
  114. inline void GadgetCheckBoxSetHiliteUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
  115. inline void GadgetCheckBoxSetHiliteUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
  116. inline void GadgetCheckBoxSetHiliteCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
  117. inline void GadgetCheckBoxSetHiliteCheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 2, color ); }
  118. inline void GadgetCheckBoxSetHiliteCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 2, color ); }
  119. inline const Image *GadgetCheckBoxGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
  120. inline Color GadgetCheckBoxGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
  121. inline Color GadgetCheckBoxGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
  122. inline const Image *GadgetCheckBoxGetHiliteUncheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
  123. inline Color GadgetCheckBoxGetHiliteUncheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
  124. inline Color GadgetCheckBoxGetHiliteUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
  125. inline const Image *GadgetCheckBoxGetHiliteCheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
  126. inline Color GadgetCheckBoxGetHiliteCheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 2 ); }
  127. inline Color GadgetCheckBoxGetHiliteCheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 2 ); }
  128. // EXTERNALS //////////////////////////////////////////////////////////////////
  129. #endif // __GADGETCHECKBOX_H_