MyGUI_SubWidgetBinding.cpp
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_SubWidgetBinding.h"
namespace MyGUI
{
SubWidgetBinding::SubWidgetBinding()
{
clear();
}
SubWidgetBinding::SubWidgetBinding(const IntCoord& _coord, Align _aligin, std::string_view _type)
{
create(_coord, _aligin, _type);
}
void SubWidgetBinding::create(const IntCoord& _coord, Align _aligin, std::string_view _type)
{
clear();
mOffset = _coord;
mAlign = _aligin;
mType = _type;
}
void SubWidgetBinding::clear()
{
mType.clear();
mAlign = Align::Default;
mStates.clear();
}
void SubWidgetBinding::add(std::string_view _name, IStateInfo* _data, std::string_view _skin)
{
// ищем такой же ключ
MapStateInfo::const_iterator iter = mStates.find(_name);
if (iter != mStates.end())
{
delete _data;
MYGUI_LOG(Warning, "state with name '" << _name << "' already exist in skin '" << _skin << "'");
return;
}
// добавляем
mStates.emplace(_name, _data);
}
} // namespace MyGUI
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition MyGUI_Diagnostic.h:17
MyGUI_Precompiled.h
MyGUI_SubWidgetBinding.h
MyGUI::IStateInfo
Definition MyGUI_IStateInfo.h:17
MyGUI::SubWidgetBinding::clear
void clear()
Definition MyGUI_SubWidgetBinding.cpp:31
MyGUI::SubWidgetBinding::create
void create(const IntCoord &_coord, Align _aligin, std::string_view _type)
Definition MyGUI_SubWidgetBinding.cpp:23
MyGUI::SubWidgetBinding::SubWidgetBinding
SubWidgetBinding()
Definition MyGUI_SubWidgetBinding.cpp:13
MyGUI::SubWidgetBinding::add
void add(std::string_view _name, IStateInfo *_data, std::string_view _skin)
Definition MyGUI_SubWidgetBinding.cpp:38
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::Align
Definition MyGUI_Align.h:20
MyGUI::Align::Default
@ Default
Definition MyGUI_Align.h:36