BIGCHECK.H 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. ** Command & Conquer Red Alert(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. // Bigcheck.h
  19. // ajw 9/14/98
  20. #ifdef WOLAPI_INTEGRATION
  21. #ifndef BIGCHECKBOX_H
  22. #define BIGCHECKBOX_H
  23. #include "toggle.h"
  24. #define BIGCHECK_OFFSETX 20
  25. #define BIGCHECK_OFFSETY 0
  26. //***********************************************************************************************
  27. class BigCheckBoxClass : public ToggleClass
  28. {
  29. public:
  30. BigCheckBoxClass( unsigned id, int x, int y, int w, int h, const char* szCaptionIn, TextPrintType TextFlags,
  31. bool bInitiallyChecked = false ) :
  32. ToggleClass( id, x, y, w, h ),
  33. TextFlags( TextFlags )
  34. {
  35. szCaption = new char[ strlen( szCaptionIn ) + 1 ];
  36. strcpy( szCaption, szCaptionIn );
  37. if( bInitiallyChecked )
  38. Turn_On();
  39. IsToggleType = 1;
  40. }
  41. virtual ~BigCheckBoxClass()
  42. {
  43. delete [] szCaption;
  44. }
  45. virtual int Draw_Me(int forced=false);
  46. virtual int Action(unsigned flags, KeyNumType & key);
  47. bool Toggle()
  48. {
  49. if( IsOn )
  50. {
  51. Turn_Off();
  52. return false;
  53. }
  54. Turn_On();
  55. return true;
  56. }
  57. protected:
  58. TextPrintType TextFlags;
  59. char* szCaption;
  60. };
  61. #endif
  62. #endif