Line data Source code
1 : /* Copyright (C) 2025 Wildfire Games. 2 : * This file is part of 0 A.D. 3 : * 4 : * 0 A.D. is free software: you can redistribute it and/or modify 5 : * it under the terms of the GNU General Public License as published by 6 : * the Free Software Foundation, either version 2 of the License, or 7 : * (at your option) any later version. 8 : * 9 : * 0 A.D. 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 15 : * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. 16 : */ 17 : 18 : #ifndef INCLUDED_CCHECKBOX 19 : #define INCLUDED_CCHECKBOX 20 : 21 : #include "gui/CGUISetting.h" 22 : #include "gui/CGUISprite.h" 23 : #include "gui/ObjectBases/IGUIButtonBehavior.h" 24 : #include "gui/ObjectBases/IGUIObject.h" 25 : 26 : class CGUI; 27 : 28 : class CCheckBox : public IGUIObject, public IGUIButtonBehavior 29 : { 30 0 : GUI_OBJECT(CCheckBox) 31 : 32 : public: 33 : CCheckBox(CGUI& pGUI); 34 : 35 : /** 36 : * @see IGUIObject#ResetStates() 37 : */ 38 : virtual void ResetStates(); 39 : 40 : /** 41 : * @see IGUIObject#HandleMessage() 42 : */ 43 : virtual void HandleMessage(SGUIMessage& Message); 44 : 45 : /** 46 : * Draws the control 47 : */ 48 : virtual void Draw(CCanvas2D& canvas); 49 : 50 : protected: 51 : // Settings 52 : CGUISimpleSetting<bool> m_Checked; 53 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteUnchecked; 54 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteUncheckedOver; 55 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteUncheckedPressed; 56 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteUncheckedDisabled; 57 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteChecked; 58 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteCheckedOver; 59 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteCheckedPressed; 60 : CGUISimpleSetting<CGUISpriteInstance> m_SpriteCheckedDisabled; 61 : }; 62 : 63 : #endif // INCLUDED_CCHECKBOX