26 mCurrentColourNative(0xFFFFFFFF),
27 mInverseColourNative(0xFF000000),
28 mShadowColourNative(0x00000000),
30 mTextAlign(
Align::Default),
32 mShadowColour(
Colour::Black),
37 mBackgroundNormal(true),
41 mVisibleCursor(false),
47 mIsAddCursorWidth(true),
143 if (
nullptr !=
mNode)
159 if (
nullptr !=
mNode)
171 if (
nullptr !=
mNode)
175 void EditText::checkVertexSize()
187 unsigned int EditText::getMixedNativeAlpha(
float secondAlpha)
const
200 _setTextColour(_value);
203 void EditText::_setTextColour(
const Colour& _value)
216 if (
nullptr !=
mNode)
235 if (
nullptr !=
mNode)
243 if (
mFont !=
nullptr)
270 if (
nullptr !=
mNode)
284 if (
nullptr !=
mNode)
331 if (
nullptr !=
mNode)
346 if (
nullptr !=
mNode)
361 if (
nullptr !=
mNode)
376 if (
nullptr !=
mNode)
384 if (
nullptr !=
mNode)
423 if (
nullptr !=
mNode)
434 if (
nullptr ==
mFont)
450 if (
nullptr ==
mFont)
470 if (
nullptr !=
mNode)
479 if (
nullptr !=
mNode)
485 if (
nullptr ==
mFont)
523 size_t vertexCount = 0;
540 for (VectorLineInfo::const_iterator line = textViewData.begin(); line != textViewData.end(); ++line)
544 for (VectorCharInfo::const_iterator sim = line->symbols.begin(); sim != line->symbols.end(); ++sim)
548 colour = sim->getColour() | (colour & 0xFF000000);
549 inverseColour = colour ^ 0x00FFFFFF;
550 selectedColour =
mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
557 float fullAdvance = sim->getBearingX() + sim->getAdvance();
562 vertexRect.
set(left, top, left + fullAdvance, top + (
float)
mFontHeight);
564 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, selectedUVRect, selectedColour);
570 vertexRect.
left = left + sim->getBearingX() + 1.0f;
571 vertexRect.
top = top + sim->getBearingY() + 1.0f;
572 vertexRect.
right = vertexRect.
left + sim->getWidth();
573 vertexRect.
bottom = vertexRect.
top + sim->getHeight();
575 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(),
mShadowColourNative);
579 vertexRect.
left = left + sim->getBearingX();
580 vertexRect.
top = top + sim->getBearingY();
581 vertexRect.
right = vertexRect.
left + sim->getWidth();
582 vertexRect.
bottom = vertexRect.
top + sim->getHeight();
584 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(), (!select || !
mInvertSelect) ? colour : inverseColour);
614 if (
nullptr !=
mNode)
635 if (
nullptr !=
mNode)
648 if (
nullptr !=
mNode)
657 void EditText::drawQuad(
659 size_t& _vertexCount,
665 _vertex[0].
x = _vertexRect.
left;
666 _vertex[0].
y = _vertexRect.
top;
667 _vertex[0].
z = _vertexZ;
668 _vertex[0].
colour = _colour;
669 _vertex[0].
u = _textureRect.
left;
670 _vertex[0].
v = _textureRect.
top;
672 _vertex[2].
x = _vertexRect.
left;
673 _vertex[2].
y = _vertexRect.
bottom;
674 _vertex[2].
z = _vertexZ;
675 _vertex[2].
colour = _colour;
676 _vertex[2].
u = _textureRect.
left;
677 _vertex[2].
v = _textureRect.
bottom;
679 _vertex[1].
x = _vertexRect.
right;
680 _vertex[1].
y = _vertexRect.
top;
681 _vertex[1].
z = _vertexZ;
682 _vertex[1].
colour = _colour;
683 _vertex[1].
u = _textureRect.
right;
684 _vertex[1].
v = _textureRect.
top;
686 _vertex[3].
x = _vertexRect.
right;
687 _vertex[3].
y = _vertexRect.
top;
688 _vertex[3].
z = _vertexZ;
689 _vertex[3].
colour = _colour;
690 _vertex[3].
u = _textureRect.
right;
691 _vertex[3].
v = _textureRect.
top;
693 _vertex[5].
x = _vertexRect.
left;
694 _vertex[5].
y = _vertexRect.
bottom;
695 _vertex[5].
z = _vertexZ;
696 _vertex[5].
colour = _colour;
697 _vertex[5].
u = _textureRect.
left;
698 _vertex[5].
v = _textureRect.
bottom;
700 _vertex[4].
x = _vertexRect.
right;
701 _vertex[4].
y = _vertexRect.
bottom;
702 _vertex[4].
z = _vertexZ;
703 _vertex[4].
colour = _colour;
704 _vertex[4].
u = _textureRect.
right;
705 _vertex[4].
v = _textureRect.
bottom;
711 void EditText::drawGlyph(
712 const RenderTargetInfo& _renderTargetInfo,
714 size_t& _vertexCount,
725 _textureRect.left += _textureRect.width() * leftClip / _vertexRect.width();
726 _vertexRect.left += leftClip;
736 if (rightClip > 0.0f)
740 _textureRect.right -= _textureRect.width() * rightClip / _vertexRect.width();
741 _vertexRect.right -= rightClip;
755 _textureRect.top += _textureRect.height() * topClip / _vertexRect.height();
756 _vertexRect.top += topClip;
766 if (bottomClip > 0.0f)
770 _textureRect.bottom -= _textureRect.height() * bottomClip / _vertexRect.height();
771 _vertexRect.bottom -= bottomClip;
783 ((_renderTargetInfo.pixScaleX * pix_left + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
784 -(((_renderTargetInfo.pixScaleY * pix_top + _renderTargetInfo.vOffset) * 2.0f) - 1.0f),
785 ((_renderTargetInfo.pixScaleX * (pix_left + _vertexRect.width()) + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
786 -(((_renderTargetInfo.pixScaleY * (pix_top + _vertexRect.height()) + _renderTargetInfo.vOffset) * 2.0f) - 1.0f));
788 drawQuad(_vertex, _vertexCount, vertexRect,
mNode->
getNodeDepth(), _textureRect, _colour);
#define MYGUI_ASSERT(exp, dest)
void setTextColour(const Colour &_value) override
VertexColourType mVertexFormat
size_t getTextSelectionEnd() const override
void setFontName(const std::string &_value) override
void setAlpha(float _value) override
uint32 mCurrentColourNative
void setSelectBackground(bool _normal) override
void setTextSelection(size_t _start, size_t _end) override
void setWordWrap(bool _value) override
void _setAlign(const IntSize &_oldsize) override
bool isVisibleCursor() const override
bool getShadow() const override
IntCoord getCursorCoord(size_t _position) const override
void _correctView() override
virtual const VectorLineInfo & getLineInfo() const
void setInvertSelected(bool _value) override
const Colour & getTextColour() const override
void setFontHeight(int _value) override
void setVisible(bool _value) override
uint32 mInverseColourNative
const Colour & getShadowColour() const override
void setShadowColour(const Colour &_value) override
const UString & getCaption() const override
bool getInvertSelected() const override
void setCaption(const UString &_value) override
void setTextAlign(Align _value) override
void setStateData(IStateInfo *_data) override
int getFontHeight() const override
size_t getTextSelectionStart() const override
IntPoint getViewOffset() const override
void setVisibleCursor(bool _value) override
bool getSelectBackground() const override
IntSize getTextSize() const override
const std::string & getFontName() const override
size_t getCursorPosition() const override
void setViewOffset(const IntPoint &_point) override
Align getTextAlign() const override
void _updateView() override
uint32 mShadowColourNative
UString::utf32string mUtf32Caption
void createDrawItem(ITexture *_texture, ILayerNode *_node) override
void setCursorPosition(size_t _index) override
void setShiftText(bool _shift) override
void setShadow(bool _value) override
void updateRawData() const
void destroyDrawItem() override
const Colour & getColour() const
IFont * getByName(const std::string &_name) const
static FontManager & getInstance()
int getAbsoluteLeft() const
const IntPoint & getAbsolutePosition() const
bool _checkOutside() const
ICroppedRectangle * mCroppedParent
int getAbsoluteTop() const
int _getViewWidth() const
int _getViewHeight() const
virtual ITexture * getTextureFont() const =0
virtual int getDefaultHeight() const =0
virtual const GlyphInfo * getGlyphInfo(Char _id) const =0
virtual float getNodeDepth() const =0
virtual void outOfDate(RenderItem *_item)=0
virtual RenderItem * addToRenderItem(ITexture *_texture, bool _firstQueue, bool _separate)=0
Type * castType(bool _throw=true)
virtual const RenderTargetInfo & getInfo() const =0
const std::string & getResourceName() const
void addDrawItem(ISubWidget *_item, size_t _count)
bool getCurrentUpdate() const
IRenderTarget * getRenderTarget()
void reallockDrawItem(ISubWidget *_item, size_t _count)
void removeDrawItem(ISubWidget *_item)
Vertex * getCurrentVertexBuffer() const
void setLastVertexCount(size_t _count)
virtual VertexColourType getVertexFormat() const =0
static RenderManager & getInstance()
size_t getCursorPosition(const IntPoint &_value) const
IntPoint getCursorPoint(size_t _position) const
void update(const UString::utf32string &_text, IFont *_font, int _height, Align _align, VertexColourType _format, int _maxWidth=-1)
const VectorLineInfo & getData() const
const IntSize & getViewSize() const
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
const utf32string & asUTF32() const
returns the current string in UTF-32 form within a utf32string
void convertColour(uint32 &_colour, VertexColourType _format)
uint32 toColourARGB(const Colour &_colour)
types::TCoord< int > IntCoord
const size_t SIMPLETEXT_COUNT_VERTEX
std::vector< LineInfo > VectorLineInfo
types::TRect< float > FloatRect
TPoint< T > point() const
void set(T const &_left, T const &_top, T const &_right, T const &_bottom)