MyGUI 3.4.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"
12
13namespace MyGUI
14{
15
17 {
19
20 // берем детей и крутимся, основной цикл
21 xml::ElementEnumerator info = _node->getElementEnumerator();
22 while (info.next("Property"))
23 {
24 const std::string& key = info->findAttribute("key");
25 const std::string& value = info->findAttribute("value");
26
27 if (key == "Point") mPoint = IntPoint::parse(value);
28 else if (key == "Size") mSize = IntSize::parse(value);
29 else if (key == "Texture") mTexture = value;
30 else if (key == "Coord") mTextureCoord = IntCoord::parse(value);
31 }
32 }
33
35 {
36 _image->deleteAllItems();
37 _image->setImageInfo(mTexture, mTextureCoord, mTextureCoord.size());
38 }
39
41 {
42 _image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
43 }
44
45} // namespace MyGUI
widget description should be here.
void deserialization(xml::ElementPtr _node, Version _version) override
void setImage(ImageBox *_image) override
void setPosition(ImageBox *_image, const IntPoint &_point) override
TSize< T > size() const
static TCoord< int > parse(const std::string &_value)
static TPoint< int > parse(const std::string &_value)
static TSize< int > parse(const std::string &_value)