OpenXcom  1.0
Open-source clone of the original X-Com
ImageButton.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 "../Engine/InteractiveSurface.h"
21 
22 namespace OpenXcom
23 {
24 
33 {
34 protected:
35  Uint8 _color;
36  ImageButton **_group;
37  bool _inverted;
38 public:
40  ImageButton(int width, int height, int x = 0, int y = 0);
42  virtual ~ImageButton();
44  void setColor(Uint8 color);
46  Uint8 getColor() const;
48  void setGroup(ImageButton **group);
50  void mousePress(Action *action, State *state);
52  void mouseRelease(Action *action, State *state);
54  void toggle(bool invert);
55 };
56 
57 }
virtual ~ImageButton()
Cleans up the image button.
Definition: ImageButton.cpp:39
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void setColor(Uint8 color)
Sets the image button&#39;s color.
Definition: ImageButton.cpp:48
void setGroup(ImageButton **group)
Sets the image button&#39;s group.
Definition: ImageButton.cpp:67
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
void mouseRelease(Action *action, State *state)
Special handling for mouse releases.
Definition: ImageButton.cpp:104
Uint8 getColor() const
Gets the image button&#39;s color.
Definition: ImageButton.cpp:57
Regular image that works like a button.
Definition: ImageButton.h:32
void mousePress(Action *action, State *state)
Special handling for mouse presses.
Definition: ImageButton.cpp:80
void invert(Uint8 mid)
Inverts the surface&#39;s colors.
Definition: Surface.cpp:592
ImageButton(int width, int height, int x=0, int y=0)
Creates a new image button with the specified size and position.
Definition: ImageButton.cpp:32
void toggle(bool invert)
Invert a button explicitly either ON or OFF.
Definition: ImageButton.cpp:118
Definition: BaseInfoState.cpp:40