MyGUI_EditText.cpp
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_EditText.h"
#include "MyGUI_RenderItem.h"
#include "MyGUI_FontManager.h"
#include "MyGUI_RenderManager.h"
#include "MyGUI_LanguageManager.h"
#include "MyGUI_TextIterator.h"
#include "MyGUI_IRenderTarget.h"
#include "MyGUI_FontData.h"
#include "MyGUI_CommonStateInfo.h"
namespace MyGUI
{
const size_t SIMPLETEXT_COUNT_VERTEX = 32 * VertexQuad::VertexCount;
EditText::EditText() :
mCountVertex(SIMPLETEXT_COUNT_VERTEX)
{
mVertexFormat = RenderManager::getInstance().getVertexFormat();
}
void EditText::setVisible(bool _visible)
{
if (mVisible == _visible)
return;
mVisible = _visible;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::_correctView()
{
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::_setAlign(const IntSize& _oldsize)
{
if (mWordWrap)
{
// передается старая координата всегда
int width = mCroppedParent->getWidth();
if (mOldWidth != width)
{
mOldWidth = width;
mTextOutDate = true;
}
}
// первоначальное выравнивание
if (mAlign.isHStretch())
{
// растягиваем
mCoord.width = mCoord.width + (mCroppedParent->getWidth() - _oldsize.width);
mIsMargin = true; // при изменении размеров все пересчитывать
}
else if (mAlign.isRight())
{
// двигаем по правому краю
mCoord.left = mCoord.left + (mCroppedParent->getWidth() - _oldsize.width);
}
else if (mAlign.isHCenter())
{
// выравнивание по горизонтали без растяжения
mCoord.left = (mCroppedParent->getWidth() - mCoord.width) / 2;
}
if (mAlign.isVStretch())
{
// растягиваем
mCoord.height = mCoord.height + (mCroppedParent->getHeight() - _oldsize.height);
mIsMargin = true; // при изменении размеров все пересчитывать
}
else if (mAlign.isBottom())
{
// двигаем по нижнему краю
mCoord.top = mCoord.top + (mCroppedParent->getHeight() - _oldsize.height);
}
else if (mAlign.isVCenter())
{
// выравнивание по вертикали без растяжения
mCoord.top = (mCroppedParent->getHeight() - mCoord.height) / 2;
}
mCurrentCoord = mCoord;
_updateView();
}
void EditText::_updateView()
{
bool margin = _checkMargin();
mEmptyView = ((0 >= _getViewWidth()) || (0 >= _getViewHeight()));
mCurrentCoord.left = mCoord.left + mMargin.left;
mCurrentCoord.top = mCoord.top + mMargin.top;
// вьюпорт стал битым
if (margin)
{
// проверка на полный выход за границу
if (_checkOutside())
{
// запоминаем текущее состояние
mIsMargin = margin;
// обновить перед выходом
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
return;
}
}
// мы обрезаны или были обрезаны
if (mIsMargin || margin)
{
mCurrentCoord.width = _getViewWidth();
mCurrentCoord.height = _getViewHeight();
}
// запоминаем текущее состояние
mIsMargin = margin;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::setCaption(const UString& _value)
{
mCaption = _value;
mUtf32Caption = mCaption.asUTF32();
mTextOutDate = true;
checkVertexSize();
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::checkVertexSize()
{
// reallocate if we need more vertices (extra vertices for selection * 2 and cursor)
size_t need = (mUtf32Caption.size() * (mShadow ? 3 : 2) + 2) * VertexQuad::VertexCount;
if (mCountVertex < need)
{
mCountVertex = need + SIMPLETEXT_COUNT_VERTEX;
if (nullptr != mRenderItem)
mRenderItem->reallockDrawItem(this, mCountVertex);
}
}
unsigned int EditText::getMixedNativeAlpha(float secondAlpha) const
{
return (uint8)(mAlpha * secondAlpha * 255) << 24;
}
const UString& EditText::getCaption() const
{
return mCaption;
}
void EditText::setTextColour(const Colour& _value)
{
mManualColour = true;
_setTextColour(_value);
}
void EditText::_setTextColour(const Colour& _value)
{
if (mColour == _value)
return;
mColour = _value;
mCurrentColourNative = texture_utility::toNativeColour(mColour, mVertexFormat);
mCurrentColourNative = (mCurrentColourNative & 0x00FFFFFF) | getMixedNativeAlpha(mColour.alpha);
mInverseColourNative = mCurrentColourNative ^ 0x00FFFFFF;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
const Colour& EditText::getTextColour() const
{
return mColour;
}
void EditText::setAlpha(float _value)
{
if (mAlpha == _value)
return;
mAlpha = _value;
mCurrentColourNative = (mCurrentColourNative & 0x00FFFFFF) | getMixedNativeAlpha(mColour.alpha);
mShadowColourNative = (mShadowColourNative & 0x00FFFFFF) | getMixedNativeAlpha(mShadowColour.alpha);
mInverseColourNative = mCurrentColourNative ^ 0x00FFFFFF;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::setFontName(std::string_view _value)
{
mTexture = nullptr;
mFont = FontManager::getInstance().getByName(_value);
if (mFont != nullptr)
{
mTexture = mFont->getTextureFont();
// set default font height
if (mFont->getDefaultHeight() != 0 && !mCustomFontHeight)
{
mFontHeight = mFont->getDefaultHeight();
}
}
mTextOutDate = true;
// если мы были приаттаченны, то удаляем себя
if (nullptr != mRenderItem)
{
mRenderItem->removeDrawItem(this);
mRenderItem = nullptr;
}
// если есть текстура, то приаттачиваемся
if (nullptr != mTexture && nullptr != mNode)
{
mRenderItem = mNode->addToRenderItem(mTexture, false, false);
mRenderItem->addDrawItem(this, mCountVertex);
}
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
std::string_view EditText::getFontName() const
{
return mFont->getResourceName();
}
void EditText::setFontHeight(int _value)
{
mCustomFontHeight = _value;
if (!mCustomFontHeight && mFont)
mFontHeight = mFont->getDefaultHeight();
else
mFontHeight = _value;
mTextOutDate = true;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
int EditText::getFontHeight() const
{
return mFontHeight;
}
void EditText::createDrawItem(ITexture* _texture, ILayerNode* _node)
{
mNode = _node;
// если уже есть текстура, то атачимся, актуально для смены леера
if (nullptr != mTexture)
{
MYGUI_ASSERT(!mRenderItem, "mRenderItem must be nullptr");
mRenderItem = mNode->addToRenderItem(mTexture, false, false);
mRenderItem->addDrawItem(this, mCountVertex);
}
}
void EditText::destroyDrawItem()
{
if (nullptr != mRenderItem)
{
mRenderItem->removeDrawItem(this);
mRenderItem = nullptr;
}
mNode = nullptr;
}
size_t EditText::getTextSelectionStart() const
{
return mStartSelect;
}
size_t EditText::getTextSelectionEnd() const
{
return mEndSelect;
}
void EditText::setTextSelection(size_t _start, size_t _end)
{
mStartSelect = _start;
mEndSelect = _end;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
bool EditText::getSelectBackground() const
{
return mBackgroundNormal;
}
void EditText::setSelectBackground(bool _normal)
{
if (mBackgroundNormal == _normal)
return;
mBackgroundNormal = _normal;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
bool EditText::isVisibleCursor() const
{
return mVisibleCursor;
}
void EditText::setVisibleCursor(bool _value)
{
if (mVisibleCursor == _value)
return;
mVisibleCursor = _value;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
size_t EditText::getCursorPosition() const
{
return mCursorPosition;
}
void EditText::setCursorPosition(size_t _index)
{
if (mCursorPosition == _index)
return;
mCursorPosition = _index;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::setTextAlign(Align _value)
{
mTextAlign = _value;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
Align EditText::getTextAlign() const
{
return mTextAlign;
}
IntSize EditText::getTextSize() const
{
// если нуно обновить, или изменились пропорции экрана
if (mTextOutDate)
updateRawData();
IntSize size = mTextView.getViewSize();
// плюс размер курсора
if (mIsAddCursorWidth)
size.width += 2;
if (mShadow)
{
if (!mIsAddCursorWidth)
size.width++;
size.height++;
}
return size;
}
const VectorLineInfo& EditText::getLineInfo() const
{
return mTextView.getData();
}
void EditText::setViewOffset(const IntPoint& _point)
{
mViewOffset = _point;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
IntPoint EditText::getViewOffset() const
{
return mViewOffset;
}
size_t EditText::getCursorPosition(const IntPoint& _point) const
{
if (nullptr == mFont)
return 0;
if (mTextOutDate)
updateRawData();
IntPoint point = _point;
point -= mCroppedParent->getAbsolutePosition();
point += mViewOffset;
point -= mCoord.point();
return mTextView.getCursorPosition(point);
}
IntCoord EditText::getCursorCoord(size_t _position) const
{
if (nullptr == mFont)
return {};
if (mTextOutDate)
updateRawData();
IntPoint point = mTextView.getCursorPoint(_position);
point += mCroppedParent->getAbsolutePosition();
point -= mViewOffset;
point += mCoord.point();
return {point.left, point.top, 2, mFontHeight};
}
void EditText::setShiftText(bool _value)
{
if (mShiftText == _value)
return;
mShiftText = _value;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::setWordWrap(bool _value)
{
mWordWrap = _value;
mTextOutDate = true;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::updateRawData() const
{
if (nullptr == mFont)
return;
// сбрасывам флаги
mTextOutDate = false;
int width = -1;
if (mWordWrap)
{
width = mCoord.width;
// обрезать слова нужно по шарине, которую мы реально используем
if (mIsAddCursorWidth)
width -= 2;
}
mTextView.update(mUtf32Caption, mFont, mFontHeight, mTextAlign, mVertexFormat, width);
}
void EditText::setStateData(IStateInfo* _data)
{
EditTextStateInfo* data = _data->castType<EditTextStateInfo>();
if (!mManualColour && data->getColour() != Colour::Zero)
_setTextColour(data->getColour());
setShiftText(data->getShift());
}
void EditText::doRender()
{
if (nullptr == mFont || !mVisible || mEmptyView)
return;
if (mRenderItem->getCurrentUpdate() || mTextOutDate)
updateRawData();
Vertex* vertex = mRenderItem->getCurrentVertexBuffer();
const RenderTargetInfo& renderTargetInfo = mRenderItem->getRenderTarget()->getInfo();
// колличество отрисованных вершин
size_t vertexCount = 0;
// текущие цвета
uint32 colour = mCurrentColourNative;
uint32 inverseColour = mInverseColourNative;
uint32 selectedColour = mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
const VectorLineInfo& textViewData = mTextView.getData();
float top = (float)(-mViewOffset.top + mCoord.top);
FloatRect vertexRect;
const FloatRect& selectedUVRect =
mFont->getGlyphInfo(mBackgroundNormal ? FontCodeType::Selected : FontCodeType::SelectedBack)->uvRect;
size_t index = 0;
for (const auto& line : textViewData)
{
float left = (float)(line.offset - mViewOffset.left + mCoord.left);
for (const auto& sym : line.symbols)
{
if (sym.isColour())
{
colour = sym.getColour() | (colour & 0xFF000000);
inverseColour = colour ^ 0x00FFFFFF;
selectedColour = mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
continue;
}
// смещение текстуры для фона
bool select = index >= mStartSelect && index < mEndSelect;
float fullAdvance = sym.getBearingX() + sym.getAdvance();
// Render the selection, if any, first.
if (select)
{
vertexRect.set(left, top, left + fullAdvance, top + (float)mFontHeight);
drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, selectedUVRect, selectedColour);
}
// Render the glyph shadow, if any.
if (mShadow)
{
vertexRect.left = left + sym.getBearingX() + 1.0f;
vertexRect.top = top + sym.getBearingY() + 1.0f;
vertexRect.right = vertexRect.left + sym.getWidth();
vertexRect.bottom = vertexRect.top + sym.getHeight();
drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sym.getUVRect(), mShadowColourNative);
}
// Render the glyph itself.
vertexRect.left = left + sym.getBearingX();
vertexRect.top = top + sym.getBearingY();
vertexRect.right = vertexRect.left + sym.getWidth();
vertexRect.bottom = vertexRect.top + sym.getHeight();
drawGlyph(
renderTargetInfo,
vertex,
vertexCount,
vertexRect,
sym.getUVRect(),
(!select || !mInvertSelect) ? colour : inverseColour);
left += fullAdvance;
++index;
}
top += mFontHeight;
++index;
}
// Render the cursor, if any, last.
if (mVisibleCursor)
{
IntPoint point = mTextView.getCursorPoint(mCursorPosition) - mViewOffset + mCoord.point();
const GlyphInfo* cursorGlyph = mFont->getGlyphInfo(static_cast<Char>(FontCodeType::Cursor));
vertexRect.set(
(float)point.left,
(float)point.top,
(float)point.left + cursorGlyph->width,
(float)(point.top + mFontHeight));
drawGlyph(
renderTargetInfo,
vertex,
vertexCount,
vertexRect,
cursorGlyph->uvRect,
mCurrentColourNative | 0x00FFFFFF);
}
// колличество реально отрисованных вершин
mRenderItem->setLastVertexCount(vertexCount);
}
void EditText::setInvertSelected(bool _value)
{
if (mInvertSelect == _value)
return;
mInvertSelect = _value;
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
bool EditText::getInvertSelected() const
{
return mInvertSelect;
}
bool EditText::getShadow() const
{
return mShadow;
}
void EditText::setShadow(bool _value)
{
mShadow = _value;
mTextOutDate = true;
checkVertexSize();
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
void EditText::setShadowColour(const Colour& _value)
{
mShadowColour = _value;
mShadowColourNative = texture_utility::toNativeColour(mShadowColour, mVertexFormat);
mShadowColourNative = (mShadowColourNative & 0x00FFFFFF) | getMixedNativeAlpha(mShadowColour.alpha);
if (nullptr != mNode)
mNode->outOfDate(mRenderItem);
}
const Colour& EditText::getShadowColour() const
{
return mShadowColour;
}
void EditText::drawQuad(
Vertex*& _vertex,
size_t& _vertexCount,
const FloatRect& _vertexRect,
float _vertexZ,
const FloatRect& _textureRect,
uint32 _colour) const
{
_vertex[0].x = _vertexRect.left;
_vertex[0].y = _vertexRect.top;
_vertex[0].z = _vertexZ;
_vertex[0].colour = _colour;
_vertex[0].u = _textureRect.left;
_vertex[0].v = _textureRect.top;
_vertex[2].x = _vertexRect.left;
_vertex[2].y = _vertexRect.bottom;
_vertex[2].z = _vertexZ;
_vertex[2].colour = _colour;
_vertex[2].u = _textureRect.left;
_vertex[2].v = _textureRect.bottom;
_vertex[1].x = _vertexRect.right;
_vertex[1].y = _vertexRect.top;
_vertex[1].z = _vertexZ;
_vertex[1].colour = _colour;
_vertex[1].u = _textureRect.right;
_vertex[1].v = _textureRect.top;
_vertex[3].x = _vertexRect.right;
_vertex[3].y = _vertexRect.top;
_vertex[3].z = _vertexZ;
_vertex[3].colour = _colour;
_vertex[3].u = _textureRect.right;
_vertex[3].v = _textureRect.top;
_vertex[5].x = _vertexRect.left;
_vertex[5].y = _vertexRect.bottom;
_vertex[5].z = _vertexZ;
_vertex[5].colour = _colour;
_vertex[5].u = _textureRect.left;
_vertex[5].v = _textureRect.bottom;
_vertex[4].x = _vertexRect.right;
_vertex[4].y = _vertexRect.bottom;
_vertex[4].z = _vertexZ;
_vertex[4].colour = _colour;
_vertex[4].u = _textureRect.right;
_vertex[4].v = _textureRect.bottom;
_vertex += VertexQuad::VertexCount;
_vertexCount += VertexQuad::VertexCount;
}
void EditText::drawGlyph(
const RenderTargetInfo& _renderTargetInfo,
Vertex*& _vertex,
size_t& _vertexCount,
FloatRect _vertexRect,
FloatRect _textureRect,
uint32 _colour) const
{
// символ залазиет влево
float leftClip = (float)mCurrentCoord.left - _vertexRect.left;
if (leftClip > 0.0f)
{
if ((float)mCurrentCoord.left < _vertexRect.right)
{
_textureRect.left += _textureRect.width() * leftClip / _vertexRect.width();
_vertexRect.left += leftClip;
}
else
{
return;
}
}
// символ залазиет вправо
float rightClip = _vertexRect.right - (float)mCurrentCoord.right();
if (rightClip > 0.0f)
{
if (_vertexRect.left < (float)mCurrentCoord.right())
{
_textureRect.right -= _textureRect.width() * rightClip / _vertexRect.width();
_vertexRect.right -= rightClip;
}
else
{
return;
}
}
// символ залазиет вверх
float topClip = (float)mCurrentCoord.top - _vertexRect.top;
if (topClip > 0.0f)
{
if ((float)mCurrentCoord.top < _vertexRect.bottom)
{
_textureRect.top += _textureRect.height() * topClip / _vertexRect.height();
_vertexRect.top += topClip;
}
else
{
return;
}
}
// символ залазиет вниз
float bottomClip = _vertexRect.bottom - (float)mCurrentCoord.bottom();
if (bottomClip > 0.0f)
{
if (_vertexRect.top < (float)mCurrentCoord.bottom())
{
_textureRect.bottom -= _textureRect.height() * bottomClip / _vertexRect.height();
_vertexRect.bottom -= bottomClip;
}
else
{
return;
}
}
float pix_left = mCroppedParent->getAbsoluteLeft() - _renderTargetInfo.leftOffset + _vertexRect.left;
float pix_top = mCroppedParent->getAbsoluteTop() - _renderTargetInfo.topOffset + (mShiftText ? 1.0f : 0.0f) +
_vertexRect.top;
FloatRect vertexRect(
((_renderTargetInfo.pixScaleX * pix_left + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
-(((_renderTargetInfo.pixScaleY * pix_top + _renderTargetInfo.vOffset) * 2.0f) - 1.0f),
((_renderTargetInfo.pixScaleX * (pix_left + _vertexRect.width()) + _renderTargetInfo.hOffset) * 2.0f) -
1.0f,
-(((_renderTargetInfo.pixScaleY * (pix_top + _vertexRect.height()) + _renderTargetInfo.vOffset) * 2.0f) -
1.0f));
drawQuad(_vertex, _vertexCount, vertexRect, mNode->getNodeDepth(), _textureRect, _colour);
}
} // namespace MyGUI
MyGUI_CommonStateInfo.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:31
MyGUI_EditText.h
MyGUI_FontData.h
MyGUI_FontManager.h
MyGUI_IRenderTarget.h
MyGUI_LanguageManager.h
MyGUI_Precompiled.h
MyGUI_RenderItem.h
MyGUI_RenderManager.h
MyGUI_TextIterator.h
MyGUI::EditText::mBackgroundNormal
bool mBackgroundNormal
Definition MyGUI_EditText.h:155
MyGUI::EditText::setTextColour
void setTextColour(const Colour &_value) override
Definition MyGUI_EditText.cpp:170
MyGUI::EditText::mVertexFormat
VertexColourType mVertexFormat
Definition MyGUI_EditText.h:148
MyGUI::EditText::mCustomFontHeight
int mCustomFontHeight
Definition MyGUI_EditText.h:153
MyGUI::EditText::mShiftText
bool mShiftText
Definition MyGUI_EditText.h:170
MyGUI::EditText::mShadowColour
Colour mShadowColour
Definition MyGUI_EditText.h:146
MyGUI::EditText::getTextSelectionEnd
size_t getTextSelectionEnd() const override
Definition MyGUI_EditText.cpp:296
MyGUI::EditText::mWordWrap
bool mWordWrap
Definition MyGUI_EditText.h:171
MyGUI::EditText::setAlpha
void setAlpha(float _value) override
Definition MyGUI_EditText.cpp:196
MyGUI::EditText::mCurrentColourNative
uint32 mCurrentColourNative
Definition MyGUI_EditText.h:135
MyGUI::EditText::mStartSelect
size_t mStartSelect
Definition MyGUI_EditText.h:156
MyGUI::EditText::setFontName
void setFontName(std::string_view _value) override
Definition MyGUI_EditText.cpp:210
MyGUI::EditText::setSelectBackground
void setSelectBackground(bool _normal) override
Definition MyGUI_EditText.cpp:315
MyGUI::EditText::setTextSelection
void setTextSelection(size_t _start, size_t _end) override
Definition MyGUI_EditText.cpp:301
MyGUI::EditText::setWordWrap
void setWordWrap(bool _value) override
Definition MyGUI_EditText.cpp:449
MyGUI::EditText::_setAlign
void _setAlign(const IntSize &_oldsize) override
Definition MyGUI_EditText.cpp:45
MyGUI::EditText::isVisibleCursor
bool isVisibleCursor() const override
Definition MyGUI_EditText.cpp:325
MyGUI::EditText::getShadow
bool getShadow() const override
Definition MyGUI_EditText.cpp:615
MyGUI::EditText::mEmptyView
bool mEmptyView
Definition MyGUI_EditText.h:134
MyGUI::EditText::mFont
IFont * mFont
Definition MyGUI_EditText.h:150
MyGUI::EditText::getCursorCoord
IntCoord getCursorCoord(size_t _position) const override
Definition MyGUI_EditText.cpp:423
MyGUI::EditText::_correctView
void _correctView() override
Definition MyGUI_EditText.cpp:39
MyGUI::EditText::setVisible
void setVisible(bool _visible) override
Definition MyGUI_EditText.cpp:29
MyGUI::EditText::getLineInfo
virtual const VectorLineInfo & getLineInfo() const
Definition MyGUI_EditText.cpp:389
MyGUI::EditText::setInvertSelected
void setInvertSelected(bool _value) override
Definition MyGUI_EditText.cpp:600
MyGUI::EditText::mCaption
UString mCaption
Definition MyGUI_EditText.h:140
MyGUI::EditText::getTextColour
const Colour & getTextColour() const override
Definition MyGUI_EditText.cpp:191
MyGUI::EditText::setFontHeight
void setFontHeight(int _value) override
Definition MyGUI_EditText.cpp:250
MyGUI::EditText::mInverseColourNative
uint32 mInverseColourNative
Definition MyGUI_EditText.h:136
MyGUI::EditText::mTextView
TextView mTextView
Definition MyGUI_EditText.h:175
MyGUI::EditText::getShadowColour
const Colour & getShadowColour() const override
Definition MyGUI_EditText.cpp:642
MyGUI::EditText::mTexture
ITexture * mTexture
Definition MyGUI_EditText.h:151
MyGUI::EditText::mCursorPosition
size_t mCursorPosition
Definition MyGUI_EditText.h:158
MyGUI::EditText::mIsAddCursorWidth
bool mIsAddCursorWidth
Definition MyGUI_EditText.h:168
MyGUI::EditText::setShadowColour
void setShadowColour(const Colour &_value) override
Definition MyGUI_EditText.cpp:631
MyGUI::EditText::mNode
ILayerNode * mNode
Definition MyGUI_EditText.h:165
MyGUI::EditText::getCaption
const UString & getCaption() const override
Definition MyGUI_EditText.cpp:165
MyGUI::EditText::mTextOutDate
bool mTextOutDate
Definition MyGUI_EditText.h:142
MyGUI::EditText::mViewOffset
IntPoint mViewOffset
Definition MyGUI_EditText.h:163
MyGUI::EditText::getInvertSelected
bool getInvertSelected() const override
Definition MyGUI_EditText.cpp:610
MyGUI::EditText::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_EditText.cpp:136
MyGUI::EditText::setTextAlign
void setTextAlign(Align _value) override
Definition MyGUI_EditText.cpp:355
MyGUI::EditText::mFontHeight
int mFontHeight
Definition MyGUI_EditText.h:152
MyGUI::EditText::mTextAlign
Align mTextAlign
Definition MyGUI_EditText.h:143
MyGUI::EditText::setStateData
void setStateData(IStateInfo *_data) override
Definition MyGUI_EditText.cpp:477
MyGUI::EditText::getFontHeight
int getFontHeight() const override
Definition MyGUI_EditText.cpp:263
MyGUI::EditText::getTextSelectionStart
size_t getTextSelectionStart() const override
Definition MyGUI_EditText.cpp:291
MyGUI::EditText::doRender
void doRender() override
Definition MyGUI_EditText.cpp:485
MyGUI::EditText::getViewOffset
IntPoint getViewOffset() const override
Definition MyGUI_EditText.cpp:402
MyGUI::EditText::mCountVertex
size_t mCountVertex
Definition MyGUI_EditText.h:167
MyGUI::EditText::setVisibleCursor
void setVisibleCursor(bool _value) override
Definition MyGUI_EditText.cpp:330
MyGUI::EditText::getFontName
std::string_view getFontName() const override
Definition MyGUI_EditText.cpp:245
MyGUI::EditText::mShadow
bool mShadow
Definition MyGUI_EditText.h:161
MyGUI::EditText::getSelectBackground
bool getSelectBackground() const override
Definition MyGUI_EditText.cpp:310
MyGUI::EditText::getTextSize
IntSize getTextSize() const override
Definition MyGUI_EditText.cpp:368
MyGUI::EditText::mEndSelect
size_t mEndSelect
Definition MyGUI_EditText.h:157
MyGUI::EditText::mManualColour
bool mManualColour
Definition MyGUI_EditText.h:172
MyGUI::EditText::getCursorPosition
size_t getCursorPosition() const override
Definition MyGUI_EditText.cpp:340
MyGUI::EditText::EditText
EditText()
Definition MyGUI_EditText.cpp:23
MyGUI::EditText::setViewOffset
void setViewOffset(const IntPoint &_point) override
Definition MyGUI_EditText.cpp:394
MyGUI::EditText::mOldWidth
int mOldWidth
Definition MyGUI_EditText.h:173
MyGUI::EditText::getTextAlign
Align getTextAlign() const override
Definition MyGUI_EditText.cpp:363
MyGUI::EditText::_updateView
void _updateView() override
Definition MyGUI_EditText.cpp:97
MyGUI::EditText::mInvertSelect
bool mInvertSelect
Definition MyGUI_EditText.h:160
MyGUI::EditText::mColour
Colour mColour
Definition MyGUI_EditText.h:145
MyGUI::EditText::mRenderItem
RenderItem * mRenderItem
Definition MyGUI_EditText.h:166
MyGUI::EditText::setShiftText
void setShiftText(bool _value) override
Definition MyGUI_EditText.cpp:439
MyGUI::EditText::mShadowColourNative
uint32 mShadowColourNative
Definition MyGUI_EditText.h:137
MyGUI::EditText::mVisibleCursor
bool mVisibleCursor
Definition MyGUI_EditText.h:159
MyGUI::EditText::mUtf32Caption
UString::utf32string mUtf32Caption
Definition MyGUI_EditText.h:141
MyGUI::EditText::mAlpha
float mAlpha
Definition MyGUI_EditText.h:147
MyGUI::EditText::createDrawItem
void createDrawItem(ITexture *_texture, ILayerNode *_node) override
Definition MyGUI_EditText.cpp:268
MyGUI::EditText::setCursorPosition
void setCursorPosition(size_t _index) override
Definition MyGUI_EditText.cpp:345
MyGUI::EditText::setShadow
void setShadow(bool _value) override
Definition MyGUI_EditText.cpp:620
MyGUI::EditText::mCurrentCoord
IntCoord mCurrentCoord
Definition MyGUI_EditText.h:138
MyGUI::EditText::updateRawData
void updateRawData() const
Definition MyGUI_EditText.cpp:458
MyGUI::EditText::destroyDrawItem
void destroyDrawItem() override
Definition MyGUI_EditText.cpp:281
MyGUI::EditTextStateInfo
Definition MyGUI_CommonStateInfo.h:165
MyGUI::EditTextStateInfo::getColour
const Colour & getColour() const
Definition MyGUI_CommonStateInfo.h:169
MyGUI::EditTextStateInfo::getShift
bool getShift() const
Definition MyGUI_CommonStateInfo.h:174
MyGUI::FontManager::getInstance
static FontManager & getInstance()
MyGUI::FontManager::getByName
IFont * getByName(std::string_view _name) const
Definition MyGUI_FontManager.cpp:89
MyGUI::ICroppedRectangle::mIsMargin
bool mIsMargin
Definition MyGUI_ICroppedRectangle.h:248
MyGUI::ICroppedRectangle::mCoord
IntCoord mCoord
Definition MyGUI_ICroppedRectangle.h:245
MyGUI::ICroppedRectangle::mMargin
IntRect mMargin
Definition MyGUI_ICroppedRectangle.h:244
MyGUI::ICroppedRectangle::_checkMargin
bool _checkMargin()
Definition MyGUI_ICroppedRectangle.h:184
MyGUI::ICroppedRectangle::_checkOutside
bool _checkOutside() const
Definition MyGUI_ICroppedRectangle.h:234
MyGUI::ICroppedRectangle::mCroppedParent
ICroppedRectangle * mCroppedParent
Definition MyGUI_ICroppedRectangle.h:249
MyGUI::ICroppedRectangle::_getViewWidth
int _getViewWidth() const
Definition MyGUI_ICroppedRectangle.h:148
MyGUI::ICroppedRectangle::_getViewHeight
int _getViewHeight() const
Definition MyGUI_ICroppedRectangle.h:152
MyGUI::ILayerNode
Definition MyGUI_ILayerNode.h:29
MyGUI::ILayerNode::outOfDate
virtual void outOfDate(RenderItem *_item)=0
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::IStateInfo
Definition MyGUI_IStateInfo.h:17
MyGUI::ISubWidget::mAlign
Align mAlign
Definition MyGUI_ISubWidget.h:67
MyGUI::ISubWidget::mVisible
bool mVisible
Definition MyGUI_ISubWidget.h:68
MyGUI::ITexture
Definition MyGUI_ITexture.h:28
MyGUI::RenderItem::reallockDrawItem
void reallockDrawItem(ISubWidget *_item, size_t _count)
Definition MyGUI_RenderItem.cpp:129
MyGUI::RenderManager::getVertexFormat
virtual VertexColourType getVertexFormat() const =0
MyGUI::RenderManager::getInstance
static RenderManager & getInstance()
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:144
MyGUI::FontCodeType::Selected
@ Selected
Definition MyGUI_FontData.h:30
MyGUI::FontCodeType::Cursor
@ Cursor
Definition MyGUI_FontData.h:32
MyGUI::FontCodeType::SelectedBack
@ SelectedBack
Definition MyGUI_FontData.h:31
MyGUI::texture_utility::toNativeColour
uint32 toNativeColour(const Colour &_colour, VertexColourType _format)
Convert Colour to 32-bit representation.
Definition MyGUI_TextureUtility.cpp:63
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::uint32
uint32_t uint32
Definition MyGUI_Types.h:48
MyGUI::uint8
uint8_t uint8
Definition MyGUI_Types.h:46
MyGUI::VectorLineInfo
std::vector< LineInfo > VectorLineInfo
Definition MyGUI_TextViewData.h:129
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::FloatRect
types::TRect< float > FloatRect
Definition MyGUI_Types.h:34
MyGUI::Char
unsigned int Char
Definition MyGUI_Types.h:50
MyGUI::SIMPLETEXT_COUNT_VERTEX
const size_t SIMPLETEXT_COUNT_VERTEX
Definition MyGUI_EditText.cpp:21
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::Align
Definition MyGUI_Align.h:20
MyGUI::Colour
Definition MyGUI_Colour.h:17
MyGUI::Colour::Zero
static const Colour Zero
Definition MyGUI_Colour.h:53
MyGUI::Colour::alpha
float alpha
Definition MyGUI_Colour.h:51
MyGUI::GlyphInfo
Definition MyGUI_FontData.h:41
MyGUI::GlyphInfo::uvRect
FloatRect uvRect
Definition MyGUI_FontData.h:66
MyGUI::GlyphInfo::width
float width
Definition MyGUI_FontData.h:61
MyGUI::RenderTargetInfo
Definition MyGUI_RenderTargetInfo.h:16
MyGUI::Vertex
Definition MyGUI_VertexData.h:17
MyGUI::Vertex::y
float y
Definition MyGUI_VertexData.h:28
MyGUI::Vertex::v
float v
Definition MyGUI_VertexData.h:30
MyGUI::Vertex::x
float x
Definition MyGUI_VertexData.h:28
MyGUI::Vertex::colour
uint32 colour
Definition MyGUI_VertexData.h:29
MyGUI::Vertex::z
float z
Definition MyGUI_VertexData.h:28
MyGUI::Vertex::u
float u
Definition MyGUI_VertexData.h:30
MyGUI::VertexQuad::VertexCount
@ VertexCount
Definition MyGUI_VertexData.h:43
MyGUI::types::TCoord::left
T left
Definition MyGUI_TCoord.h:20
MyGUI::types::TPoint::left
T left
Definition MyGUI_TPoint.h:19
MyGUI::types::TPoint::top
T top
Definition MyGUI_TPoint.h:20
MyGUI::types::TRect::right
T right
Definition MyGUI_TRect.h:21
MyGUI::types::TRect::set
void set(T const &_left, T const &_top, T const &_right, T const &_bottom)
Definition MyGUI_TRect.h:98
MyGUI::types::TRect::left
T left
Definition MyGUI_TRect.h:19
MyGUI::types::TRect::bottom
T bottom
Definition MyGUI_TRect.h:22
MyGUI::types::TRect::top
T top
Definition MyGUI_TRect.h:20
MyGUI::types::TSize::width
T width
Definition MyGUI_TSize.h:19
MyGUI::types::TSize::height
T height
Definition MyGUI_TSize.h:20