xoreos  0.0.5
nwnwidgetwithcaption.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_NWNWIDGETWITHCAPTION_H
26 #define ENGINES_NWN_GUI_WIDGETS_NWNWIDGETWITHCAPTION_H
27 
28 #include "src/common/scopedptr.h"
29 
31 
33 
34 namespace Common {
35  class UString;
36 }
37 
38 namespace Engines {
39 
40 namespace NWN {
41 
48 public:
51 
52  void show();
53  void hide();
54 
55  virtual void initCaption(const Common::UString &font, const Common::UString &text,
56  float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f,
57  float halign = Graphics::Aurora::kHAlignLeft, float valign = Graphics::Aurora::kVAlignTop);
58 
59  void setPosition(float x, float y, float z);
60  void setColor(float r, float g, float b, float a);
61  void setText(const Common::UString &text);
62  const Common::UString getText() const;
63 
64  float getWidth () const;
65  float getHeight() const;
66 
67  float getHorizontalAlign() const;
68  float getVerticalAlign () const;
69 
70  void setDisabled(bool disabled);
71 
72 protected:
74 
75  float _r;
76  float _g;
77  float _b;
78  float _a;
79 };
80 
81 } // End of namespace NWN
82 
83 } // End of namespace Engines
84 
85 #endif // ENGINES_NWN_GUI_WIDGETS_NWNWIDGETWITHCAPTION_H
A NWN widget.
Definition: 2dafile.h:39
float getHeight() const
Get the widget&#39;s height.
A class holding an UTF-8 string.
Definition: ustring.h:48
NWNWidgetWithCaption(::Engines::GUI &gui, const Common::UString &tag)
const float kVAlignTop
Definition: types.h:46
void setText(const Common::UString &text)
Base class for all widgets in NWN.
Definition: nwnwidget.h:45
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
A simple scoped smart pointer template.
A GUI.
Definition: gui.h:43
Basic Aurora graphics types.
const float kHAlignLeft
Definition: types.h:42
const Common::UString getText() const
virtual 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)
Common::ScopedPtr< Graphics::Aurora::Text > _caption
void setDisabled(bool disabled)
Disable/Enable the widget.
A NWN widget with a text caption.
float getWidth() const
Get the widget&#39;s width.
void setColor(float r, float g, float b, float a)