xoreos  0.0.5
label.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_LABEL_H
26 #define ENGINES_NWN_GUI_WIDGETS_LABEL_H
27 
29 
30 namespace Common {
31  class UString;
32 }
33 
34 namespace Engines {
35 
36 class GUI;
37 
38 namespace NWN {
39 
42 public:
43  WidgetLabel(::Engines::GUI &gui, const Common::UString &tag);
44  ~WidgetLabel();
45 
46  void initCaption(const Common::UString &font, const Common::UString &text,
47  float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f,
48  float halign = Graphics::Aurora::kHAlignLeft, float valign = Graphics::Aurora::kVAlignTop);
49 
50  void setText(const Common::UString &text);
51 
52  float getWidth () const;
53  float getHeight() const;
54  void setSize(float width, float height);
55 
56 private:
57  float _width;
58  float _height;
59 };
60 
61 } // End of namespace NWN
62 
63 } // End of namespace Engines
64 
65 #endif // ENGINES_NWN_GUI_WIDGETS_LABEL_H
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
const float kVAlignTop
Definition: types.h:46
A GUI.
Definition: gui.h:43
const float kHAlignLeft
Definition: types.h:42
A NWN label widget.
Definition: label.h:41
A NWN widget with a text caption.
float getHeight() const
Get the widget&#39;s height.
Definition: label.cpp:88
WidgetLabel(::Engines::GUI &gui, const Common::UString &tag)
Definition: label.cpp:35
A NWN widget with a text caption.
float getWidth() const
Get the widget&#39;s width.
Definition: label.cpp:84
void initCaption(const Common::UString &font, const Common::UString &text, float r=1.0f, float g=1.0f, float b=1.0f, float a=1.0f, float halign=Graphics::Aurora::kHAlignLeft, float valign=Graphics::Aurora::kVAlignTop)
Definition: label.cpp:43
void setSize(float width, float height)
Definition: label.cpp:92
void setText(const Common::UString &text)
Definition: label.cpp:67