MyGUI  3.2.2
MyGUI_EditText.cpp
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 #include "MyGUI_Precompiled.h"
8 #include "MyGUI_EditText.h"
9 #include "MyGUI_RenderItem.h"
10 #include "MyGUI_FontManager.h"
11 #include "MyGUI_RenderManager.h"
12 #include "MyGUI_LanguageManager.h"
13 #include "MyGUI_TextIterator.h"
14 #include "MyGUI_IRenderTarget.h"
15 #include "MyGUI_FontData.h"
16 #include "MyGUI_CommonStateInfo.h"
17 
18 namespace MyGUI
19 {
20 
21  const size_t VERTEX_IN_QUAD = 6;
23 
26  mEmptyView(false),
27  mCurrentColourNative(0x00FFFFFF),
28  mInverseColourNative(0x00000000),
29  mCurrentAlphaNative(0xFF000000),
30  mShadowColourNative(0x00000000),
31  mTextOutDate(false),
32  mTextAlign(Align::Default),
33  mColour(Colour::White),
34  mShadowColour(Colour::Black),
35  mAlpha(ALPHA_MAX),
36  mFont(nullptr),
37  mTexture(nullptr),
38  mFontHeight(0),
39  mBackgroundNormal(true),
40  mStartSelect(0),
41  mEndSelect(0),
42  mCursorPosition(0),
43  mVisibleCursor(false),
44  mInvertSelect(true),
45  mShadow(false),
46  mNode(nullptr),
47  mRenderItem(nullptr),
48  mCountVertex(SIMPLETEXT_COUNT_VERTEX),
49  mIsAddCursorWidth(true),
50  mShiftText(false),
51  mWordWrap(false),
52  mManualColour(false),
53  mOldWidth(0)
54  {
56 
59 
60  mCurrentColourNative = (mCurrentColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
61  mShadowColourNative = (mShadowColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
63  }
64 
66  {
67  }
68 
69  void EditText::setVisible(bool _visible)
70  {
71  if (mVisible == _visible)
72  return;
73  mVisible = _visible;
74 
75  if (nullptr != mNode)
77  }
78 
80  {
81  if (nullptr != mNode)
83  }
84 
85  void EditText::_setAlign(const IntSize& _oldsize)
86  {
87  if (mWordWrap)
88  {
89  // передается старая координата всегда
90  int width = mCroppedParent->getWidth();
91  if (mOldWidth != width)
92  {
93  mOldWidth = width;
94  mTextOutDate = true;
95  }
96  }
97 
98  // необходимо разобраться
99  bool need_update = true;//_update;
100 
101  // первоначальное выравнивание
102  if (mAlign.isHStretch())
103  {
104  // растягиваем
105  mCoord.width = mCoord.width + (mCroppedParent->getWidth() - _oldsize.width);
106  need_update = true;
107  mIsMargin = true; // при изменении размеров все пересчитывать
108  }
109  else if (mAlign.isRight())
110  {
111  // двигаем по правому краю
112  mCoord.left = mCoord.left + (mCroppedParent->getWidth() - _oldsize.width);
113  need_update = true;
114  }
115  else if (mAlign.isHCenter())
116  {
117  // выравнивание по горизонтали без растяжения
119  need_update = true;
120  }
121 
122  if (mAlign.isVStretch())
123  {
124  // растягиваем
126  need_update = true;
127  mIsMargin = true; // при изменении размеров все пересчитывать
128  }
129  else if (mAlign.isBottom())
130  {
131  // двигаем по нижнему краю
132  mCoord.top = mCoord.top + (mCroppedParent->getHeight() - _oldsize.height);
133  need_update = true;
134  }
135  else if (mAlign.isVCenter())
136  {
137  // выравнивание по вертикали без растяжения
139  need_update = true;
140  }
141 
142  if (need_update)
143  {
145  _updateView();
146  }
147  }
148 
150  {
151  bool margin = _checkMargin();
152 
153  mEmptyView = ((0 >= _getViewWidth()) || (0 >= _getViewHeight()));
154 
157 
158  // вьюпорт стал битым
159  if (margin)
160  {
161  // проверка на полный выход за границу
162  if (_checkOutside())
163  {
164  // запоминаем текущее состояние
165  mIsMargin = margin;
166 
167  // обновить перед выходом
168  if (nullptr != mNode)
170  return;
171  }
172  }
173 
174  // мы обрезаны или были обрезаны
175  if (mIsMargin || margin)
176  {
179  }
180 
181  // запоминаем текущее состояние
182  mIsMargin = margin;
183 
184  if (nullptr != mNode)
186  }
187 
188  void EditText::setCaption(const UString& _value)
189  {
190  mCaption = _value;
191  mTextOutDate = true;
192 
193  checkVertexSize();
194 
195  if (nullptr != mNode)
197  }
198 
199  void EditText::checkVertexSize()
200  {
201  // если вершин не хватит, делаем реалок, с учетом выделения * 2 и курсора
202  size_t need = (mCaption.size() * (mShadow ? 3 : 2) + 2) * VERTEX_IN_QUAD;
203  if (mCountVertex < need)
204  {
206  if (nullptr != mRenderItem)
208  }
209  }
210 
212  {
213  return mCaption;
214  }
215 
216  void EditText::setTextColour(const Colour& _value)
217  {
218  mManualColour = true;
219  _setTextColour(_value);
220  }
221 
222  void EditText::_setTextColour(const Colour& _value)
223  {
224  if (mColour == _value)
225  return;
226 
227  mColour = _value;
229 
231 
232  mCurrentColourNative = (mCurrentColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
234 
235  if (nullptr != mNode)
237  }
238 
240  {
241  return mColour;
242  }
243 
244  void EditText::setAlpha(float _value)
245  {
246  if (mAlpha == _value)
247  return;
248  mAlpha = _value;
249 
250  mCurrentAlphaNative = ((uint8)(mAlpha * 255) << 24);
251  mCurrentColourNative = (mCurrentColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
252  mShadowColourNative = (mShadowColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
254 
255  if (nullptr != mNode)
257  }
258 
259  float EditText::getAlpha() const
260  {
261  return mAlpha;
262  }
263 
264  void EditText::setFontName(const std::string& _value)
265  {
266  mTexture = 0;
268  if (mFont != nullptr)
269  {
271 
272  // если надо, устанавливаем дефолтный размер шрифта
273  if (mFont->getDefaultHeight() != 0)
274  {
276  }
277  }
278 
279  mTextOutDate = true;
280 
281  // если мы были приаттаченны, то удаляем себя
282  if (nullptr != mRenderItem)
283  {
285  mRenderItem = nullptr;
286  }
287 
288  // если есть текстура, то приаттачиваемся
289  if (nullptr != mTexture && nullptr != mNode)
290  {
291  mRenderItem = mNode->addToRenderItem(mTexture, false, false);
293  }
294 
295  if (nullptr != mNode)
297  }
298 
299  const std::string& EditText::getFontName() const
300  {
301  return mFont->getResourceName();
302  }
303 
304  void EditText::setFontHeight(int _value)
305  {
306  mFontHeight = _value;
307  mTextOutDate = true;
308 
309  if (nullptr != mNode)
311  }
312 
314  {
315  return mFontHeight;
316  }
317 
319  {
320  mNode = _node;
321  // если уже есть текстура, то атачимся, актуально для смены леера
322  if (nullptr != mTexture)
323  {
324  MYGUI_ASSERT(!mRenderItem, "mRenderItem must be nullptr");
325 
326  mRenderItem = mNode->addToRenderItem(mTexture, false, false);
328  }
329  }
330 
332  {
333  if (nullptr != mRenderItem)
334  {
336  mRenderItem = nullptr;
337  }
338  mNode = nullptr;
339  }
340 
342  {
343  return mStartSelect;
344  }
345 
347  {
348  return mEndSelect;
349  }
350 
351  void EditText::setTextSelection(size_t _start, size_t _end)
352  {
353  mStartSelect = _start;
354  mEndSelect = _end;
355 
356  if (nullptr != mNode)
358  }
359 
361  {
362  return mBackgroundNormal;
363  }
364 
365  void EditText::setSelectBackground(bool _normal)
366  {
367  if (mBackgroundNormal == _normal)
368  return;
369  mBackgroundNormal = _normal;
370 
371  if (nullptr != mNode)
373  }
374 
376  {
377  return mVisibleCursor;
378  }
379 
380  void EditText::setVisibleCursor(bool _value)
381  {
382  if (mVisibleCursor == _value)
383  return;
384  mVisibleCursor = _value;
385 
386  if (nullptr != mNode)
388  }
389 
391  {
392  return mCursorPosition;
393  }
394 
395  void EditText::setCursorPosition(size_t _index)
396  {
397  if (mCursorPosition == _index)
398  return;
399  mCursorPosition = _index;
400 
401  if (nullptr != mNode)
403  }
404 
406  {
407  mTextAlign = _value;
408 
409  if (nullptr != mNode)
411  }
412 
414  {
415  return mTextAlign;
416  }
417 
419  {
420  // если нуно обновить, или изменились пропорции экрана
421  if (mTextOutDate)
422  updateRawData();
423 
424  IntSize size = mTextView.getViewSize();
425  // плюс размер курсора
426  if (mIsAddCursorWidth)
427  size.width += 2;
428 
429  if (mShadow)
430  {
431  if (!mIsAddCursorWidth)
432  size.width ++;
433  size.height ++;
434  }
435 
436  return size;
437  }
438 
440  {
441  return mTextView.getData();
442  }
443 
444  void EditText::setViewOffset(const IntPoint& _point)
445  {
446  mViewOffset = _point;
447 
448  if (nullptr != mNode)
450  }
451 
453  {
454  return mViewOffset;
455  }
456 
457  size_t EditText::getCursorPosition(const IntPoint& _point)
458  {
459  if (nullptr == mFont)
460  return 0;
461 
462  if (mTextOutDate)
463  updateRawData();
464 
465  IntPoint point = _point;
467  point += mViewOffset;
468  point -= mCoord.point();
469 
470  return mTextView.getCursorPosition(point);
471  }
472 
474  {
475  if (nullptr == mFont)
476  return IntCoord();
477 
478  if (mTextOutDate)
479  updateRawData();
480 
481  IntPoint point = mTextView.getCursorPoint(_position);
483  point -= mViewOffset;
484  point += mCoord.point();
485 
486  return IntCoord(point.left, point.top, 2, mFontHeight);
487  }
488 
489  void EditText::setShiftText(bool _value)
490  {
491  if (mShiftText == _value)
492  return;
493  mShiftText = _value;
494 
495  if (nullptr != mNode)
497  }
498 
499  void EditText::setWordWrap(bool _value)
500  {
501  mWordWrap = _value;
502  mTextOutDate = true;
503 
504  if (nullptr != mNode)
506  }
507 
509  {
510  if (nullptr == mFont)
511  return;
512  // сбрасывам флаги
513  mTextOutDate = false;
514 
515  int width = -1;
516  if (mWordWrap)
517  {
518  width = mCoord.width;
519  // обрезать слова нужно по шарине, которую мы реально используем
520  if (mIsAddCursorWidth)
521  width -= 2;
522  }
523 
525  }
526 
528  {
529  EditTextStateInfo* data = _data->castType<EditTextStateInfo>();
530  if (!mManualColour && data->getColour() != Colour::Zero)
531  _setTextColour(data->getColour());
532  setShiftText(data->getShift());
533  }
534 
536  {
537  if (nullptr == mFont || !mVisible || mEmptyView)
538  return;
539 
541  updateRawData();
542 
544 
545  const RenderTargetInfo& renderTargetInfo = mRenderItem->getRenderTarget()->getInfo();
546 
547  // колличество отрисованных вершин
548  size_t vertexCount = 0;
549 
550  // текущие цвета
551  uint32 colour = mCurrentColourNative;
552  uint32 inverseColour = mInverseColourNative;
553  uint32 selectedColour = mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
554 
555  const VectorLineInfo& textViewData = mTextView.getData();
556 
557  float top = (float)(-mViewOffset.top + mCoord.top);
558 
559  FloatRect vertexRect;
560 
562 
563  size_t index = 0;
564 
565  for (VectorLineInfo::const_iterator line = textViewData.begin(); line != textViewData.end(); ++line)
566  {
567  float left = (float)(line->offset - mViewOffset.left + mCoord.left);
568 
569  for (VectorCharInfo::const_iterator sim = line->simbols.begin(); sim != line->simbols.end(); ++sim)
570  {
571  if (sim->isColour())
572  {
573  colour = sim->getColour() | (colour & 0xFF000000);
574  inverseColour = colour ^ 0x00FFFFFF;
575  selectedColour = mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
576  continue;
577  }
578 
579  // смещение текстуры для фона
580  bool select = index >= mStartSelect && index < mEndSelect;
581 
582  float fullAdvance = sim->getBearingX() + sim->getAdvance();
583 
584  // Render the selection, if any, first.
585  if (select)
586  {
587  vertexRect.set(left, top, left + fullAdvance, top + (float)mFontHeight);
588 
589  drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, selectedUVRect, selectedColour);
590  }
591 
592  // Render the glyph shadow, if any.
593  if (mShadow)
594  {
595  vertexRect.left = left + sim->getBearingX() + 1.0f;
596  vertexRect.top = top + sim->getBearingY() + 1.0f;
597  vertexRect.right = vertexRect.left + sim->getWidth();
598  vertexRect.bottom = vertexRect.top + sim->getHeight();
599 
600  drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(), mShadowColourNative);
601  }
602 
603  // Render the glyph itself.
604  vertexRect.left = left + sim->getBearingX();
605  vertexRect.top = top + sim->getBearingY();
606  vertexRect.right = vertexRect.left + sim->getWidth();
607  vertexRect.bottom = vertexRect.top + sim->getHeight();
608 
609  drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(), (!select || !mInvertSelect) ? colour : inverseColour);
610 
611  left += fullAdvance;
612  ++index;
613  }
614 
615  top += mFontHeight;
616  ++index;
617  }
618 
619  // Render the cursor, if any, last.
620  if (mVisibleCursor)
621  {
623  GlyphInfo* cursorGlyph = mFont->getGlyphInfo(static_cast<Char>(FontCodeType::Cursor));
624  vertexRect.set((float)point.left, (float)point.top, (float)point.left + cursorGlyph->width, (float)(point.top + mFontHeight));
625 
626  drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, cursorGlyph->uvRect, mCurrentColourNative | 0x00FFFFFF);
627  }
628 
629  // колличество реально отрисованных вершин
630  mRenderItem->setLastVertexCount(vertexCount);
631  }
632 
633  void EditText::setInvertSelected(bool _value)
634  {
635  if (mInvertSelect == _value)
636  return;
637  mInvertSelect = _value;
638 
639  if (nullptr != mNode)
641  }
642 
644  {
645  return mInvertSelect;
646  }
647 
648  bool EditText::getShadow() const
649  {
650  return mShadow;
651  }
652 
653  void EditText::setShadow(bool _value)
654  {
655  mShadow = _value;
656  mTextOutDate = true;
657 
658  checkVertexSize();
659 
660  if (nullptr != mNode)
662  }
663 
664  void EditText::setShadowColour(const Colour& _value)
665  {
666  mShadowColour = _value;
668 
670 
671  mShadowColourNative = (mShadowColourNative & 0x00FFFFFF) | (mCurrentAlphaNative & 0xFF000000);
672 
673  if (nullptr != mNode)
675  }
676 
678  {
679  return mShadowColour;
680  }
681 
682  void EditText::drawQuad(
683  Vertex*& _vertex,
684  size_t& _vertexCount,
685  const FloatRect& _vertexRect,
686  float _vertexZ,
687  const FloatRect& _textureRect,
688  uint32 _colour) const
689  {
690  _vertex[0].x = _vertexRect.left;
691  _vertex[0].y = _vertexRect.top;
692  _vertex[0].z = _vertexZ;
693  _vertex[0].colour = _colour;
694  _vertex[0].u = _textureRect.left;
695  _vertex[0].v = _textureRect.top;
696 
697  _vertex[2].x = _vertexRect.left;
698  _vertex[2].y = _vertexRect.bottom;
699  _vertex[2].z = _vertexZ;
700  _vertex[2].colour = _colour;
701  _vertex[2].u = _textureRect.left;
702  _vertex[2].v = _textureRect.bottom;
703 
704  _vertex[1].x = _vertexRect.right;
705  _vertex[1].y = _vertexRect.top;
706  _vertex[1].z = _vertexZ;
707  _vertex[1].colour = _colour;
708  _vertex[1].u = _textureRect.right;
709  _vertex[1].v = _textureRect.top;
710 
711  _vertex[3].x = _vertexRect.right;
712  _vertex[3].y = _vertexRect.top;
713  _vertex[3].z = _vertexZ;
714  _vertex[3].colour = _colour;
715  _vertex[3].u = _textureRect.right;
716  _vertex[3].v = _textureRect.top;
717 
718  _vertex[5].x = _vertexRect.left;
719  _vertex[5].y = _vertexRect.bottom;
720  _vertex[5].z = _vertexZ;
721  _vertex[5].colour = _colour;
722  _vertex[5].u = _textureRect.left;
723  _vertex[5].v = _textureRect.bottom;
724 
725  _vertex[4].x = _vertexRect.right;
726  _vertex[4].y = _vertexRect.bottom;
727  _vertex[4].z = _vertexZ;
728  _vertex[4].colour = _colour;
729  _vertex[4].u = _textureRect.right;
730  _vertex[4].v = _textureRect.bottom;
731 
732  _vertex += VERTEX_IN_QUAD;
733  _vertexCount += VERTEX_IN_QUAD;
734  }
735 
736  void EditText::drawGlyph(
737  const RenderTargetInfo& _renderTargetInfo,
738  Vertex*& _vertex,
739  size_t& _vertexCount,
740  FloatRect _vertexRect,
741  FloatRect _textureRect,
742  uint32 _colour) const
743  {
744  // символ залазиет влево
745  float leftClip = (float)mCurrentCoord.left - _vertexRect.left;
746  if (leftClip > 0.0f)
747  {
748  if ((float)mCurrentCoord.left < _vertexRect.right)
749  {
750  _textureRect.left += _textureRect.width() * leftClip / _vertexRect.width();
751  _vertexRect.left += leftClip;
752  }
753  else
754  {
755  return;
756  }
757  }
758 
759  // символ залазиет вправо
760  float rightClip = _vertexRect.right - (float)mCurrentCoord.right();
761  if (rightClip > 0.0f)
762  {
763  if (_vertexRect.left < (float)mCurrentCoord.right())
764  {
765  _textureRect.right -= _textureRect.width() * rightClip / _vertexRect.width();
766  _vertexRect.right -= rightClip;
767  }
768  else
769  {
770  return;
771  }
772  }
773 
774  // символ залазиет вверх
775  float topClip = (float)mCurrentCoord.top - _vertexRect.top;
776  if (topClip > 0.0f)
777  {
778  if ((float)mCurrentCoord.top < _vertexRect.bottom)
779  {
780  _textureRect.top += _textureRect.height() * topClip / _vertexRect.height();
781  _vertexRect.top += topClip;
782  }
783  else
784  {
785  return;
786  }
787  }
788 
789  // символ залазиет вниз
790  float bottomClip = _vertexRect.bottom - (float)mCurrentCoord.bottom();
791  if (bottomClip > 0.0f)
792  {
793  if (_vertexRect.top < (float)mCurrentCoord.bottom())
794  {
795  _textureRect.bottom -= _textureRect.height() * bottomClip / _vertexRect.height();
796  _vertexRect.bottom -= bottomClip;
797  }
798  else
799  {
800  return;
801  }
802  }
803 
804  float pix_left = mCroppedParent->getAbsoluteLeft() - _renderTargetInfo.leftOffset + _vertexRect.left;
805  float pix_top = mCroppedParent->getAbsoluteTop() - _renderTargetInfo.topOffset + (mShiftText ? 1.0f : 0.0f) + _vertexRect.top;
806 
807  FloatRect vertexRect(
808  ((_renderTargetInfo.pixScaleX * pix_left + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
809  -(((_renderTargetInfo.pixScaleY * pix_top + _renderTargetInfo.vOffset) * 2.0f) - 1.0f),
810  ((_renderTargetInfo.pixScaleX * (pix_left + _vertexRect.width()) + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
811  -(((_renderTargetInfo.pixScaleY * (pix_top + _vertexRect.height()) + _renderTargetInfo.vOffset) * 2.0f) - 1.0f));
812 
813  drawQuad(_vertex, _vertexCount, vertexRect, mNode->getNodeDepth(), _textureRect, _colour);
814  }
815 
816 } // namespace MyGUI
virtual IntPoint getViewOffset() const
uint32 mInverseColourNative
const IntSize & getViewSize() const
virtual void setShiftText(bool _shift)
virtual ITexture * getTextureFont()=0
ILayerNode * mNode
bool isVStretch() const
Definition: MyGUI_Align.h:84
virtual void setSelectBackground(bool _normal)
void setTextColour(const Colour &_value)
unsigned int uint32
Definition: MyGUI_Types.h:48
virtual void outOfDate(RenderItem *_item)=0
virtual void setCursorPosition(size_t _index)
virtual const VectorLineInfo & getLineInfo() const
virtual bool getShadow() const
void removeDrawItem(ISubWidget *_item)
virtual void setWordWrap(bool _value)
virtual void createDrawItem(ITexture *_texture, ILayerNode *_node)
void addDrawItem(ISubWidget *_item, size_t _count)
virtual IntCoord getCursorCoord(size_t _position)
virtual void setTextSelection(size_t _start, size_t _end)
IRenderTarget * getRenderTarget()
bool isBottom() const
Definition: MyGUI_Align.h:79
__inline void convertColour(uint32 &_colour, VertexColourType _format)
virtual const std::string & getFontName() const
std::vector< LineInfo > VectorLineInfo
static RenderManager & getInstance()
bool isVCenter() const
Definition: MyGUI_Align.h:49
virtual float getNodeDepth()=0
virtual void setVisibleCursor(bool _value)
virtual size_t getCursorPosition() const
const VectorLineInfo & getData() const
virtual void setShadow(bool _value)
const Colour & getColour() const
ICroppedRectangle * mCroppedParent
virtual VertexColourType getVertexFormat()=0
virtual void setViewOffset(const IntPoint &_point)
VertexColourType mVertexFormat
const std::string & getResourceName() const
virtual void destroyDrawItem()
virtual const Colour & getShadowColour() const
#define nullptr
bool isHCenter() const
Definition: MyGUI_Align.h:44
uint32 mCurrentAlphaNative
RenderItem * mRenderItem
virtual size_t getTextSelectionStart() const
types::TCoord< int > IntCoord
Definition: MyGUI_Types.h:35
virtual RenderItem * addToRenderItem(ITexture *_texture, bool _firstQueue, bool _separate)=0
float getAlpha() const
IntCoord mCurrentCoord
const size_t SIMPLETEXT_COUNT_VERTEX
virtual void setVisible(bool _value)
virtual bool isVisibleCursor() const
virtual void _updateView()
virtual int getFontHeight() const
virtual void setFontHeight(int _value)
uint32 mCurrentColourNative
Vertex * getCurrentVertexBuffer() const
const float ALPHA_MAX
Definition: MyGUI_Macros.h:19
void setCaption(const UString &_value)
const IntPoint & getAbsolutePosition() const
ITexture * mTexture
const Colour & getTextColour() const
virtual size_t getTextSelectionEnd() const
bool isRight() const
Definition: MyGUI_Align.h:64
void reallockDrawItem(ISubWidget *_item, size_t _count)
#define MYGUI_ASSERT(exp, dest)
virtual Align getTextAlign() const
const UString & getCaption() const
const size_t VERTEX_IN_QUAD
virtual const RenderTargetInfo & getInfo()=0
uint32 toColourARGB(const Colour &_colour)
virtual void _correctView()
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:18
size_t getCursorPosition(const IntPoint &_value)
void set(T const &_left, T const &_top, T const &_right, T const &_bottom)
Definition: MyGUI_TRect.h:121
types::TRect< float > FloatRect
Definition: MyGUI_Types.h:33
virtual bool getInvertSelected() const
virtual void updateRawData()
virtual IntSize getTextSize()
virtual void setStateData(IStateInfo *_data)
IFont * getByName(const std::string &_name) const
IntPoint mViewOffset
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
IntPoint getCursorPoint(size_t _position)
virtual void _setAlign(const IntSize &_oldsize)
virtual int getDefaultHeight()=0
virtual void doRender()
virtual void setInvertSelected(bool _value)
uint32 mShadowColourNative
virtual bool getSelectBackground() const
size_type size() const
Returns the number of code points in the current string.
virtual void setTextAlign(Align _value)
bool isHStretch() const
Definition: MyGUI_Align.h:69
static const Colour Zero
Definition: MyGUI_Colour.h:54
unsigned char uint8
Definition: MyGUI_Types.h:46
virtual GlyphInfo * getGlyphInfo(Char _id)=0
bool getCurrentUpdate() const
virtual void setFontName(const std::string &_value)
void setLastVertexCount(size_t _count)
void update(const UString &_text, IFont *_font, int _height, Align _align, VertexColourType _format, int _maxWidth=-1)
virtual void setShadowColour(const Colour &_value)
TPoint< T > point() const
Definition: MyGUI_TCoord.h:185
void setAlpha(float _value)