本文整理汇总了C++中mygui::xml::ElementEnumerator::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ ElementEnumerator::getName方法的具体用法?C++ ElementEnumerator::getName怎么用?C++ ElementEnumerator::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::xml::ElementEnumerator
的用法示例。
在下文中一共展示了ElementEnumerator::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
ResourceItemInfo::ResourceItemInfo(MyGUI::xml::ElementEnumerator _node, MyGUI::Version _version) :
IResource(_node, _version)
{
MyGUI::xml::ElementEnumerator node = _node->getElementEnumerator();
while (node.next()) {
if (node->getName() == "Name") mItemName = node->getContent();
else if (node->getName() == "Description") mItemDescription = node->getContent();
else if (node->getName() == "Image") mItemResourceImage = node->findAttribute("RefID");
};
}
示例2: setupResources
void BaseManager::setupResources()
{
MyGUI::xml::Document doc;
if (!doc.open(std::string("resources.xml")))
doc.getLastError();
MyGUI::xml::ElementPtr root = doc.getRoot();
if (root == nullptr || root->getName() != "Paths")
return;
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while (node.next())
{
if (node->getName() == "Path")
{
if (node->findAttribute("root") != "")
{
bool root = MyGUI::utility::parseBool(node->findAttribute("root"));
if (root)
mRootMedia = node->getContent();
}
addResourceLocation(node->getContent(), false);
}
}
addResourceLocation(getRootMedia() + "/Common/Base");
}
示例3: loadValues
void WidgetTypes::loadValues(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version)
{
MyGUI::xml::ElementEnumerator widgets = _node->getElementEnumerator();
while (widgets.next("Value"))
{
std::string name = widgets->findAttribute("name");
PossibleValue* possible_value = getPossibleValue(name);
// тип мерджа переменных
std::string merge = widgets->findAttribute("merge");
// дополняем своими данными, по дефолту
if (merge == "add")
{
}
// удаляем и добавляем свои
else if (merge == "replace")
{
possible_value->values.clear();
}
// берем детей и крутимся
MyGUI::xml::ElementEnumerator field = widgets->getElementEnumerator();
while (field.next())
{
std::string key, value;
if (field->getName() == "Property")
{
if (!field->findAttribute("key", key))
continue;
possible_value->values.push_back(MyGUI::LanguageManager::getInstance().replaceTags(key));
}
}
}
}
示例4: _load
void HotkeyManager::_load( MyGUI::xml::ElementPtr root,const string xml )
{
if( root == nullptr || root->getName() != "HKS" )
{
WARNING_LOG("bad Hotkey config file "<<xml);
return;
}
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while( node.next() )
{
if( node->getName() == "hotkey" )
{
hotkey hk;
if( !node->findAttribute("name",hk.mName) )
{
WARNING_LOG("Hotkey config file "<<xml<<" invalid hotkey node");
continue;
}
node->findAttribute("caption",hk.mCaption);
node->findAttribute("tip",hk.mTip);
node->findAttribute("key",hk.mHotkey);
hk.mSHotkey = getStandardHotkeyName(hk.mHotkey);
mHotkeys.push_back( hk );
//设置对应Widget的User string,便于其显示出正常的热键
setWidgetHotkey( hk.mName,hk.mHotkey );
}
}
}
示例5: Setup
//--------------------------------------------------------------------------------
void System::Setup()
{
MyGUI::xml::Document doc;
if (!doc.open(std::string("resources.xml")))
doc.getLastError();
MyGUI::xml::ElementPtr root = doc.getRoot();
if (root == nullptr || root->getName() != "Paths")
return;
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while (node.next())
{
if (node->getName() == "Path")
{
bool root = false;
if (node->findAttribute("root") != "")
{
root = MyGUI::utility::parseBool(node->findAttribute("root"));
if (root) mRootMedia = node->getContent();
}
mPlatform->getDataManagerPtr()->addResourceLocation(node->getContent(), false);
}
}
}
示例6: setupResources
void MYGUIManager::setupResources()
{
MyGUI::xml::Document doc;
if ( !_platform || !doc.open(_resourcePathFile) ) doc.getLastError();
MyGUI::xml::ElementPtr root = doc.getRoot();
if ( root==nullptr || root->getName()!="Paths" ) return;
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while ( node.next() )
{
if ( node->getName()=="Path" )
{
bool root = false, recursive = false;
if (!node->findAttribute("root").empty())
{
root = MyGUI::utility::parseBool( node->findAttribute("root") );
if ( root ) _rootMedia = node->getContent();
}
if (!node->findAttribute("recursive").empty())
{
recursive = MyGUI::utility::parseBool(node->findAttribute("recursive"));
}
_platform->getDataManagerPtr()->addResourceLocation(node->getContent(), recursive);
}
}
}
示例7: if
void ResourceW32Pointer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
{
Base::deserialization(_node, _version);
MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
while (info.next())
{
if (info->getName() == "Property")
{
const std::string& key = info->findAttribute("key");
if (key == "SourceFile")
{
std::string path = MyGUI::DataManager::getInstance().getDataPath(info->getContent());
mHandle = (size_t)LoadCursorFromFileA(path.c_str());
}
else if (key == "SourceSystem")
{
std::string value = info->getContent();
if (value == "IDC_ARROW")
mHandle = (size_t)::LoadCursor(NULL, IDC_ARROW);
else if (value == "IDC_IBEAM")
mHandle = (size_t)::LoadCursor(NULL, IDC_IBEAM);
else if (value == "IDC_WAIT")
mHandle = (size_t)::LoadCursor(NULL, IDC_WAIT);
else if (value == "IDC_CROSS")
mHandle = (size_t)::LoadCursor(NULL, IDC_CROSS);
else if (value == "IDC_UPARROW")
mHandle = (size_t)::LoadCursor(NULL, IDC_UPARROW);
else if (value == "IDC_SIZE")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZE);
else if (value == "IDC_ICON")
mHandle = (size_t)::LoadCursor(NULL, IDC_ICON);
else if (value == "IDC_SIZENWSE")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENWSE);
else if (value == "IDC_SIZENESW")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENESW);
else if (value == "IDC_SIZEWE")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZEWE);
else if (value == "IDC_SIZENS")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENS);
else if (value == "IDC_SIZEALL")
mHandle = (size_t)::LoadCursor(NULL, IDC_SIZEALL);
else if (value == "IDC_NO")
mHandle = (size_t)::LoadCursor(NULL, IDC_NO);
else if (value == "IDC_HAND")
mHandle = (size_t)::LoadCursor(NULL, IDC_HAND);
else if (value == "IDC_APPSTARTING")
mHandle = (size_t)::LoadCursor(NULL, IDC_APPSTARTING);
else if (value == "IDC_HELP")
mHandle = (size_t)::LoadCursor(NULL, IDC_HELP);
}
}
}
}
示例8: loadXml
void HotKeyManager::loadXml(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version)
{
MyGUI::xml::ElementEnumerator node = _node->getElementEnumerator();
while (node.next("Command"))
{
HotKeyCommand command;
MyGUI::xml::ElementEnumerator nodeCommand = node->getElementEnumerator();
while (nodeCommand.next())
{
if (nodeCommand->getName() == "Name")
{
command.setCommand(nodeCommand->getContent());
}
/*else if (nodeCommand->getName() == "Pressed")
{
command.setPressed(MyGUI::utility::parseValue<bool>(nodeCommand->getContent()));
}*/
else if (nodeCommand->getName() == "KeyCode")
{
MapKeys::const_iterator item = mKeyNames.find(nodeCommand->getContent());
if (item != mKeyNames.end())
{
command.setKey((*item).second);
}
else
{
// log
}
}
else if (nodeCommand->getName() == "Modifier")
{
command.setShift(nodeCommand->getContent().find("Shift") != std::string::npos);
command.setControl(nodeCommand->getContent().find("Control") != std::string::npos);
}
}
addCommand(command);
}
}
示例9: deserialization
void ResourceSDLPointer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
{
Base::deserialization(_node, _version);
MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
while (info.next())
{
if (info->getName() == "Property")
{
const std::string& key = info->findAttribute("key");
if (key == "SourceFile")
{
//std::string path = MyGUI::DataManager::getInstance().getDataPath(info->getContent());
//mCursorType = (size_t)LoadCursorFromFileA(path.c_str());
}
else if (key == "SourceSystem")
{
std::string value = info->getContent();
if (value == "SDL_SYSTEM_CURSOR_ARROW")
mCursorType = SDL_SYSTEM_CURSOR_ARROW;
else if (value == "SDL_SYSTEM_CURSOR_IBEAM")
mCursorType = SDL_SYSTEM_CURSOR_IBEAM;
else if (value == "SDL_SYSTEM_CURSOR_WAIT")
mCursorType = SDL_SYSTEM_CURSOR_WAIT;
else if (value == "SDL_SYSTEM_CURSOR_CROSSHAIR")
mCursorType = SDL_SYSTEM_CURSOR_CROSSHAIR;
else if (value == "SDL_SYSTEM_CURSOR_SIZENWSE")
mCursorType = SDL_SYSTEM_CURSOR_SIZENWSE;
else if (value == "SDL_SYSTEM_CURSOR_SIZENESW")
mCursorType = SDL_SYSTEM_CURSOR_SIZENESW;
else if (value == "SDL_SYSTEM_CURSOR_SIZEWE")
mCursorType = SDL_SYSTEM_CURSOR_SIZEWE;
else if (value == "SDL_SYSTEM_CURSOR_SIZENS")
mCursorType = SDL_SYSTEM_CURSOR_SIZENS;
else if (value == "SDL_SYSTEM_CURSOR_SIZEALL")
mCursorType = SDL_SYSTEM_CURSOR_SIZEALL;
else if (value == "SDL_SYSTEM_CURSOR_NO")
mCursorType = SDL_SYSTEM_CURSOR_NO;
else if (value == "SDL_SYSTEM_CURSOR_HAND")
mCursorType = SDL_SYSTEM_CURSOR_HAND;
}
}
}
}
示例10: deserialization
void ScalingLayer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
{
MyGUI::OverlappedLayer::deserialization(_node, _version);
MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
while (info.next())
{
if (info->getName() == "Property")
{
const std::string& key = info->findAttribute("key");
const std::string& value = info->findAttribute("value");
if (key == "Size")
{
mViewSize = MyGUI::IntSize::parse(value);
}
}
}
}
示例11: load
void PropertiesPanelView::load(MyGUI::xml::ElementEnumerator _field)
{
MyGUI::xml::ElementEnumerator field = _field->getElementEnumerator();
VectorPanel::iterator iter = mPanels.begin();
while (field.next()) {
std::string key, value;
if (field->getName() == "Property")
{
if (false == field->findAttribute("key", key)) continue;
if (false == field->findAttribute("value", value)) continue;
if ((key == MyGUI::utility::toString("Panel"/*, i*/,"Minimized")) && (iter != mPanels.end()))
{
(*iter)->getPanelCell()->setMinimized(MyGUI::utility::parseBool(value));
++iter;
}
}
}
}
示例12: isNeedSolutionLoad
//===================================================================================
bool EditorState::isNeedSolutionLoad(MyGUI::xml::ElementEnumerator _field)
{
MyGUI::xml::ElementEnumerator field = _field->getElementEnumerator();
while (field.next())
{
std::string key, value;
if (field->getName() == "Property")
{
if (!field->findAttribute("key", key)) continue;
if (!field->findAttribute("value", value)) continue;
if (key == "MetaSolutionName")
{
return !value.empty();
}
}
}
return false;
}
示例13: loadFromFile
void DemoKeeper::loadFromFile(const std::string& _filename)
{
MyGUI::xml::Document doc;
if (!doc.open(_filename))
return;
MyGUI::xml::ElementPtr root = doc.getRoot();
if (root == nullptr || root->getName() != "AnimationGraph")
return;
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while (node.next())
{
if (node->getName() == "Node")
{
BaseAnimationNode* anim_node = createNode(node->findAttribute("type"), node->findAttribute("name"));
anim_node->deserialization(node.current());
}
else if (node->getName() == "Connections")
{
MyGUI::xml::ElementEnumerator conn = node->getElementEnumerator();
BaseAnimationNode* anim_node = getNodeByName(node.current()->findAttribute("node"));
if (anim_node)
{
while (conn.next("Connection"))
{
BaseAnimationNode* anim_node2 = getNodeByName(conn.current()->findAttribute("node"));
if (anim_node2)
{
//соединить точки в ноде
const std::string& from_point = conn.current()->findAttribute("from");
const std::string& to_point = conn.current()->findAttribute("to");
wraps::BaseGraphConnection* from_conn = anim_node->getConnectionByName(from_point, "EventOut");
if (!from_conn) from_conn = anim_node->getConnectionByName(from_point, "PositionOut");
if (!from_conn) from_conn = anim_node->getConnectionByName(from_point, "WeightOut");
wraps::BaseGraphConnection* to_conn = anim_node2->getConnectionByName(to_point, "EventIn");
if (!to_conn) to_conn = anim_node2->getConnectionByName(to_point, "PositionIn");
if (!to_conn) to_conn = anim_node2->getConnectionByName(to_point, "WeightIn");
if (from_conn && to_conn)
{
from_conn->addConnectionPoint(to_conn);
connectPoints(anim_node, anim_node2, from_point, to_point);
}
}
}
}
}
else if (node->getName() == "EditorData")
{
MyGUI::xml::ElementEnumerator item_data = node->getElementEnumerator();
while (item_data.next("Node"))
{
BaseAnimationNode* anim_node = getNodeByName(item_data.current()->findAttribute("name"));
if (anim_node)
{
anim_node->setCoord(MyGUI::IntCoord::parse(item_data.current()->findAttribute("coord")));
}
}
}
}
}
示例14: loadWidgets
void WidgetTypes::loadWidgets(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version)
{
MyGUI::xml::ElementEnumerator widgets = _node->getElementEnumerator();
while (widgets.next("Widget"))
{
WidgetStyle* widget_type = getWidgetType(widgets->findAttribute("name"));
widget_type->internalType = widgets->findAttribute("internal") == "true";
// берем детей и крутимся
MyGUI::xml::ElementEnumerator field = widgets->getElementEnumerator();
while (field.next())
{
std::string key, value, group;
if (field->getName() == "Property")
{
if (!field->findAttribute("key", key))
continue;
if (!field->findAttribute("value", value))
continue;
field->findAttribute("group", group);
if (key == "Skin")
{
std::string button_name = field->findAttribute("name");
if (button_name.empty())
button_name = value;
if (group.empty())
group = DEFAULT_GOROUP_NAME;
mSkinGroups[group].push_back(SkinInfo(value, widget_type->name, button_name));
widget_type->skin.push_back(value);
}
else if (key == "DefaultSkin")
widget_type->default_skin = value;
else if (key == "Parent")
widget_type->parent = MyGUI::utility::parseBool(value);
else if (key == "Child")
widget_type->child = MyGUI::utility::parseBool(value);
else if (key == "Resizeable")
widget_type->resizeable = MyGUI::utility::parseBool(value);
else if (key == "ItemManager")
widget_type->many_items = MyGUI::utility::parseBool(value);
else if (key == "Base")
widget_type->base = value;
}
else if (field->getName() == "Parameter")
{
if (!field->findAttribute("key", key))
continue;
if (!field->findAttribute("value", value))
continue;
widget_type->parameter.push_back(MyGUI::PairString(key, value));
}
else if (field->getName() == "TemplateData")
{
if (!field->findAttribute("key", key))
continue;
if (!field->findAttribute("value", value))
continue;
widget_type->templateData.push_back(MyGUI::PairString(key, value));
}
else if (field->getName() == "ParameterData")
{
if (!field->findAttribute("key", key))
continue;
if (!field->findAttribute("value", value))
continue;
widget_type->parameterData.push_back(MyGUI::PairString(key, value));
}
}
if (widget_type->base.empty() && widget_type->name != "Widget")
widget_type->base = "Widget";
}
updateDeep();
}
示例15: loadBase
bool BaseManager::loadBase(
const string& filename,
LuaVector& doScript,
LuaVector& locationScript,
LuaVector& loadScript
)
{
MyGUI::xml::Document doc;
if( !doc.open(mResourcePath+filename) )
{
if( !doc.open(filename) )
{
MyGUI::IDataStream* pdata = MyGUI::DataManager::getInstance().getData(filename);
if( pdata )
{
if( !doc.open(pdata) )
{
MyGUI::DataManager::getInstance().freeData(pdata);
ERROR_LOG(doc.getLastError());
return false;
}
MyGUI::DataManager::getInstance().freeData(pdata);
}
else
{
ERROR_LOG(doc.getLastError());
return false;
}
}
}
MyGUI::xml::ElementPtr root = doc.getRoot();
if (root == nullptr || root->getName() != "base")
return false;
// LuaVector groups;
MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
while( node.next() )
{
string name = node->getName();
if( name == "script" )
{
string lua;
if( node->findAttribute("do",lua) )
doScript.push_back( lua ); //等到LuaManager被创建后在一起执行
if( node->findAttribute("location",lua) )
{
if( find(locationScript.begin(),locationScript.end(),lua)==locationScript.end() )
locationScript.push_back( lua );
}
if( node->findAttribute("load",lua) )
{
loadScript.push_back(lua);
}
}
else if( name == "group" )
{
string name;
if( node->findAttribute("name",name) )
{
// if( find(groups.begin(),groups.end(),name)==groups.end() )
// groups.push_back(name);
MyGUI::xml::ElementEnumerator child = node->getElementEnumerator();
while( child.next() )
{
string type,location,recursive;
if( child->getName() == "repository" )
{
if( child->findAttribute("type",type) &&
child->findAttribute("recursive",recursive) &&
child->findAttribute("location",location) )
{
//加入组
addGroupLocation(name,type,location,recursive=="true"?true:false);
}
}
}
}
}
}
return true;
}