MyGUI  3.2.2
MyGUI_SubWidgetBinding.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 
10 namespace MyGUI
11 {
12 
14  {
15  clear();
16  }
17 
18  SubWidgetBinding::SubWidgetBinding(const IntCoord& _coord, Align _aligin, const std::string& _type)
19  {
20  create(_coord, _aligin, _type);
21  }
22 
23  void SubWidgetBinding::create(const IntCoord& _coord, Align _aligin, const std::string& _type)
24  {
25  clear();
26  mOffset = _coord;
27  mAlign = _aligin;
28  mType = _type;
29  }
30 
32  {
33  mType = "";
34  mAlign = Align::Default;
35  mStates.clear();
36  }
37 
38  void SubWidgetBinding::add(const std::string& _name, IStateInfo* _data, const std::string& _skin)
39  {
40  // ищем такой же ключ
41  MapStateInfo::const_iterator iter = mStates.find(_name);
42  if (iter != mStates.end())
43  {
44  delete _data;
45  MYGUI_LOG(Warning, "state with name '" << _name << "' already exist in skin '" << _skin << "'");
46  return;
47  }
48  // добавляем
49  mStates[_name] = _data;
50  }
51 
52 } // namespace MyGUI
MyGUI::SubWidgetBinding::clear
void clear()
Definition: MyGUI_SubWidgetBinding.cpp:31
MyGUI::SubWidgetBinding::create
void create(const IntCoord &_coord, Align _aligin, const std::string &_type)
Definition: MyGUI_SubWidgetBinding.cpp:23
MyGUI::Align
Definition: MyGUI_Align.h:19
MyGUI::IStateInfo
Definition: MyGUI_IStateInfo.h:16
MyGUI_Precompiled.h
MyGUI::Align::Default
Definition: MyGUI_Align.h:36
MyGUI::SubWidgetBinding::SubWidgetBinding
SubWidgetBinding()
Definition: MyGUI_SubWidgetBinding.cpp:13
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition: MyGUI_Diagnostic.h:22
MyGUI::SubWidgetBinding::add
void add(const std::string &_name, IStateInfo *_data, const std::string &_skin)
Definition: MyGUI_SubWidgetBinding.cpp:38
MyGUI_SubWidgetBinding.h
MyGUI::types::TCoord< int >
MyGUI
Definition: MyGUI_ActionController.h:14