10
// это можно в методы гуи занести
11
inline MyGUI::IntCoord convertCoordToParentCoord(const MyGUI::IntCoord& _coord, MyGUI::Widget* _widget)
13
MyGUI::IntCoord coord = _coord;
14
MyGUI::Widget* parent = _widget->getParent();
15
while (nullptr != parent)
17
coord = coord - parent->getPosition();
18
// а может у нас и дедушка есть? а может и прадед...
19
parent = parent->getParent();
24
inline void mapSet(MyGUI::VectorStringPairs& _map, const std::string& _key, const std::string& _value)
26
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
28
if (iter->first == _key)
30
iter->second = _value;
34
_map.push_back(MyGUI::PairString(_key, _value));
37
inline MyGUI::VectorStringPairs::iterator mapFind(MyGUI::VectorStringPairs& _map, const std::string& _key)
39
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
41
if (iter->first == _key)
47
inline void mapErase(MyGUI::VectorStringPairs& _map, const std::string& _key)
49
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
51
if (iter->first == _key)
58
} // namespace utility
61
#endif // __COMMON_H__
1
#ifndef _d90c3428_278f_44c7_9400_f8b7e1bff0bd_
2
#define _d90c3428_278f_44c7_9400_f8b7e1bff0bd_
11
// это можно в методы гуи занести
12
inline MyGUI::IntCoord convertCoordToParentCoord(const MyGUI::IntCoord& _coord, MyGUI::Widget* _widget)
14
MyGUI::IntCoord coord = _coord;
15
MyGUI::Widget* parent = _widget->getParent();
16
while (nullptr != parent)
18
coord = coord - parent->getPosition();
19
// а может у нас и дедушка есть? а может и прадед...
20
parent = parent->getParent();
25
inline void mapSet(MyGUI::VectorStringPairs& _map, const std::string& _key, const std::string& _value)
27
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
29
if (iter->first == _key)
31
iter->second = _value;
35
_map.push_back(MyGUI::PairString(_key, _value));
38
inline MyGUI::VectorStringPairs::iterator mapFind(MyGUI::VectorStringPairs& _map, const std::string& _key)
40
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
42
if (iter->first == _key)
48
inline void mapErase(MyGUI::VectorStringPairs& _map, const std::string& _key)
50
for (MyGUI::VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
52
if (iter->first == _key)