OpenXcom  1.0
Open-source clone of the original X-Com
ToggleTextButton.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "TextButton.h"
21 #include "../Engine/Action.h"
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
28  public TextButton
29 {
30 private:
31  bool _isPressed;
32  int _originalColor, _invertedColor;
33  TextButton *_fakeGroup;
34 
35 public:
36 
37  void draw();
38  void mousePress(Action *action, State *state);
39  void setPressed(bool pressed);
40  bool getPressed() const { return _isPressed; }
41  void setColor(Uint8 color);
42  void setInvertColor(Uint8 color);
43  ToggleTextButton(int width, int height, int x, int y);
44  ~ToggleTextButton(void);
45 };
46 
47 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void setPressed(bool pressed)
set the _isPressed state of the button and force it to redraw
Definition: ToggleTextButton.cpp:54
Definition: ToggleTextButton.h:27
void draw()
handle draw() in case we need to paint the button a garish color
Definition: ToggleTextButton.cpp:78
void setInvertColor(Uint8 color)
When this is set, Surface::invert() is called with the value from mid when it&#39;s time to invert the bu...
Definition: ToggleTextButton.cpp:70
void mousePress(Action *action, State *state)
handle mouse clicks by toggling the button state; use _fakeGroup to trick TextButton into drawing the...
Definition: ToggleTextButton.cpp:39
Coloured button with a text label.
Definition: TextButton.h:38
void setColor(Uint8 color)
Sets the text button&#39;s color.
Definition: ToggleTextButton.cpp:63
Definition: BaseInfoState.cpp:40