diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CGUIStaticText.h | 290 |
1 files changed, 145 insertions, 145 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CGUIStaticText.h b/libraries/irrlicht-1.8/source/Irrlicht/CGUIStaticText.h index 33daa98..274fab8 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CGUIStaticText.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CGUIStaticText.h | |||
@@ -1,145 +1,145 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_GUI_STATIC_TEXT_H_INCLUDED__ | 5 | #ifndef __C_GUI_STATIC_TEXT_H_INCLUDED__ |
6 | #define __C_GUI_STATIC_TEXT_H_INCLUDED__ | 6 | #define __C_GUI_STATIC_TEXT_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IrrCompileConfig.h" | 8 | #include "IrrCompileConfig.h" |
9 | #ifdef _IRR_COMPILE_WITH_GUI_ | 9 | #ifdef _IRR_COMPILE_WITH_GUI_ |
10 | 10 | ||
11 | #include "IGUIStaticText.h" | 11 | #include "IGUIStaticText.h" |
12 | #include "irrArray.h" | 12 | #include "irrArray.h" |
13 | 13 | ||
14 | namespace irr | 14 | namespace irr |
15 | { | 15 | { |
16 | namespace gui | 16 | namespace gui |
17 | { | 17 | { |
18 | class CGUIStaticText : public IGUIStaticText | 18 | class CGUIStaticText : public IGUIStaticText |
19 | { | 19 | { |
20 | public: | 20 | public: |
21 | 21 | ||
22 | //! constructor | 22 | //! constructor |
23 | CGUIStaticText(const wchar_t* text, bool border, IGUIEnvironment* environment, | 23 | CGUIStaticText(const wchar_t* text, bool border, IGUIEnvironment* environment, |
24 | IGUIElement* parent, s32 id, const core::rect<s32>& rectangle, | 24 | IGUIElement* parent, s32 id, const core::rect<s32>& rectangle, |
25 | bool background = false); | 25 | bool background = false); |
26 | 26 | ||
27 | //! destructor | 27 | //! destructor |
28 | virtual ~CGUIStaticText(); | 28 | virtual ~CGUIStaticText(); |
29 | 29 | ||
30 | //! draws the element and its children | 30 | //! draws the element and its children |
31 | virtual void draw(); | 31 | virtual void draw(); |
32 | 32 | ||
33 | //! Sets another skin independent font. | 33 | //! Sets another skin independent font. |
34 | virtual void setOverrideFont(IGUIFont* font=0); | 34 | virtual void setOverrideFont(IGUIFont* font=0); |
35 | 35 | ||
36 | //! Gets the override font (if any) | 36 | //! Gets the override font (if any) |
37 | virtual IGUIFont* getOverrideFont() const; | 37 | virtual IGUIFont* getOverrideFont() const; |
38 | 38 | ||
39 | //! Get the font which is used right now for drawing | 39 | //! Get the font which is used right now for drawing |
40 | virtual IGUIFont* getActiveFont() const; | 40 | virtual IGUIFont* getActiveFont() const; |
41 | 41 | ||
42 | //! Sets another color for the text. | 42 | //! Sets another color for the text. |
43 | virtual void setOverrideColor(video::SColor color); | 43 | virtual void setOverrideColor(video::SColor color); |
44 | 44 | ||
45 | //! Sets another color for the background. | 45 | //! Sets another color for the background. |
46 | virtual void setBackgroundColor(video::SColor color); | 46 | virtual void setBackgroundColor(video::SColor color); |
47 | 47 | ||
48 | //! Sets whether to draw the background | 48 | //! Sets whether to draw the background |
49 | virtual void setDrawBackground(bool draw); | 49 | virtual void setDrawBackground(bool draw); |
50 | 50 | ||
51 | //! Gets the background color | 51 | //! Gets the background color |
52 | virtual video::SColor getBackgroundColor() const; | 52 | virtual video::SColor getBackgroundColor() const; |
53 | 53 | ||
54 | //! Checks if background drawing is enabled | 54 | //! Checks if background drawing is enabled |
55 | virtual bool isDrawBackgroundEnabled() const; | 55 | virtual bool isDrawBackgroundEnabled() const; |
56 | 56 | ||
57 | //! Sets whether to draw the border | 57 | //! Sets whether to draw the border |
58 | virtual void setDrawBorder(bool draw); | 58 | virtual void setDrawBorder(bool draw); |
59 | 59 | ||
60 | //! Checks if border drawing is enabled | 60 | //! Checks if border drawing is enabled |
61 | virtual bool isDrawBorderEnabled() const; | 61 | virtual bool isDrawBorderEnabled() const; |
62 | 62 | ||
63 | //! Sets alignment mode for text | 63 | //! Sets alignment mode for text |
64 | virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical); | 64 | virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical); |
65 | 65 | ||
66 | //! Gets the override color | 66 | //! Gets the override color |
67 | virtual video::SColor getOverrideColor() const; | 67 | virtual video::SColor getOverrideColor() const; |
68 | 68 | ||
69 | //! Sets if the static text should use the overide color or the | 69 | //! Sets if the static text should use the overide color or the |
70 | //! color in the gui skin. | 70 | //! color in the gui skin. |
71 | virtual void enableOverrideColor(bool enable); | 71 | virtual void enableOverrideColor(bool enable); |
72 | 72 | ||
73 | //! Checks if an override color is enabled | 73 | //! Checks if an override color is enabled |
74 | virtual bool isOverrideColorEnabled() const; | 74 | virtual bool isOverrideColorEnabled() const; |
75 | 75 | ||
76 | //! Set whether the text in this label should be clipped if it goes outside bounds | 76 | //! Set whether the text in this label should be clipped if it goes outside bounds |
77 | virtual void setTextRestrainedInside(bool restrainedInside); | 77 | virtual void setTextRestrainedInside(bool restrainedInside); |
78 | 78 | ||
79 | //! Checks if the text in this label should be clipped if it goes outside bounds | 79 | //! Checks if the text in this label should be clipped if it goes outside bounds |
80 | virtual bool isTextRestrainedInside() const; | 80 | virtual bool isTextRestrainedInside() const; |
81 | 81 | ||
82 | //! Enables or disables word wrap for using the static text as | 82 | //! Enables or disables word wrap for using the static text as |
83 | //! multiline text control. | 83 | //! multiline text control. |
84 | virtual void setWordWrap(bool enable); | 84 | virtual void setWordWrap(bool enable); |
85 | 85 | ||
86 | //! Checks if word wrap is enabled | 86 | //! Checks if word wrap is enabled |
87 | virtual bool isWordWrapEnabled() const; | 87 | virtual bool isWordWrapEnabled() const; |
88 | 88 | ||
89 | //! Sets the new caption of this element. | 89 | //! Sets the new caption of this element. |
90 | virtual void setText(const wchar_t* text); | 90 | virtual void setText(const wchar_t* text); |
91 | 91 | ||
92 | //! Returns the height of the text in pixels when it is drawn. | 92 | //! Returns the height of the text in pixels when it is drawn. |
93 | virtual s32 getTextHeight() const; | 93 | virtual s32 getTextHeight() const; |
94 | 94 | ||
95 | //! Returns the width of the current text, in the current font | 95 | //! Returns the width of the current text, in the current font |
96 | virtual s32 getTextWidth() const; | 96 | virtual s32 getTextWidth() const; |
97 | 97 | ||
98 | //! Updates the absolute position, splits text if word wrap is enabled | 98 | //! Updates the absolute position, splits text if word wrap is enabled |
99 | virtual void updateAbsolutePosition(); | 99 | virtual void updateAbsolutePosition(); |
100 | 100 | ||
101 | //! Set whether the string should be interpreted as right-to-left (RTL) text | 101 | //! Set whether the string should be interpreted as right-to-left (RTL) text |
102 | /** \note This component does not implement the Unicode bidi standard, the | 102 | /** \note This component does not implement the Unicode bidi standard, the |
103 | text of the component should be already RTL if you call this. The | 103 | text of the component should be already RTL if you call this. The |
104 | main difference when RTL is enabled is that the linebreaks for multiline | 104 | main difference when RTL is enabled is that the linebreaks for multiline |
105 | elements are performed starting from the end. | 105 | elements are performed starting from the end. |
106 | */ | 106 | */ |
107 | virtual void setRightToLeft(bool rtl); | 107 | virtual void setRightToLeft(bool rtl); |
108 | 108 | ||
109 | //! Checks if the text should be interpreted as right-to-left text | 109 | //! Checks if the text should be interpreted as right-to-left text |
110 | virtual bool isRightToLeft() const; | 110 | virtual bool isRightToLeft() const; |
111 | 111 | ||
112 | //! Writes attributes of the element. | 112 | //! Writes attributes of the element. |
113 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; | 113 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; |
114 | 114 | ||
115 | //! Reads attributes of the element | 115 | //! Reads attributes of the element |
116 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); | 116 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); |
117 | 117 | ||
118 | private: | 118 | private: |
119 | 119 | ||
120 | //! Breaks the single text line. | 120 | //! Breaks the single text line. |
121 | void breakText(); | 121 | void breakText(); |
122 | 122 | ||
123 | EGUI_ALIGNMENT HAlign, VAlign; | 123 | EGUI_ALIGNMENT HAlign, VAlign; |
124 | bool Border; | 124 | bool Border; |
125 | bool OverrideColorEnabled; | 125 | bool OverrideColorEnabled; |
126 | bool OverrideBGColorEnabled; | 126 | bool OverrideBGColorEnabled; |
127 | bool WordWrap; | 127 | bool WordWrap; |
128 | bool Background; | 128 | bool Background; |
129 | bool RestrainTextInside; | 129 | bool RestrainTextInside; |
130 | bool RightToLeft; | 130 | bool RightToLeft; |
131 | 131 | ||
132 | video::SColor OverrideColor, BGColor; | 132 | video::SColor OverrideColor, BGColor; |
133 | gui::IGUIFont* OverrideFont; | 133 | gui::IGUIFont* OverrideFont; |
134 | gui::IGUIFont* LastBreakFont; // stored because: if skin changes, line break must be recalculated. | 134 | gui::IGUIFont* LastBreakFont; // stored because: if skin changes, line break must be recalculated. |
135 | 135 | ||
136 | core::array< core::stringw > BrokenText; | 136 | core::array< core::stringw > BrokenText; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | } // end namespace gui | 139 | } // end namespace gui |
140 | } // end namespace irr | 140 | } // end namespace irr |
141 | 141 | ||
142 | #endif // _IRR_COMPILE_WITH_GUI_ | 142 | #endif // _IRR_COMPILE_WITH_GUI_ |
143 | 143 | ||
144 | #endif | 144 | #endif |
145 | 145 | ||