xoreos  0.0.5
listitembutton.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_GUI_WIDGETS_WIDGETLISTITEMBUTTON_H
26 #define ENGINES_NWN_GUI_WIDGETS_WIDGETLISTITEMBUTTON_H
27 
28 #include "src/common/scopedptr.h"
29 
30 #include "src/sound/sound.h"
31 
33 
34 namespace Engines {
35 
36 namespace NWN {
37 
38 class Portrait;
39 class WidgetButton;
40 
42 public:
44  float spacing = 0.0f, const Common::UString &soundClick = "gui_button");
46 
47  void show();
48  void hide();
49 
50  void setPosition(float x, float y, float z);
51 
52  void mouseDown(uint8 state, float x, float y);
53 
54  float getWidth () const;
55  float getHeight() const;
56 
57  void setTag(const Common::UString &tag);
58  void setSound(const Common::UString &sound);
59 
60 protected:
61  bool activate();
62  bool deactivate();
63 
65 
66 private:
67  float _spacing;
70 };
71 
73  kHelpButton = 0x01,
74  kMoveButton = 0x02,
75  kNoButton = 0x04
76 };
77 
79 public:
81  const Common::UString &text, const Common::UString &icon,
82  uint32 otherButtons = 0x04,
83  const Common::UString &soundClick = "gui_button");
85 
86  void show();
87  void hide();
88 
89  void setPosition(float x, float y, float z);
90 
91  void mouseDown(uint8 state, float x, float y);
92  void mouseUp(uint8 state, float x, float y);
93 
94  void enter();
95  void leave();
96 
97  bool movable() const;
98  void setUnmovable();
99 
100  void setTextColor(float r, float g, float b, float a);
101 
102  void changeArrowDirection();
103 
104 protected:
105  virtual void callbackHelp();
106 
109 
110  bool _isRight;
112 
114 
117 };
118 
119 } // End of namespace NWN
120 
121 } // End of namespace Engines
122 
123 #endif // ENGINES_NWN_GUI_WIDGETS_WIDGETLISTITEMBUTTON_H
A class holding an UTF-8 string.
Definition: ustring.h:48
Common::ScopedPtr< Portrait > _icon
uint8_t uint8
Definition: types.h:200
WidgetListItemButton(::Engines::GUI &gui, const Common::UString &button, const Common::UString &text, const Common::UString &icon, uint32 otherButtons=0x04, const Common::UString &soundClick="gui_button")
void setTag(const Common::UString &tag)
Set the widget&#39;s tag.
void mouseDown(uint8 state, float x, float y)
A mouse button was pressed on the widget.
void mouseUp(uint8 state, float x, float y)
A mouse button was released on the widget.
float getWidth() const
Get the widget&#39;s width.
An item widget within a NWN listbox widget.
Definition: listbox.h:51
A simple scoped smart pointer template.
A NWN listbox widget.
A NWN button widget.
Definition: button.h:39
A GUI.
Definition: gui.h:43
float getHeight() const
Get the widget&#39;s height.
void mouseDown(uint8 state, float x, float y)
A mouse button was pressed on the widget.
void leave()
The mouse left the widget.
void setSound(const Common::UString &sound)
void enter()
The mouse entered the widget.
void setTextColor(float r, float g, float b, float a)
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
The global sound manager, handling all sound output.
Common::ScopedPtr< Graphics::Aurora::Text > _text
A handle to a sound channel.
Definition: types.h:35
uint32_t uint32
Definition: types.h:204
Common::ScopedPtr< Graphics::Aurora::Model > _helpButton
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
Common::ScopedPtr< Graphics::Aurora::Model > _button
WidgetListItemBaseButton(::Engines::GUI &gui, const Common::UString &button, float spacing=0.0f, const Common::UString &soundClick="gui_button")