ScummVM API documentation
gui_text_toggle_button.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 NUVIE_GUI_TEXT_TOGGLE_BUTTON_H
23 #define NUVIE_GUI_TEXT_TOGGLE_BUTTON_H
24 
25 #include "ultima/nuvie/gui/gui_button.h"
26 
27 namespace Ultima {
28 namespace Nuvie {
29 
30 // A button that cycles through a set of captions when clicked
31 
33 public:
34  /* Passed the button data, position, width, height,
35  captions, number of captions, initial selection,
36  a font, an alignment (see GUI_Button),
37  the callback and a flag if it should be 2D (1) or 3D (0).
38 
39  The captions are copied into the class. */
40  GUI_TextToggleButton(void *data, int x, int y, int w, int h,
41  const char *const *texts, int count, int selection,
42  GUI_Font *font, ButtonTextAlign alignment,
43  GUI_CallBack *callback, int flat = 0);
44 
45  ~GUI_TextToggleButton() override;
46 
47  virtual int GetSelection() const;
48 
49  GUI_status MouseUp(int x, int y, Shared::MouseButton button) override;
50  GUI_status Activate_button(int x = 0, int y = 0, Shared::MouseButton button = Shared::BUTTON_LEFT) override;
51 
52 protected:
53  int selection;
54  char **texts;
55  int count;
56  ButtonTextAlign alignment;
57 };
58 
59 } // End of namespace Nuvie
60 } // End of namespace Ultima
61 
62 #endif
Definition: gui_text_toggle_button.h:32
Definition: gui_font.h:36
Definition: gui_button.h:70
Definition: detection.h:27
Definition: gui_callback.h:31