GadgetStaticText.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. ** Command & Conquer Generals(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: GadgetStaticText.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: GadgetStaticText.h
  36. //
  37. // Created: Colin Day, June 2001
  38. //
  39. // Desc: Helpful interface for StaticTexts
  40. //
  41. // StaticText IMAGE/COLOR organization
  42. // When control is enabled:
  43. // enabledDrawData[ 0 ] is the background image for the whole enabled control
  44. //
  45. // When control is disabled:
  46. // disabledDrawData[ 0 ] is the background image for the whole disabled control
  47. //
  48. // When control is hilited (mouse over it and enabled)
  49. // hiliteDrawData[ 0 ] is the background image for the whole hilited control
  50. //
  51. //-----------------------------------------------------------------------------
  52. ///////////////////////////////////////////////////////////////////////////////
  53. #pragma once
  54. #ifndef __GADGETSTATICTEXT_H_
  55. #define __GADGETSTATICTEXT_H_
  56. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  57. // USER INCLUDES //////////////////////////////////////////////////////////////
  58. #include "GameClient/GameWindow.h"
  59. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  60. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  61. ///////////////////////////////////////////////////////////////////////////////
  62. // INLINING ///////////////////////////////////////////////////////////////////
  63. ///////////////////////////////////////////////////////////////////////////////
  64. extern void GadgetStaticTextSetText( GameWindow *window, UnicodeString text );
  65. extern UnicodeString GadgetStaticTextGetText( GameWindow *window );
  66. extern void GadgetStaticTextSetFont( GameWindow *window, GameFont *font );
  67. // text colors
  68. // enabled background
  69. inline void GadgetStaticTextSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
  70. inline void GadgetStaticTextSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
  71. inline void GadgetStaticTextSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
  72. inline const Image *GadgetStaticTextGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
  73. inline Color GadgetStaticTextGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
  74. inline Color GadgetStaticTextGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
  75. // disabled background
  76. inline void GadgetStaticTextSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
  77. inline void GadgetStaticTextSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
  78. inline void GadgetStaticTextSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
  79. inline const Image *GadgetStaticTextGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
  80. inline Color GadgetStaticTextGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
  81. inline Color GadgetStaticTextGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
  82. // hilite if we choose to use it
  83. inline void GadgetStaticTextSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
  84. inline void GadgetStaticTextSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
  85. inline void GadgetStaticTextSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
  86. inline const Image *GadgetStaticTextGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
  87. inline Color GadgetStaticTextGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
  88. inline Color GadgetStaticTextGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
  89. // EXTERNALS //////////////////////////////////////////////////////////////////
  90. #endif // __GADGETSTATICTEXT_H_