MyGUI  3.2.2
MyGUI_Widget.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_Widget.h"
9 #include "MyGUI_Gui.h"
10 #include "MyGUI_InputManager.h"
11 #include "MyGUI_SkinManager.h"
12 #include "MyGUI_SubWidgetManager.h"
13 #include "MyGUI_WidgetManager.h"
14 #include "MyGUI_ResourceSkin.h"
15 #include "MyGUI_WidgetDefines.h"
16 #include "MyGUI_LayerItem.h"
17 #include "MyGUI_LayerManager.h"
18 #include "MyGUI_RenderItem.h"
19 #include "MyGUI_ISubWidget.h"
20 #include "MyGUI_ISubWidgetText.h"
21 #include "MyGUI_TextBox.h"
22 #include "MyGUI_FactoryManager.h"
23 #include "MyGUI_CoordConverter.h"
24 #include "MyGUI_RenderManager.h"
25 #include "MyGUI_ToolTipManager.h"
26 #include "MyGUI_LayoutManager.h"
27 
28 namespace MyGUI
29 {
30 
32  mWidgetClient(nullptr),
33  mEnabled(true),
34  mInheritsEnabled(true),
35  mInheritsVisible(true),
36  mAlpha(ALPHA_MAX),
37  mRealAlpha(ALPHA_MAX),
38  mInheritsAlpha(true),
39  mParent(nullptr),
40  mWidgetStyle(WidgetStyle::Child),
41  mContainer(nullptr),
42  mAlign(Align::Default),
43  mVisible(true),
44  mDepth(0)
45  {
46  }
47 
49  {
50  }
51 
52  void Widget::_initialise(WidgetStyle _style, const IntCoord& _coord, const std::string& _skinName, Widget* _parent, ICroppedRectangle* _croppedParent, const std::string& _name)
53  {
54  ResourceSkin* skinInfo = nullptr;
55  ResourceLayout* templateInfo = nullptr;
56 
57  if (LayoutManager::getInstance().isExist(_skinName))
58  templateInfo = LayoutManager::getInstance().getByName(_skinName);
59  else
60  skinInfo = SkinManager::getInstance().getByName(_skinName);
61 
62  mCoord = _coord;
63 
64  mAlign = Align::Default;
65  mWidgetStyle = _style;
66  mName = _name;
67 
68  mCroppedParent = _croppedParent;
69  mParent = _parent;
70 
71 
72 #if MYGUI_DEBUG_MODE == 1
73  // проверяем соответсвие входных данных
74  if (mWidgetStyle == WidgetStyle::Child)
75  {
76  MYGUI_ASSERT(mCroppedParent, "must be cropped");
77  MYGUI_ASSERT(mParent, "must be parent");
78  }
79  else if (mWidgetStyle == WidgetStyle::Overlapped)
80  {
81  MYGUI_ASSERT((mParent == nullptr) == (mCroppedParent == nullptr), "error cropped");
82  }
83  else if (mWidgetStyle == WidgetStyle::Popup)
84  {
85  MYGUI_ASSERT(!mCroppedParent, "cropped must be nullptr");
86  MYGUI_ASSERT(mParent, "must be parent");
87  }
88 #endif
89 
90  // корректируем абсолютные координаты
91  mAbsolutePosition = _coord.point();
92 
93  if (nullptr != mCroppedParent)
95 
96  const WidgetInfo* root = initialiseWidgetSkinBase(skinInfo, templateInfo);
97 
98  // дочернее окно обыкновенное
99  if (mWidgetStyle == WidgetStyle::Child)
100  {
101  if (mParent)
102  mParent->addChildItem(this);
103  }
104  // дочернее нуно перекрывающееся
105  else if (mWidgetStyle == WidgetStyle::Overlapped)
106  {
107  // дочернее перекрывающееся
108  if (mParent)
109  mParent->addChildNode(this);
110  }
111 
112  // витр метод для наследников
114 
115  if (skinInfo != nullptr)
116  setSkinProperty(skinInfo);
117 
118  if (root != nullptr)
119  {
120  for (VectorStringPairs::const_iterator iter = root->properties.begin(); iter != root->properties.end(); ++iter)
121  {
122  setProperty(iter->first, iter->second);
123  }
124  }
125  }
78  factory.unregisterFactory 371  }
nullptr clearNewLine(if (owner != 1 is closed by doxygen! -->
MyGUI::types::TRect::operator=
Tf869b777800b0d351112e69">setProperty(iter->first, iter->second);

>
const
bool isBottom() const
nullptr cleab0d351112e69">setProperty(iter->first, iter->second);<();
bool isBottom() const
MyGUI
MyGUIMyGUIMyGUIMyGUIMyGUIMyGUIMyGUIsetButtonAutoWidth(utility::parseValue<bool>(_value));
MyGUI_InputManager.h:27
void
setPointer(const std::string& _name);
// дочернее нуно перекрывающееся
823  for="lineno"> 105&qspan class="keyword">const;
29  virtual void setCaption(conss="lineno"> 954  for (GlyphHeightMap::const_iterator j = _glyphHeightMap.begin(); j != _glyphHeightMap.endnstmVScroll->getWidth(), mClient-> 22  mEmptyView(false),
3958007edbd249a/span>  18  class="l
1 is closed by doxygen! -->
247  // вообще внܸз уcode" href="class_my_g_u_i_1_1_u_string_1_1__base__iterator.html#ae268cedeseparator:ab241223e761560fc5351df2ffeb861f4">
const
<f="tabs.css"&rel="stylesheet-2type="text/css"/>