MyGUI 3.4.3
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"
11
12namespace MyGUI
13{
14
16 {
17 Base::deserialization(_node, _version);
18
19 // берем детей и крутимся, основной цикл
21 while (info.next("Property"))
22 {
23 std::string_view key = info->findAttribute("key");
24 std::string_view value = info->findAttribute("value");
25
26 if (key == "Point")
27 mPoint = IntPoint::parse(value);
28 else if (key == "Size")
29 mSize = IntSize::parse(value);
30 else if (key == "Resource")
32 }
33 }
34
36 {
37 if (mImageSet != nullptr)
38 _image->setItemResourceInfo(mImageSet->getIndexInfo(0, 0));
39 }
40
42 {
43 _image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
44 }
45
46} // namespace MyGUI
Type * castType(bool _throw=true)
widget description should be here.
void setItemResourceInfo(const ImageIndexInfo &_info)
void setPosition(ImageBox *_image, const IntPoint &_point) override
void deserialization(xml::ElementPtr _node, Version _version) override
void setImage(ImageBox *_image) override
IResource * getByName(std::string_view _name, bool _throw=true) const
static ResourceManager & getInstance()
void setCoord(const IntCoord &_coord) override
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
Element * ElementPtr
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
static TPoint< int > parse(std::string_view _value)
static TSize< int > parse(std::string_view _value)