Irrlicht 3D Engine
IGUIStaticText.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_STATIC_TEXT_H_INCLUDED__
6 #define __I_GUI_STATIC_TEXT_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 #include "SColor.h"
10 
11 namespace irr
12 {
13 namespace gui
14 {
15  class IGUIFont;
16 
18  class IGUIStaticText : public IGUIElement
19  {
20  public:
21 
23  IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
24  : IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {}
25 
27 
29  virtual void setOverrideFont(IGUIFont* font=0) = 0;
30 
32 
33  virtual IGUIFont* getOverrideFont(void) const = 0;
34 
36 
38  virtual IGUIFont* getActiveFont() const = 0;
39 
41 
48  virtual void setOverrideColor(video::SColor color) = 0;
49 
51 
52  virtual video::SColor getOverrideColor(void) const = 0;
53 
55 
58  virtual void enableOverrideColor(bool enable) = 0;
59 
61 
62  virtual bool isOverrideColorEnabled(void) const = 0;
63 
65  virtual void setBackgroundColor(video::SColor color) = 0;
66 
68  virtual void setDrawBackground(bool draw) = 0;
69 
71 
72  virtual video::SColor getBackgroundColor() const = 0;
73 
75 
76  virtual bool isDrawBackgroundEnabled() const = 0;
77 
79  virtual void setDrawBorder(bool draw) = 0;
80 
82 
83  virtual bool isDrawBorderEnabled() const = 0;
84 
86 
90  virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
91 
93 
95  virtual void setWordWrap(bool enable) = 0;
96 
98 
99  virtual bool isWordWrapEnabled(void) const = 0;
100 
102 
105  virtual s32 getTextHeight() const = 0;
106 
108 
110  virtual s32 getTextWidth(void) const = 0;
111 
113  virtual void setTextRestrainedInside(bool restrainedInside) = 0;
114 
116  virtual bool isTextRestrainedInside() const = 0;
117 
119 
124  virtual void setRightToLeft(bool rtl) = 0;
125 
127  virtual bool isRightToLeft() const = 0;
128  };
129 
130 
131 } // end namespace gui
132 } // end namespace irr
133 
134 #endif
135 
irr::gui::IGUIStaticText::getActiveFont
virtual IGUIFont * getActiveFont() const =0
Get the font which is used right now for drawing.
irr::gui::IGUIStaticText::setDrawBorder
virtual void setDrawBorder(bool draw)=0
Sets whether to draw the border.
irr::gui::IGUIStaticText::getOverrideColor
virtual video::SColor getOverrideColor(void) const =0
Gets the override color.
irr::gui::IGUIStaticText::isRightToLeft
virtual bool isRightToLeft() const =0
Checks whether the text in this element should be interpreted as right-to-left.
irr::gui::IGUIStaticText::getBackgroundColor
virtual video::SColor getBackgroundColor() const =0
Gets the background color.
irr::gui::IGUIStaticText::getTextHeight
virtual s32 getTextHeight() const =0
Returns the height of the text in pixels when it is drawn.
irr::gui::EGUIET_STATIC_TEXT
@ EGUIET_STATIC_TEXT
A static text (IGUIStaticText)
Definition: EGUIElementTypes.h:68
irr::gui::IGUIStaticText
Multi or single line text label.
Definition: IGUIStaticText.h:18
irr::gui::IGUIStaticText::IGUIStaticText
IGUIStaticText(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition: IGUIStaticText.h:23
irr::s32
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
irr::gui::IGUIStaticText::isOverrideColorEnabled
virtual bool isOverrideColorEnabled(void) const =0
Checks if an override color is enabled.
irr::gui::IGUIStaticText::setOverrideColor
virtual void setOverrideColor(video::SColor color)=0
Sets another color for the text.
irr::gui::IGUIStaticText::setTextAlignment
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
Sets text justification mode.
irr::gui::IGUIStaticText::getOverrideFont
virtual IGUIFont * getOverrideFont(void) const =0
Gets the override font (if any)
irr::gui::EGUI_ALIGNMENT
EGUI_ALIGNMENT
Definition: EGUIAlignment.h:12
irr::gui::IGUIStaticText::setBackgroundColor
virtual void setBackgroundColor(video::SColor color)=0
Sets another color for the background.
IGUIElement.h
irr::gui::IGUIStaticText::isWordWrapEnabled
virtual bool isWordWrapEnabled(void) const =0
Checks if word wrap is enabled.
irr::gui::IGUIStaticText::isDrawBackgroundEnabled
virtual bool isDrawBackgroundEnabled() const =0
Checks if background drawing is enabled.
irr::gui::IGUIStaticText::setWordWrap
virtual void setWordWrap(bool enable)=0
Enables or disables word wrap for using the static text as multiline text control.
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::core::rect< s32 >
irr::gui::IGUIElement::draw
virtual void draw()
Draws the element and its children.
Definition: IGUIElement.h:312
irr::gui::IGUIStaticText::setOverrideFont
virtual void setOverrideFont(IGUIFont *font=0)=0
Sets another skin independent font.
irr::gui::IGUIStaticText::enableOverrideColor
virtual void enableOverrideColor(bool enable)=0
Sets if the static text should use the overide color or the color in the gui skin.
irr::gui::IGUIStaticText::getTextWidth
virtual s32 getTextWidth(void) const =0
Returns the width of the current text, in the current font.
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition: IGUIEnvironment.h:70
irr::gui::IGUIStaticText::isTextRestrainedInside
virtual bool isTextRestrainedInside() const =0
Checks if the text in this label should be clipped if it goes outside bounds.
irr::gui::IGUIFont
Font interface.
Definition: IGUIFont.h:39
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
irr::gui::IGUIStaticText::setDrawBackground
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
irr::gui::IGUIElement
Base class of all GUI elements.
Definition: IGUIElement.h:25
irr::gui::IGUIStaticText::setRightToLeft
virtual void setRightToLeft(bool rtl)=0
Set whether the string should be interpreted as right-to-left (RTL) text.
irr::gui::IGUIStaticText::setTextRestrainedInside
virtual void setTextRestrainedInside(bool restrainedInside)=0
Set whether the text in this label should be clipped if it goes outside bounds.
irr::gui::IGUIStaticText::isDrawBorderEnabled
virtual bool isDrawBorderEnabled() const =0
Checks if border drawing is enabled.
SColor.h