-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeparatorItem.cpp
75 lines (61 loc) · 1.63 KB
/
SeparatorItem.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*!
@file
@author Albert Semenov
@date 08/2010
*/
#include "Precompiled.h"
#include "SeparatorItem.h"
namespace tools
{
SeparatorItem::SeparatorItem() :
mPropertySet(nullptr)
{
mPropertySet = new PropertySet();
mPropertySet->createChild("Visible", "Bool", "False");
mPropertySet->createChild("Offset", "Int", "0");
mPropertySet->createChild("Corner", "", "Center");
}
SeparatorItem::~SeparatorItem()
{
delete mPropertySet;
}
const MyGUI::UString& SeparatorItem::getName() const
{
return mName;
}
void SeparatorItem::setName(const MyGUI::UString& _value)
{
mName = _value;
}
PropertySet* SeparatorItem::getPropertySet()
{
return mPropertySet;
}
MyGUI::Align SeparatorItem::getCorner()
{
return MyGUI::Align::parse(mPropertySet->getPropertyValue("Corner"));
}
void SeparatorItem::setCorner(MyGUI::Align _value)
{
mPropertySet->setPropertyValue("Corner", _value.print(), "");
}
void SeparatorItem::serialization(MyGUI::xml::Element* _node, MyGUI::Version _version)
{
_node->addAttribute("name", mName);
MyGUI::xml::Element* node = _node->createChild("PropertySet");
mPropertySet->serialization(node, _version);
}
/*void SeparatorItem::deserialization(MyGUI::xml::Element* _node, MyGUI::Version _version)
{
mName = _node->findAttribute("name");
MyGUI::xml::ElementEnumerator nodes = _node->getElementEnumerator();
while (nodes.next())
{
MyGUI::xml::Element* node = nodes.current();
if (node->getName() == "PropertySet")
{
mPropertySet->deserialization(node, _version);
}
}
}*/
} // namespace tools