MyGUI  3.2.2
MyGUI_ResourceManualPointer.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_CoordConverter.h"
11 #include "MyGUI_TextureUtility.h"
12 
13 namespace MyGUI
14 {
15 
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") mPoint = IntPoint::parse(value);
36  else if (key == "Size") mSize = IntSize::parse(value);
37  else if (key == "Texture") mTexture = value;
38  else if (key == "Coord") mTextureCoord = IntCoord::parse(value);
39  }
40  }
41 
43  {
44  _image->deleteAllItems();
45  _image->setImageInfo(mTexture, mTextureCoord, mTextureCoord.size());
46  }
47 
49  {
50  _image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
51  }
52 
53 } // namespace MyGUI
MyGUI::types::TCoord< int >::parse
static TCoord< int > parse(const std::string &_value)
Definition: MyGUI_TCoord.h:207
MyGUI::types::TSize::height
T height
Definition: MyGUI_TSize.h:21
MyGUI::ResourceManualPointer::setImage
virtual void setImage(ImageBox *_image)
Definition: MyGUI_ResourceManualPointer.cpp:42
MyGUI::ImageBox
ImageBox properties. Skin childs. ImageBox widget description should be here.
Definition: MyGUI_ImageBox.h:24
MyGUI::types::TPoint::top
T top
Definition: MyGUI_TPoint.h:21
MyGUI::ImageBox::deleteAllItems
void deleteAllItems()
Delete all items.
Definition: MyGUI_ImageBox.cpp:188
MyGUI::ResourceManualPointer::~ResourceManualPointer
virtual ~ResourceManualPointer()
Definition: MyGUI_ResourceManualPointer.cpp:20
MyGUI::types::TPoint< int >
MyGUI::ResourceManualPointer::ResourceManualPointer
ResourceManualPointer()
Definition: MyGUI_ResourceManualPointer.cpp:16
MyGUI::types::TSize::width
T width
Definition: MyGUI_TSize.h:20
MyGUI::ResourceManualPointer::deserialization
virtual void deserialization(xml::ElementPtr _node, Version _version)
Definition: MyGUI_ResourceManualPointer.cpp:24
MyGUI_CoordConverter.h
MyGUI::xml::Element
Definition: MyGUI_XmlDocument.h:159
MyGUI::xml::Element::findAttribute
bool findAttribute(const std::string &_name, std::string &_value)
Definition: MyGUI_XmlDocument.cpp:246
MyGUI_Precompiled.h
MyGUI_ResourceManualPointer.h
MyGUI::Version
Definition: MyGUI_Version.h:18
MyGUI_ImageBox.h
MyGUI::types::TPoint< int >::parse
static TPoint< int > parse(const std::string &_value)
Definition: MyGUI_TPoint.h:120
MyGUI::types::TPoint::left
T left
Definition: MyGUI_TPoint.h:20
MyGUI::xml::ElementEnumerator
Definition: MyGUI_XmlDocument.h:115
MyGUI::ResourceManualPointer::setPosition
virtual void setPosition(ImageBox *_image, const IntPoint &_point)
Definition: MyGUI_ResourceManualPointer.cpp:48
MyGUI_TextureUtility.h
MyGUI::Widget::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_Widget.cpp:689
MyGUI::types::TSize< int >::parse
static TSize< int > parse(const std::string &_value)
Definition: MyGUI_TSize.h:120
MyGUI::ImageBox::setImageInfo
void setImageInfo(const std::string &_texture, const IntCoord &_coord, const IntSize &_tile)
Definition: MyGUI_ImageBox.cpp:37
MyGUI::xml::Element::getElementEnumerator
ElementEnumerator getElementEnumerator()
Definition: MyGUI_XmlDocument.cpp:352
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI::xml::ElementEnumerator::next
bool next()
Definition: MyGUI_XmlDocument.cpp:100
MyGUI::types::TCoord::size
TSize< T > size() const
Definition: MyGUI_TCoord.h:190