MyGUI  3.2.0
MyGUI_SimpleText.cpp
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #include "MyGUI_Precompiled.h"
23 #include "MyGUI_SimpleText.h"
24 #include "MyGUI_RenderItem.h"
25 #include "MyGUI_LayerNode.h"
26 #include "MyGUI_FontManager.h"
27 #include "MyGUI_CommonStateInfo.h"
28 #include "MyGUI_RenderManager.h"
29 
30 namespace MyGUI
31 {
32 
34  EditText()
35  {
36  mIsAddCursorWidth = false;
37  }
38 
40  {
41  }
42 
43  void SimpleText::setViewOffset(const IntPoint& _point)
44  {
45  }
46 
48  {
49  bool _update = mRenderItem->getCurrentUpdate();
50  if (_update) mTextOutDate = true;
51 
52  if (nullptr == mFont) return;
53  if (!mVisible || mEmptyView) return;
54 
56 
57  const IntSize& size = mTextView.getViewSize();
58 
59  if (mTextAlign.isRight())
60  mViewOffset.left = - (mCoord.width - size.width);
61  else if (mTextAlign.isHCenter())
62  mViewOffset.left = - ((mCoord.width - size.width) / 2);
63  else
64  mViewOffset.left = 0;
65 
66  if (mTextAlign.isBottom())
67  mViewOffset.top = - (mCoord.height - size.height);
68  else if (mTextAlign.isVCenter())
69  mViewOffset.top = - ((mCoord.height - size.height) / 2);
70  else
71  mViewOffset.top = 0;
72 
74  }
75 
76 } // namespace MyGUI
const IntSize & getViewSize() const
virtual void setViewOffset(const IntPoint &_point)
virtual void doRender()
bool isBottom() const
Definition: MyGUI_Align.h:94
bool isVCenter() const
Definition: MyGUI_Align.h:64
bool isHCenter() const
Definition: MyGUI_Align.h:59
RenderItem * mRenderItem
bool isRight() const
Definition: MyGUI_Align.h:79
virtual void updateRawData()
IntPoint mViewOffset
virtual void doRender()
bool getCurrentUpdate() const