MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_ISubWidgetText.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_I_SUB_WIDGET_TEXT_H__
23 #define __MYGUI_I_SUB_WIDGET_TEXT_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_ISubWidget.h"
27 #include "MyGUI_Colour.h"
28
29 namespace MyGUI
30 {
31
32 class MYGUI_EXPORT ISubWidgetText :
33 public ISubWidget
34 {
35 MYGUI_RTTI_DERIVED( ISubWidgetText )
36
37 public:
38 virtual ~ISubWidgetText() { }
39
41 virtual size_t getTextSelectionStart() const
42 {
43 return 0;
44 }
45
47 virtual size_t getTextSelectionEnd() const
48 {
49 return 0;
50 }
51
53 virtual void setTextSelection(size_t _start, size_t _end) { }
54
55 // интенсивность выделенного текста
56 virtual bool getSelectBackground() const
57 {
58 return true;
59 }
60
61 virtual void setSelectBackground(bool _normal) { }
62
63 // нужно ли инвертировать выделение
64 virtual bool getInvertSelected() const
65 {
66 return true;
67 }
68
69 virtual void setInvertSelected(bool _value) { }
70
71 // нужно ли показывать тень
72 virtual bool getShadow() const
73 {
74 return false;
75 }
76
77 virtual void setShadow(bool _value) { }
78
79 // управление видимостью курсора
80 virtual bool isVisibleCursor() const
81 {
82 return false;
83 }
84
85 virtual void setVisibleCursor(bool _value) { }
86
87 // управление положением курсора
88 virtual size_t getCursorPosition() const
89 {
90 return 0;
91 }
92
93 virtual void setCursorPosition(size_t _index) { }
94
95 virtual void setWordWrap(bool _value) { }
96
97 // возвращает положение курсора по произвольному положению
98 // позиция абсолютная, без учета смещений
99 virtual size_t getCursorPosition(const IntPoint& _point) /*const*/
100 {
101 return 0;
102 }
103
104 // возвращает положение курсора в обсолютных координатах
105 virtual IntCoord getCursorCoord(size_t _position) /*const*/
106 {
107 return IntCoord();
108 }
109
110 // возвращает положение курсора в обсолютных координатах
111 IntPoint getCursorPoint(size_t _position) /*const*/
112 {
113 const IntCoord& coord = getCursorCoord(_position);
114 return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2);
115 }
116
117 // возвращает положение курсора в обсолютных координатах
118 IntRect getCursorRect(size_t _position) /*const*/
119 {
120 const IntCoord& coord = getCursorCoord(_position);
121 return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height);
122 }
123
124 // возвращает размер текста в пикселях
125 virtual IntSize getTextSize() /*const*/
126 {
127 return IntSize();
128 }
129
130 // устанавливает смещение текста в пикселях
131 virtual void setViewOffset(const IntPoint& _point) { }
132 virtual IntPoint getViewOffset() const
133 {
134 return IntPoint();
135 }
136
137 virtual void setCaption(const UString& _value) { }
138 virtual const UString& getCaption() const
139 {
140 static UString caption;
141 return caption;
142 }
143
144 virtual void setTextColour(const Colour& _value) { }
145 virtual const Colour& getTextColour() const
146 {
147 return Colour::Zero;
148 }
149
150 virtual void setFontName(const std::string& _value) { }
151 virtual const std::string& getFontName() const
152 {
153 static std::string name;
154 return name;
155 }
156
157 virtual void setFontHeight(int _value) { }
158 virtual int getFontHeight() const
159 {
160 return 0;
161 }
162
163 virtual void setTextAlign(Align _value) { }
164 virtual Align getTextAlign() const
165 {
166 return Align::Default;
167 }
168
169 virtual void setShiftText(bool _value) { }
170
171 virtual void setShadowColour(const Colour& _value) { }
172 virtual const Colour& getShadowColour() const
173 {
174 return Colour::Zero;
175 }
176
177 };
178
179 } // namespace MyGUI
180
181 #endif // __MYGUI_I_SUB_WIDGET_TEXT_H__
MyGUI::types::TCoord< int >
MyGUI::ISubWidgetText::getFontName
virtual const std::string & getFontName() const
Definition: MyGUI_ISubWidgetText.h:151
MyGUI::IntRect
types::TRect< int > IntRect
Definition: MyGUI_Types.h:47
MyGUI::ISubWidgetText::setInvertSelected
virtual void setInvertSelected(bool _value)
Definition: MyGUI_ISubWidgetText.h:69
MyGUI::types::TPoint< int >
MyGUI_Prerequest.h
MyGUI::ISubWidgetText::getCursorCoord
virtual IntCoord getCursorCoord(size_t _position)
Definition: MyGUI_ISubWidgetText.h:105
MyGUI::IntSize
types::TSize< int > IntSize
Definition: MyGUI_Types.h:44
MyGUI::ISubWidgetText::getShadowColour
virtual const Colour & getShadowColour() const
Definition: MyGUI_ISubWidgetText.h:172
MyGUI::types::TSize< int >
MyGUI::ISubWidgetText::setWordWrap
virtual void setWordWrap(bool _value)
Definition: MyGUI_ISubWidgetText.h:95
MyGUI::ISubWidgetText::setTextAlign
virtual void setTextAlign(Align _value)
Definition: MyGUI_ISubWidgetText.h:163
MyGUI::ISubWidgetText::setSelectBackground
virtual void setSelectBackground(bool _normal)
Definition: MyGUI_ISubWidgetText.h:61
MyGUI::ISubWidgetText::setShadowColour
virtual void setShadowColour(const Colour &_value)
Definition: MyGUI_ISubWidgetText.h:171
MyGUI::ISubWidget
Definition: MyGUI_ISubWidget.h:39
MyGUI::ISubWidgetText::getTextSelectionStart
virtual size_t getTextSelectionStart() const
Definition: MyGUI_ISubWidgetText.h:41
MyGUI::ISubWidgetText::getViewOffset
virtual IntPoint getViewOffset() const
Definition: MyGUI_ISubWidgetText.h:132
MyGUI::types::TCoord::width
T width
Definition: MyGUI_TCoord.h:39
MyGUI::ISubWidgetText::setCaption
virtual void setCaption(const UString &_value)
Definition: MyGUI_ISubWidgetText.h:137
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition: MyGUI_Types.h:50
MyGUI::ISubWidgetText::getTextColour
virtual const Colour & getTextColour() const
Definition: MyGUI_ISubWidgetText.h:145
MyGUI::Align::Default
Definition: MyGUI_Align.h:51
MyGUI::types::TCoord::top
T top
Definition: MyGUI_TCoord.h:38
MyGUI::ISubWidgetText::setTextSelection
virtual void setTextSelection(size_t _start, size_t _end)
Definition: MyGUI_ISubWidgetText.h:53
MyGUI::ISubWidgetText::setFontHeight
virtual void setFontHeight(int _value)
Definition: MyGUI_ISubWidgetText.h:157
MyGUI::ISubWidgetText::getShadow
virtual bool getShadow() const
Definition: MyGUI_ISubWidgetText.h:72
MyGUI::ISubWidgetText::setCursorPosition
virtual void setCursorPosition(size_t _index)
Definition: MyGUI_ISubWidgetText.h:93
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:88
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::ISubWidgetText::setVisibleCursor
virtual void setVisibleCursor(bool _value)
Definition: MyGUI_ISubWidgetText.h:85
MyGUI::types::TRect< int >
MyGUI::ISubWidgetText::getInvertSelected
virtual bool getInvertSelected() const
Definition: MyGUI_ISubWidgetText.h:64
MyGUI::ISubWidgetText::setShadow
virtual void setShadow(bool _value)
Definition: MyGUI_ISubWidgetText.h:77
MyGUI::ISubWidgetText::isVisibleCursor
virtual bool isVisibleCursor() const
Definition: MyGUI_ISubWidgetText.h:80
MyGUI::ISubWidgetText::setViewOffset
virtual void setViewOffset(const IntPoint &_point)
Definition: MyGUI_ISubWidgetText.h:131
MyGUI::ISubWidgetText::setFontName
virtual void setFontName(const std::string &_value)
Definition: MyGUI_ISubWidgetText.h:150
MyGUI::ISubWidgetText::getCursorPoint
IntPoint getCursorPoint(size_t _position)
Definition: MyGUI_ISubWidgetText.h:111
MyGUI::ISubWidgetText::getCursorPosition
virtual size_t getCursorPosition(const IntPoint &_point)
Definition: MyGUI_ISubWidgetText.h:99
MyGUI_Colour.h
MyGUI::ISubWidgetText::getTextAlign
virtual Align getTextAlign() const
Definition: MyGUI_ISubWidgetText.h:164
MyGUI::ISubWidgetText::getFontHeight
virtual int getFontHeight() const
Definition: MyGUI_ISubWidgetText.h:158
MyGUI::ISubWidgetText::setTextColour
virtual void setTextColour(const Colour &_value)
Definition: MyGUI_ISubWidgetText.h:144
MyGUI_ISubWidget.h
MyGUI::ISubWidgetText::getSelectBackground
virtual bool getSelectBackground() const
Definition: MyGUI_ISubWidgetText.h:56
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition: MyGUI_UString.h:169
MyGUI::ISubWidgetText
Definition: MyGUI_ISubWidgetText.h:32
MyGUI::ISubWidgetText::getCaption
virtual const UString & getCaption() const
Definition: MyGUI_ISubWidgetText.h:138
MyGUI::ISubWidgetText::getTextSelectionEnd
virtual size_t getTextSelectionEnd() const
Definition: MyGUI_ISubWidgetText.h:47
MyGUI::Align
Definition: MyGUI_Align.h:34
MyGUI::ISubWidgetText::setShiftText
virtual void setShiftText(bool _value)
Definition: MyGUI_ISubWidgetText.h:169
MyGUI::Colour
Definition: MyGUI_Colour.h:31
MyGUI::types::TCoord::left
T left
Definition: MyGUI_TCoord.h:37
MyGUI::Colour::Zero
static const Colour Zero
Definition: MyGUI_Colour.h:69
MyGUI::ISubWidgetText::getTextSize
virtual IntSize getTextSize()
Definition: MyGUI_ISubWidgetText.h:125
MyGUI::ISubWidgetText::getCursorRect
IntRect getCursorRect(size_t _position)
Definition: MyGUI_ISubWidgetText.h:118
MyGUI::ISubWidgetText::getCursorPosition
virtual size_t getCursorPosition() const
Definition: MyGUI_ISubWidgetText.h:88
MyGUI::types::TCoord::height
T height
Definition: MyGUI_TCoord.h:40
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition: MyGUI_Types.h:41