本文整理汇总了C++中ToolBarItem::ReadNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolBarItem::ReadNode方法的具体用法?C++ ToolBarItem::ReadNode怎么用?C++ ToolBarItem::ReadNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolBarItem
的用法示例。
在下文中一共展示了ToolBarItem::ReadNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadNode
//----------------------------------------------------------------
bool ToolBar::ReadNode(wxXmlNode* node)
/**
* \brief Read out a 'toolbar' xml element node.
* See class description for structure of such an xml node.
* \param node The 'toolbar' xml element node.
* \return True on success; false otherwise.
**/
{
// Fehler überprüfen
if (unlikely(node == NULL)) {
wxLogError(_T("[penv::ToolBar::ReadNode] Cannot load xml node, because parameter argument is NULL."));
return (false);
}
if (unlikely(node->GetType() != wxXML_ELEMENT_NODE)) {
wxLogError(_T("[penv::ToolBar::ReadNode] Cannot load, xml node must be an element node."));
return (false);
}
if (unlikely(node->GetName() != _T("toolbar"))) {
wxLogError(_T("[penv::ToolBar::ReadNode] Cannot load, xml element node must have the name \"toolbar\". This element node has the name \"%s\"."), node->GetName().c_str());
return (false);
}
// Einlesen der Attribute der Toolbar
if (unlikely(!node->HasProp(_T("id")))) {
wxLogError(_T("[penv::ToolBar::ReadNode] Cannot load, xml element node must have the attribute \"id\". This element node has the name \"%s\"."), node->GetName().c_str());
return (false);
}
m_id = node->GetPropVal(_T("id"), wxEmptyString);
CorrectToolbarId();
m_name = node->GetPropVal(_T("name"), wxEmptyString);
m_visible = PenvHelper::ParseBoolean(node->GetPropVal(_T("visible"), _T("true")));
// Einlesen der Position und der ToolBar Items
Environment* env = Environment::Get();
wxXmlNode* child = node->GetChildren();
while (child != NULL)
{
// Nicht Elemente überspringen
if (unlikely(child->GetType() != wxXML_ELEMENT_NODE)) {
child = child->GetNext();
continue;
}
if (child->GetName() == _T("position")) {
wxString strg = child->GetNodeContent();
env->GetFrame()->GetManager()->LoadPaneInfo(strg, m_paneinfo);
}
if (child->GetName() == _T("toolitem")) {
ToolBarItem* item = new ToolBarItem();
if (!item->ReadNode(child)) {
wxLogWarning(_T("[penv::ToolBar::ReadNode] Toolbar item in toolbar \"%s\" could not be readed. Skipping..."), m_name.c_str());
delete item;
} else {
Add(item);
}
}
child = child->GetNext();
}
return (true);
}