MyGUI
3.4.3
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
:
public
ISubWidgetText
26
{
27
MYGUI_RTTI_DERIVED
(
EditText
)
28
29
public
:
30
EditText
();
31
32
void
setVisible(
bool
_visible
)
override
;
33
34
// use in const methods, but actually might update object
35
void
updateRawData()
const
;
36
37
// метод для отрисовки себя
38
void
doRender()
override
;
39
40
void
setCaption(
const
UString
&
_value
)
override
;
41
const
UString
& getCaption()
const override
;
42
43
void
setTextColour(
const
Colour
&
_value
)
override
;
44
const
Colour
& getTextColour()
const override
;
45
46
void
setAlpha(
float
_value
)
override
;
47
48
void
setFontName(std::string_view
_value
)
override
;
49
std::string_view getFontName()
const override
;
50
51
void
setFontHeight(
int
_value
)
override
;
52
int
getFontHeight()
const override
;
53
54
void
createDrawItem(
ITexture
*
_texture
,
ILayerNode
*
_node
)
override
;
55
void
destroyDrawItem()
override
;
56
57
void
setTextAlign(
Align
_value
)
override
;
58
Align
getTextAlign()
const override
;
59
60
size_t
getTextSelectionStart()
const override
;
61
size_t
getTextSelectionEnd()
const override
;
62
void
setTextSelection(
size_t
_start
,
size_t
_end
)
override
;
63
64
bool
getSelectBackground()
const override
;
65
void
setSelectBackground(
bool
_normal
)
override
;
66
67
bool
isVisibleCursor()
const override
;
68
void
setVisibleCursor(
bool
_value
)
override
;
69
71
bool
getInvertSelected()
const override
;
75
void
setInvertSelected(
bool
_value
)
override
;
76
77
size_t
getCursorPosition()
const override
;
78
void
setCursorPosition(
size_t
_index
)
override
;
79
80
IntSize
getTextSize()
const override
;
81
82
// устанавливает смещение текста в пикселях
83
void
setViewOffset(
const
IntPoint
&
_point
)
override
;
84
IntPoint
getViewOffset()
const override
;
85
86
// возвращает положение курсора по произвольному положению
87
size_t
getCursorPosition(
const
IntPoint
&
_point
)
const override
;
88
89
// возвращает положение курсора в обсолютных координатах
90
IntCoord
getCursorCoord(
size_t
_position
)
const override
;
91
92
bool
getShadow()
const override
;
93
void
setShadow(
bool
_value
)
override
;
94
95
void
setShiftText(
bool
_value
)
override
;
96
97
void
setWordWrap(
bool
_value
)
override
;
98
99
void
setStateData(
IStateInfo
*
_data
)
override
;
100
101
void
setShadowColour(
const
Colour
&
_value
)
override
;
102
const
Colour
& getShadowColour()
const override
;
103
104
/*internal:*/
105
void
_updateView()
override
;
106
void
_correctView()
override
;
107
108
void
_setAlign(
const
IntSize
&
_oldsize
)
override
;
109
110
virtual
const
VectorLineInfo
& getLineInfo()
const
;
111
112
private
:
113
void
_setTextColour(
const
Colour
&
_value
);
114
void
checkVertexSize();
115
unsigned
int
getMixedNativeAlpha(
float
secondAlpha
)
const
;
116
117
void
drawQuad(
118
Vertex
*&
_vertex
,
119
size_t
&
_vertexCount
,
120
const
FloatRect
&
_vertexRect
,
121
float
_vertexZ
,
122
const
FloatRect
&
_textureRect
,
123
uint32
_colour
)
const
;
124
125
void
drawGlyph(
126
const
RenderTargetInfo
&
renderTargetInfo
,
127
Vertex
*&
_vertex
,
128
size_t
&
_vertexCount
,
129
FloatRect
_vertexRect
,
130
FloatRect
_textureRect
,
131
uint32
_colour
)
const
;
132
133
protected
:
134
bool
mEmptyView{
false
};
135
uint32
mCurrentColourNative{0xFFFFFFFF};
136
uint32
mInverseColourNative{0xFF000000};
137
uint32
mShadowColourNative{0x00000000};
138
IntCoord
mCurrentCoord
;
139
140
UString
mCaption
;
141
UString::utf32string
mUtf32Caption
;
142
mutable
bool
mTextOutDate{
false
};
143
Align
mTextAlign{Align::Default};
144
145
Colour
mColour{Colour::White};
146
Colour
mShadowColour{Colour::Black};
147
float
mAlpha{
ALPHA_MAX
};
148
VertexColourType
mVertexFormat
;
149
150
IFont
* mFont{
nullptr
};
151
ITexture
* mTexture{
nullptr
};
152
int
mFontHeight{0};
153
int
mCustomFontHeight = 0;
154
155
bool
mBackgroundNormal{
true
};
156
size_t
mStartSelect{0};
157
size_t
mEndSelect{0};
158
size_t
mCursorPosition{0};
159
bool
mVisibleCursor{
false
};
160
bool
mInvertSelect{
true
};
161
bool
mShadow{
false
};
162
163
IntPoint
mViewOffset
;
// смещение текста
164
165
ILayerNode
* mNode{
nullptr
};
166
RenderItem
* mRenderItem{
nullptr
};
167
size_t
mCountVertex
;
168
bool
mIsAddCursorWidth{
true
};
169
170
bool
mShiftText{
false
};
171
bool
mWordWrap{
false
};
172
bool
mManualColour{
false
};
173
int
mOldWidth{0};
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:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition
MyGUI_RTTI.h:69
MyGUI_RenderFormat.h
MyGUI_ResourceSkin.h
MyGUI_TextView.h
MyGUI_Types.h
MyGUI_VertexData.h
MyGUI_XmlDocument.h
MyGUI::EditText
Definition
MyGUI_EditText.h:26
MyGUI::EditText::mVertexFormat
VertexColourType mVertexFormat
Definition
MyGUI_EditText.h:148
MyGUI::EditText::mCaption
UString mCaption
Definition
MyGUI_EditText.h:140
MyGUI::EditText::mTextView
TextView mTextView
Definition
MyGUI_EditText.h:175
MyGUI::EditText::mViewOffset
IntPoint mViewOffset
Definition
MyGUI_EditText.h:163
MyGUI::EditText::mCountVertex
size_t mCountVertex
Definition
MyGUI_EditText.h:167
MyGUI::EditText::mUtf32Caption
UString::utf32string mUtf32Caption
Definition
MyGUI_EditText.h:141
MyGUI::EditText::mCurrentCoord
IntCoord mCurrentCoord
Definition
MyGUI_EditText.h:138
MyGUI::Enumerator
Definition
MyGUI_Enumerator.h:49
MyGUI::IFont
Definition
MyGUI_IFont.h:21
MyGUI::ILayerNode
Definition
MyGUI_ILayerNode.h:29
MyGUI::IStateInfo
Definition
MyGUI_IStateInfo.h:17
MyGUI::ISubWidgetText
Definition
MyGUI_ISubWidgetText.h:19
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:144
MyGUI::UString::utf32string
std::basic_string< unicode_char > utf32string
string type used for returning UTF-32 formatted data
Definition
MyGUI_UString.h:177
MyGUI
Definition
MyGUI_ActionController.h:15
MyGUI::uint32
uint32_t uint32
Definition
MyGUI_Types.h:48
MyGUI::VectorLineInfo
std::vector< LineInfo > VectorLineInfo
Definition
MyGUI_TextViewData.h:129
MyGUI::ALPHA_MAX
constexpr float ALPHA_MAX
Definition
MyGUI_Macros.h:20
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.10.0