MyGUI
3.4.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
include
MyGUI_EditText.h
Go to the documentation of this file.
1
/*
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5
*/
6
7
#ifndef MYGUI_EDIT_TEXT_H_
8
#define MYGUI_EDIT_TEXT_H_
9
10
#include "
MyGUI_Prerequest.h
"
11
#include "
MyGUI_XmlDocument.h
"
12
#include "
MyGUI_Types.h
"
13
#include "
MyGUI_ISubWidgetText.h
"
14
#include "
MyGUI_IFont.h
"
15
#include "
MyGUI_ResourceSkin.h
"
16
#include "
MyGUI_RenderFormat.h
"
17
#include "
MyGUI_TextView.h
"
18
#include "
MyGUI_VertexData.h
"
19
20
namespace
MyGUI
21
{
22
23
class
RenderItem;
24
25
class
MYGUI_EXPORT
EditText
:
26
public
ISubWidgetText
27
{
28
MYGUI_RTTI_DERIVED
(
EditText
)
29
30
public
:
31
EditText
();
32
33
void
setVisible(
bool
_value)
override
;
34
35
// use in const methods, but actually might update object
36
void
updateRawData()
const
;
37
38
// метод для отрисовки себя
39
void
doRender()
override
;
40
41
void
setCaption(
const
UString
& _value)
override
;
42
const
UString
& getCaption()
const override
;
43
44
void
setTextColour(
const
Colour
& _value)
override
;
45
const
Colour
& getTextColour()
const override
;
46
47
void
setAlpha(
float
_value)
override
;
48
49
void
setFontName(
const
std::string& _value)
override
;
50
const
std::string& getFontName()
const override
;
51
52
void
setFontHeight(
int
_value)
override
;
53
int
getFontHeight()
const override
;
54
55
void
createDrawItem(
ITexture
* _texture,
ILayerNode
* _node)
override
;
56
void
destroyDrawItem()
override
;
57
58
void
setTextAlign(
Align
_value)
override
;
59
Align
getTextAlign()
const override
;
60
61
size_t
getTextSelectionStart()
const override
;
62
size_t
getTextSelectionEnd()
const override
;
63
void
setTextSelection(
size_t
_start,
size_t
_end)
override
;
64
65
bool
getSelectBackground()
const override
;
66
void
setSelectBackground(
bool
_normal)
override
;
67
68
bool
isVisibleCursor()
const override
;
69
void
setVisibleCursor(
bool
_value)
override
;
70
72
bool
getInvertSelected()
const override
;
76
void
setInvertSelected(
bool
_value)
override
;
77
78
size_t
getCursorPosition()
const override
;
79
void
setCursorPosition(
size_t
_index)
override
;
80
81
IntSize
getTextSize()
const override
;
82
83
// устанавливает смещение текста в пикселях
84
void
setViewOffset(
const
IntPoint
& _point)
override
;
85
IntPoint
getViewOffset()
const override
;
86
87
// возвращает положение курсора по произвольному положению
88
size_t
getCursorPosition(
const
IntPoint
& _point)
const override
;
89
90
// возвращает положение курсора в обсолютных координатах
91
IntCoord
getCursorCoord(
size_t
_position)
const override
;
92
93
bool
getShadow()
const override
;
94
void
setShadow(
bool
_value)
override
;
95
96
void
setShiftText(
bool
_shift)
override
;
97
98
void
setWordWrap(
bool
_value)
override
;
99
100
void
setStateData(
IStateInfo
* _data)
override
;
101
102
void
setShadowColour(
const
Colour
& _value)
override
;
103
const
Colour
& getShadowColour()
const override
;
104
105
/*internal:*/
106
void
_updateView()
override
;
107
void
_correctView()
override
;
108
109
void
_setAlign(
const
IntSize
& _oldsize)
override
;
110
111
virtual
const
VectorLineInfo
& getLineInfo()
const
;
112
113
private
:
114
void
_setTextColour(
const
Colour
& _value);
115
void
checkVertexSize();
116
unsigned
int
getMixedNativeAlpha(
float
secondAlpha)
const
;
117
118
void
drawQuad(
119
Vertex
*& _vertex,
120
size_t
& _vertexCount,
121
const
FloatRect
& _vertexRect,
122
float
_vertexZ,
123
const
FloatRect
& _textureRect,
124
uint32
_colour)
const
;
125
126
void
drawGlyph(
127
const
RenderTargetInfo
& renderTargetInfo,
128
Vertex
*& _vertex,
129
size_t
& _vertexCount,
130
FloatRect
_vertexRect,
131
FloatRect
_textureRect,
132
uint32
_colour)
const
;
133
134
protected
:
135
bool
mEmptyView
;
136
uint32
mCurrentColourNative
;
137
uint32
mInverseColourNative
;
138
uint32
mShadowColourNative
;
139
IntCoord
mCurrentCoord
;
140
141
UString
mCaption
;
142
UString::utf32string
mUtf32Caption
;
143
mutable
bool
mTextOutDate
;
144
Align
mTextAlign
;
145
146
Colour
mColour
;
147
Colour
mShadowColour
;
148
float
mAlpha
;
149
VertexColourType
mVertexFormat
;
150
151
IFont
*
mFont
;
152
ITexture
*
mTexture
;
153
int
mFontHeight
;
154
155
bool
mBackgroundNormal
;
156
size_t
mStartSelect
;
157
size_t
mEndSelect
;
158
size_t
mCursorPosition
;
159
bool
mVisibleCursor
;
160
bool
mInvertSelect
;
161
bool
mShadow
;
162
163
IntPoint
mViewOffset
;
// смещение текста
164
165
ILayerNode
*
mNode
;
166
RenderItem
*
mRenderItem
;
167
size_t
mCountVertex
;
168
bool
mIsAddCursorWidth
;
169
170
bool
mShiftText
;
171
bool
mWordWrap
;
172
bool
mManualColour
;
173
int
mOldWidth
;
174
175
mutable
TextView
mTextView
;
176
};
177
178
}
// namespace MyGUI
179
180
#endif
// MYGUI_EDIT_TEXT_H_
MyGUI_IFont.h
MyGUI_ISubWidgetText.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition:
MyGUI_Platform.h:89
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition:
MyGUI_RTTI.h:48
MyGUI_RenderFormat.h
MyGUI_ResourceSkin.h
MyGUI_TextView.h
MyGUI_Types.h
MyGUI_VertexData.h
MyGUI_XmlDocument.h
MyGUI::EditText
Definition:
MyGUI_EditText.h:27
MyGUI::EditText::mBackgroundNormal
bool mBackgroundNormal
Definition:
MyGUI_EditText.h:155
MyGUI::EditText::mVertexFormat
VertexColourType mVertexFormat
Definition:
MyGUI_EditText.h:149
MyGUI::EditText::mShiftText
bool mShiftText
Definition:
MyGUI_EditText.h:170
MyGUI::EditText::mShadowColour
Colour mShadowColour
Definition:
MyGUI_EditText.h:147
MyGUI::EditText::mWordWrap
bool mWordWrap
Definition:
MyGUI_EditText.h:171
MyGUI::EditText::mCurrentColourNative
uint32 mCurrentColourNative
Definition:
MyGUI_EditText.h:136
MyGUI::EditText::mStartSelect
size_t mStartSelect
Definition:
MyGUI_EditText.h:156
MyGUI::EditText::mEmptyView
bool mEmptyView
Definition:
MyGUI_EditText.h:135
MyGUI::EditText::mFont
IFont * mFont
Definition:
MyGUI_EditText.h:151
MyGUI::EditText::mCaption
UString mCaption
Definition:
MyGUI_EditText.h:141
MyGUI::EditText::mInverseColourNative
uint32 mInverseColourNative
Definition:
MyGUI_EditText.h:137
MyGUI::EditText::mTextView
TextView mTextView
Definition:
MyGUI_EditText.h:175
MyGUI::EditText::mTexture
ITexture * mTexture
Definition:
MyGUI_EditText.h:152
MyGUI::EditText::mCursorPosition
size_t mCursorPosition
Definition:
MyGUI_EditText.h:158
MyGUI::EditText::mIsAddCursorWidth
bool mIsAddCursorWidth
Definition:
MyGUI_EditText.h:168
MyGUI::EditText::mNode
ILayerNode * mNode
Definition:
MyGUI_EditText.h:165
MyGUI::EditText::mTextOutDate
bool mTextOutDate
Definition:
MyGUI_EditText.h:143
MyGUI::EditText::mViewOffset
IntPoint mViewOffset
Definition:
MyGUI_EditText.h:163
MyGUI::EditText::mFontHeight
int mFontHeight
Definition:
MyGUI_EditText.h:153
MyGUI::EditText::mTextAlign
Align mTextAlign
Definition:
MyGUI_EditText.h:144
MyGUI::EditText::mCountVertex
size_t mCountVertex
Definition:
MyGUI_EditText.h:167
MyGUI::EditText::mShadow
bool mShadow
Definition:
MyGUI_EditText.h:161
MyGUI::EditText::mEndSelect
size_t mEndSelect
Definition:
MyGUI_EditText.h:157
MyGUI::EditText::mManualColour
bool mManualColour
Definition:
MyGUI_EditText.h:172
MyGUI::EditText::mOldWidth
int mOldWidth
Definition:
MyGUI_EditText.h:173
MyGUI::EditText::mInvertSelect
bool mInvertSelect
Definition:
MyGUI_EditText.h:160
MyGUI::EditText::mColour
Colour mColour
Definition:
MyGUI_EditText.h:146
MyGUI::EditText::mRenderItem
RenderItem * mRenderItem
Definition:
MyGUI_EditText.h:166
MyGUI::EditText::mShadowColourNative
uint32 mShadowColourNative
Definition:
MyGUI_EditText.h:138
MyGUI::EditText::mVisibleCursor
bool mVisibleCursor
Definition:
MyGUI_EditText.h:159
MyGUI::EditText::mUtf32Caption
UString::utf32string mUtf32Caption
Definition:
MyGUI_EditText.h:142
MyGUI::EditText::mAlpha
float mAlpha
Definition:
MyGUI_EditText.h:148
MyGUI::EditText::mCurrentCoord
IntCoord mCurrentCoord
Definition:
MyGUI_EditText.h:139
MyGUI::IFont
Definition:
MyGUI_IFont.h:22
MyGUI::ILayerNode
Definition:
MyGUI_ILayerNode.h:30
MyGUI::IStateInfo
Definition:
MyGUI_IStateInfo.h:18
MyGUI::ISubWidgetText
Definition:
MyGUI_ISubWidgetText.h:20
MyGUI::ITexture
Definition:
MyGUI_ITexture.h:28
MyGUI::RenderItem
Definition:
MyGUI_RenderItem.h:23
MyGUI::TextView
Definition:
MyGUI_TextView.h:19
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition:
MyGUI_UString.h:135
MyGUI::UString::utf32string
std::basic_string< unicode_char > utf32string
string type used for returning UTF-32 formatted data
Definition:
MyGUI_UString.h:168
MyGUI
Definition:
MyGUI_ActionController.h:15
MyGUI::VectorLineInfo
std::vector< LineInfo > VectorLineInfo
Definition:
MyGUI_TextViewData.h:137
MyGUI::uint32
uint32_t uint32
Definition:
MyGUI_Types.h:47
MyGUI::Align
Definition:
MyGUI_Align.h:20
MyGUI::Colour
Definition:
MyGUI_Colour.h:17
MyGUI::RenderTargetInfo
Definition:
MyGUI_RenderTargetInfo.h:16
MyGUI::VertexColourType
Definition:
MyGUI_RenderFormat.h:16
MyGUI::Vertex
Definition:
MyGUI_VertexData.h:17
MyGUI::types::TCoord< int >
MyGUI::types::TPoint< int >
MyGUI::types::TRect< float >
MyGUI::types::TSize< int >
Generated by
1.9.4