~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to include/IGUIStaticText.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 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
 
 
17
        //! Multi or single line text label.
 
18
        class IGUIStaticText : public IGUIElement
 
19
        {
 
20
        public:
 
21
 
 
22
                //! constructor
 
23
                IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
 
24
                        : IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {}
 
25
 
 
26
                //! Sets another skin independent font.
 
27
                /** If this is set to zero, the button uses the font of the skin.
 
28
                \param font: New font to set. */
 
29
                virtual void setOverrideFont(IGUIFont* font=0) = 0;
 
30
 
 
31
                //! Gets the override font (if any)
 
32
                /** \return The override font (may be 0) */
 
33
                virtual IGUIFont* getOverrideFont(void) const = 0;
 
34
 
 
35
                //! Get the font which is used right now for drawing
 
36
                /** Currently this is the override font when one is set and the
 
37
                font of the active skin otherwise */
 
38
                virtual IGUIFont* getActiveFont() const = 0;
 
39
 
 
40
                //! Sets another color for the text.
 
41
                /** If set, the static text does not use the EGDC_BUTTON_TEXT color defined
 
42
                in the skin, but the set color instead. You don't need to call
 
43
                IGUIStaticText::enableOverrrideColor(true) after this, this is done
 
44
                by this function.
 
45
                If you set a color, and you want the text displayed with the color
 
46
                of the skin again, call IGUIStaticText::enableOverrideColor(false);
 
47
                \param color: New color of the text. */
 
48
                virtual void setOverrideColor(video::SColor color) = 0;
 
49
 
 
50
                //! Gets the override color
 
51
                /** \return: The override color */
 
52
                virtual video::SColor const& getOverrideColor(void) const = 0;
 
53
 
 
54
                //! Sets if the static text should use the overide color or the color in the gui skin.
 
55
                /** \param enable: If set to true, the override color, which can be set
 
56
                with IGUIStaticText::setOverrideColor is used, otherwise the
 
57
                EGDC_BUTTON_TEXT color of the skin. */
 
58
                virtual void enableOverrideColor(bool enable) = 0;
 
59
 
 
60
                //! Checks if an override color is enabled
 
61
                /** \return true if the override color is enabled, false otherwise */
 
62
                virtual bool isOverrideColorEnabled(void) const = 0;
 
63
 
 
64
                //! Sets another color for the background.
 
65
                virtual void setBackgroundColor(video::SColor color) = 0;
 
66
 
 
67
                //! Sets whether to draw the background
 
68
                virtual void setDrawBackground(bool draw) = 0;
 
69
 
 
70
                //! Sets whether to draw the border
 
71
                virtual void setDrawBorder(bool draw) = 0;
 
72
 
 
73
                //! Sets text justification mode
 
74
                /** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
 
75
                EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
 
76
                \param vertical: EGUIA_UPPERLEFT to align with top edge,
 
77
                EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
 
78
                virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
 
79
 
 
80
                //! Enables or disables word wrap for using the static text as multiline text control.
 
81
                /** \param enable: If set to true, words going over one line are
 
82
                broken on to the next line. */
 
83
                virtual void setWordWrap(bool enable) = 0;
 
84
 
 
85
                //! Checks if word wrap is enabled
 
86
                /** \return true if word wrap is enabled, false otherwise */
 
87
                virtual bool isWordWrapEnabled(void) const = 0;
 
88
 
 
89
                //! Returns the height of the text in pixels when it is drawn.
 
90
                /** This is useful for adjusting the layout of gui elements based on the height
 
91
                of the multiline text in this element.
 
92
                \return Height of text in pixels. */
 
93
                virtual s32 getTextHeight() const = 0;
 
94
 
 
95
                //! Returns the width of the current text, in the current font
 
96
                /** If the text is broken, this returns the width of the widest line
 
97
                \return The width of the text, or the widest broken line. */
 
98
                virtual s32 getTextWidth(void) const = 0;
 
99
 
 
100
                //! Set whether the text in this label should be clipped if it goes outside bounds
 
101
                virtual void setTextRestrainedInside(bool restrainedInside) = 0;
 
102
 
 
103
                //! Checks if the text in this label should be clipped if it goes outside bounds
 
104
                virtual bool isTextRestrainedInside() const = 0;
 
105
 
 
106
                //! Set whether the string should be interpreted as right-to-left (RTL) text
 
107
                /** \note This component does not implement the Unicode bidi standard, the
 
108
                text of the component should be already RTL if you call this. The
 
109
                main difference when RTL is enabled is that the linebreaks for multiline
 
110
                elements are performed starting from the end.
 
111
                */
 
112
                virtual void setRightToLeft(bool rtl) = 0;
 
113
 
 
114
                //! Checks whether the text in this element should be interpreted as right-to-left
 
115
                virtual bool isRightToLeft() const = 0;
 
116
        };
 
117
 
 
118
 
 
119
} // end namespace gui
 
120
} // end namespace irr
 
121
 
 
122
#endif
 
123