MyGUI  3.2.2
MyGUI_ResourceImageSetPointer.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"
9 #include "MyGUI_ImageBox.h"
10 #include "MyGUI_ResourceManager.h"
11 
12 namespace MyGUI
13 {
14 
16  mImageSet(nullptr)
17  {
18  }
19 
21  {
22  }
23 
25  {
26  Base::deserialization(_node, _version);
27 
28  // берем детей и крутимся, основной цикл
30  while (info.next("Property"))
31  {
32  const std::string& key = info->findAttribute("key");
33  const std::string& value = info->findAttribute("value");
34 
35  if (key == "Point")
36  mPoint = IntPoint::parse(value);
37  else if (key == "Size")
38  mSize = IntSize::parse(value);
39  else if (key == "Resource")
41  }
42  }
43 
45  {
46  if (mImageSet != nullptr)
47  _image->setItemResourceInfo(mImageSet->getIndexInfo(0, 0));
48  }
49 
51  {
52  _image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
53  }
54 
55 } // namespace MyGUI
ImageBox properties. ImageBox_skin_childs Skin childs. ImageBox widget description should be here...
ImageIndexInfo getIndexInfo(const std::string &_group, const std::string &_index)
void setItemResourceInfo(const ImageIndexInfo &_info)
static ResourceManager & getInstance()
bool findAttribute(const std::string &_name, std::string &_value)
#define nullptr
static TSize< int > parse(const std::string &_value)
Definition: MyGUI_TSize.h:120
virtual void setCoord(const IntCoord &_value)
virtual void deserialization(xml::ElementPtr _node, Version _version)
virtual void setPosition(ImageBox *_image, const IntPoint &_point)
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:18
static TPoint< int > parse(const std::string &_value)
Definition: MyGUI_TPoint.h:120
virtual void setImage(ImageBox *_image)
ElementEnumerator getElementEnumerator()
IResource * getByName(const std::string &_name, bool _throw=true) const