ScummVM API documentation
macbutton.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program 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  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_MACGUI_MACBUTTON_H
23 #define GRAPHICS_MACGUI_MACBUTTON_H
24 
25 #include "graphics/macgui/mactext.h"
26 #include "graphics/macgui/macwidget.h"
27 
28 namespace Graphics {
29 
30 class MacWidget;
31 class MacText;
32 struct MacPlotData;
33 
34 enum MacButtonType {
35  kRound,
36  kCheckBox,
37  kRadio
38 };
39 
40 // those name comes from Apartment
41 enum CheckBoxType {
42  kCBNormal,
43  kCBInsetBlack,
44  kCBFilledBlack
45 };
46 
47 class MacButton : public MacText {
48 public:
49  MacButton(MacButtonType buttonType, TextAlign textAlignment, MacWidget *parent, int x, int y, int w, int h, MacWindowManager *wm, const Common::U32String &s, const MacFont *macFont, int fgcolor, int bgcolor);
50 
51  void setActive(bool active) override;
52 
53  void invertOuter();
54  void invertInner();
55 
56  void setHilite(bool hilite);
57  void setCheckBoxType(int type);
58  void setCheckBoxAccess(int type) { _checkBoxAccess = type; }
59 
60  bool draw(ManagedSurface *g, bool forceRedraw = false) override;
61  bool draw(bool forceRedraw = false) override;
62  bool processEvent(Common::Event &event) override;
63  Common::Point calculateOffset() override;
64 
65 private:
66  void init();
67 
68 private:
69  MacButtonType _buttonType;
70  MacPlotData _pd;
71  bool _invertInner;
72  int _checkBoxType;
73  int _checkBoxAccess;
74 };
75 
76 } // End of namespace Graphics
77 
78 #endif
Definition: managed_surface.h:51
TextAlign
Definition: font.h:48
Definition: mactext.h:47
Definition: macwindowmanager.h:149
Definition: macbutton.h:47
void setActive(bool active) override
Definition: ustr.h:57
Definition: events.h:199
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: macwidget.h:39
Definition: macwindowmanager.h:117
Definition: macfontmanager.h:85