BIGCHECK.H (1877B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 // Bigcheck.h 17 // ajw 9/14/98 18 19 #ifdef WOLAPI_INTEGRATION 20 21 #ifndef BIGCHECKBOX_H 22 #define BIGCHECKBOX_H 23 24 #include "toggle.h" 25 26 #define BIGCHECK_OFFSETX 20 27 #define BIGCHECK_OFFSETY 0 28 29 //*********************************************************************************************** 30 class BigCheckBoxClass : public ToggleClass 31 { 32 public: 33 BigCheckBoxClass( unsigned id, int x, int y, int w, int h, const char* szCaptionIn, TextPrintType TextFlags, 34 bool bInitiallyChecked = false ) : 35 ToggleClass( id, x, y, w, h ), 36 TextFlags( TextFlags ) 37 { 38 szCaption = new char[ strlen( szCaptionIn ) + 1 ]; 39 strcpy( szCaption, szCaptionIn ); 40 if( bInitiallyChecked ) 41 Turn_On(); 42 IsToggleType = 1; 43 } 44 virtual ~BigCheckBoxClass() 45 { 46 delete [] szCaption; 47 } 48 49 virtual int Draw_Me(int forced=false); 50 virtual int Action(unsigned flags, KeyNumType & key); 51 52 bool Toggle() 53 { 54 if( IsOn ) 55 { 56 Turn_Off(); 57 return false; 58 } 59 Turn_On(); 60 return true; 61 } 62 63 protected: 64 TextPrintType TextFlags; 65 char* szCaption; 66 67 }; 68 69 #endif 70 71 #endif