本文整理汇总了C++中TiXmlNodeA::NextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlNodeA::NextSibling方法的具体用法?C++ TiXmlNodeA::NextSibling怎么用?C++ TiXmlNodeA::NextSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiXmlNodeA
的用法示例。
在下文中一共展示了TiXmlNodeA::NextSibling方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeConfigLang
void NativeLangSpeaker::changeConfigLang(HWND hDlg)
{
if (!_nativeLangA) return;
TiXmlNodeA *styleConfDlgNode = _nativeLangA->FirstChild("Dialog");
if (!styleConfDlgNode) return;
styleConfDlgNode = styleConfDlgNode->FirstChild("StyleConfig");
if (!styleConfDlgNode) return;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
// Set Title
const char *titre = (styleConfDlgNode->ToElement())->Attribute("title");
if ((titre && titre[0]) && hDlg)
{
const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding);
::SetWindowText(hDlg, nameW);
}
for (TiXmlNodeA *childNode = styleConfDlgNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *sentinel = element->Attribute("id", &id);
const char *name = element->Attribute("name");
if (sentinel && (name && name[0]))
{
HWND hItem = ::GetDlgItem(hDlg, id);
if (hItem)
{
const wchar_t *nameW = wmc->char2wchar(name, _nativeLangEncoding);
::SetWindowText(hItem, nameW);
}
}
}
styleConfDlgNode = styleConfDlgNode->FirstChild("SubDialog");
for (TiXmlNodeA *childNode = styleConfDlgNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *sentinel = element->Attribute("id", &id);
const char *name = element->Attribute("name");
if (sentinel && (name && name[0]))
{
HWND hItem = ::GetDlgItem(hDlg, id);
if (hItem)
{
const wchar_t *nameW = wmc->char2wchar(name, _nativeLangEncoding);
::SetWindowText(hItem, nameW);
}
}
}
}
示例2: StreamOut
void TiXmlElementA::StreamOut( TIXMLA_OSTREAM * stream ) const
{
(*stream) << "<" << value;
TiXmlAttributeA* attrib;
for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
{
(*stream) << " ";
attrib->StreamOut( stream );
}
// If this node has children, give it a closing tag. Else
// make it an empty tag.
TiXmlNodeA* node;
if ( firstChild )
{
(*stream) << ">";
for ( node = firstChild; node; node=node->NextSibling() )
{
node->StreamOut( stream );
}
(*stream) << "</" << value << ">";
}
else
{
(*stream) << " />";
}
}
示例3: getFileBrowserLangMenuStr
generic_string NativeLangSpeaker::getFileBrowserLangMenuStr(int cmdID, const TCHAR *defaultStr) const
{
if (!_nativeLangA) return defaultStr;
TiXmlNodeA *targetNode = _nativeLangA->FirstChild("FolderAsWorkspace");
if (!targetNode) return defaultStr;
targetNode = targetNode->FirstChild("Menus");
if (!targetNode) return defaultStr;
const char *name = NULL;
for (TiXmlNodeA *childNode = targetNode->FirstChildElement("Item");
childNode;
childNode = childNode->NextSibling("Item"))
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *idStr = element->Attribute("id", &id);
if (idStr && id == cmdID)
{
name = element->Attribute("name");
break;
}
}
if (name && name[0])
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
return wmc->char2wchar(name, _nativeLangEncoding);
}
return defaultStr;
}
示例4: getSpecialMenuEntryName
generic_string NativeLangSpeaker::getSpecialMenuEntryName(const char *entryName) const
{
if (!_nativeLangA) return TEXT("");
TiXmlNodeA *mainMenu = _nativeLangA->FirstChild("Menu");
if (!mainMenu) return TEXT("");
mainMenu = mainMenu->FirstChild("Main");
if (!mainMenu) return TEXT("");
TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries");
if (!entriesRoot) return TEXT("");
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
for (TiXmlNodeA *childNode = entriesRoot->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
const char *idName = element->Attribute("idName");
if (idName)
{
const char *name = element->Attribute("name");
if (!strcmp(idName, entryName))
{
return wmc->char2wchar(name, _nativeLangEncoding);
}
}
}
return TEXT("");
}
示例5: getNativeLangMenuString
generic_string NativeLangSpeaker::getNativeLangMenuString(int itemID) const
{
if (!_nativeLangA)
return TEXT("");
TiXmlNodeA *node = _nativeLangA->FirstChild("Menu");
if (!node) return TEXT("");
node = node->FirstChild("Main");
if (!node) return TEXT("");
node = node->FirstChild("Commands");
if (!node) return TEXT("");
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
for (TiXmlNodeA *childNode = node->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
if (element->Attribute("id", &id) && (id == itemID))
{
const char *name = element->Attribute("name");
if (name)
{
return wmc->char2wchar(name, _nativeLangEncoding);
}
}
}
return TEXT("");
}
示例6: changeShortcutmapperLang
void NativeLangSpeaker::changeShortcutmapperLang(ShortcutMapper * sm)
{
if (!_nativeLangA) return;
TiXmlNodeA *shortcuts = _nativeLangA->FirstChild("Dialog");
if (!shortcuts) return;
shortcuts = shortcuts->FirstChild("ShortcutMapper");
if (!shortcuts) return;
for (TiXmlNodeA *childNode = shortcuts->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int index;
if (element->Attribute("index", &index))
{
if (index > -1 && index < 5) //valid index only
{
const char *name = element->Attribute("name");
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const wchar_t * nameW = wmc->char2wchar(name, _nativeLangEncoding);
sm->translateTab(index, nameW);
}
}
}
}
示例7: Print
void TiXmlDocumentA::Print( FILE* cfile, int depth ) const
{
TiXmlNodeA* node;
for ( node=FirstChild(); node; node=node->NextSibling() )
{
node->Print( cfile, depth );
fprintf( cfile, "\n" );
}
}
示例8: changeDlgLang
bool NativeLangSpeaker::changeDlgLang(HWND hDlg, const char *dlgTagName, char *title)
{
if (title)
title[0] = '\0';
if (!_nativeLangA) return false;
TiXmlNodeA *dlgNode = _nativeLangA->FirstChild("Dialog");
if (!dlgNode) return false;
dlgNode = searchDlgNode(dlgNode, dlgTagName);
if (!dlgNode) return false;
#ifdef UNICODE
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
#endif
// Set Title
const char *titre = (dlgNode->ToElement())->Attribute("title");
if ((titre && titre[0]) && hDlg)
{
#ifdef UNICODE
const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding);
::SetWindowText(hDlg, nameW);
#else
::SetWindowText(hDlg, titre);
#endif
if (title)
strcpy(title, titre);
}
// Set the text of child control
for (TiXmlNodeA *childNode = dlgNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *sentinel = element->Attribute("id", &id);
const char *name = element->Attribute("name");
if (sentinel && (name && name[0]))
{
HWND hItem = ::GetDlgItem(hDlg, id);
if (hItem)
{
#ifdef UNICODE
const wchar_t *nameW = wmc->char2wchar(name, _nativeLangEncoding);
::SetWindowText(hItem, nameW);
#else
::SetWindowText(hItem, name);
#endif
}
}
}
return true;
}
示例9: changeLangTabDrapContextMenu
void NativeLangSpeaker::changeLangTabDrapContextMenu(HMENU hCM)
{
const int POS_GO2VIEW = 0;
const int POS_CLONE2VIEW = 1;
const char *goToViewA = NULL;
const char *cloneToViewA = NULL;
if (_nativeLangA)
{
TiXmlNodeA *tabBarMenu = _nativeLangA->FirstChild("Menu");
if (tabBarMenu)
tabBarMenu = tabBarMenu->FirstChild("TabBar");
if (tabBarMenu)
{
for (TiXmlNodeA *childNode = tabBarMenu->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int ordre;
element->Attribute("order", &ordre);
if (ordre == 5)
goToViewA = element->Attribute("name");
else if (ordre == 6)
cloneToViewA = element->Attribute("name");
}
}
//HMENU hCM = _tabPopupDropMenu.getMenuHandle();
#ifdef UNICODE
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
if (goToViewA && goToViewA[0])
{
const wchar_t *goToViewG = wmc->char2wchar(goToViewA, _nativeLangEncoding);
int cmdID = ::GetMenuItemID(hCM, POS_GO2VIEW);
::ModifyMenu(hCM, POS_GO2VIEW, MF_BYPOSITION|MF_STRING, cmdID, goToViewG);
}
if (cloneToViewA && cloneToViewA[0])
{
const wchar_t *cloneToViewG = wmc->char2wchar(cloneToViewA, _nativeLangEncoding);
int cmdID = ::GetMenuItemID(hCM, POS_CLONE2VIEW);
::ModifyMenu(hCM, POS_CLONE2VIEW, MF_BYPOSITION|MF_STRING, cmdID, cloneToViewG);
}
#else
if (goToViewA && goToViewA[0])
{
int cmdID = ::GetMenuItemID(hCM, POS_GO2VIEW);
::ModifyMenu(hCM, POS_GO2VIEW, MF_BYPOSITION, cmdID, goToViewA);
}
if (cloneToViewA && cloneToViewA[0])
{
int cmdID = ::GetMenuItemID(hCM, POS_CLONE2VIEW);
::ModifyMenu(hCM, POS_CLONE2VIEW, MF_BYPOSITION, cmdID, cloneToViewA);
}
#endif
}
}
示例10: NextSiblingElement
TiXmlElementA* TiXmlNodeA::NextSiblingElement( const char * _value ) const
{
TiXmlNodeA* node;
for ( node = NextSibling( _value );
node;
node = node->NextSibling( _value ) )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
示例11: FirstChildElement
TiXmlElementA* TiXmlNodeA::FirstChildElement() const
{
TiXmlNodeA* node;
for ( node = FirstChild();
node;
node = node->NextSibling() )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
示例12: searchDlgNode
TiXmlNodeA * NativeLangSpeaker::searchDlgNode(TiXmlNodeA *node, const char *dlgTagName)
{
TiXmlNodeA *dlgNode = node->FirstChild(dlgTagName);
if (dlgNode) return dlgNode;
for (TiXmlNodeA *childNode = node->FirstChildElement();
childNode ;
childNode = childNode->NextSibling() )
{
dlgNode = searchDlgNode(childNode, dlgTagName);
if (dlgNode) return dlgNode;
}
return NULL;
}
示例13: Clone
TiXmlNodeA* TiXmlDocumentA::Clone() const
{
TiXmlDocumentA* clone = new TiXmlDocumentA();
if ( !clone )
return 0;
CopyToClone( clone );
clone->error = error;
clone->errorDesc = errorDesc.c_str ();
for ( TiXmlNodeA* node = firstChild; node; node = node->NextSibling() )
{
clone->LinkEndChild( node->Clone() );
}
return clone;
}
示例14: changeDlgLang
bool WindowsDlg::changeDlgLang()
{
if (!_dlgNode) return false;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
int nativeLangEncoding = CP_ACP;
TiXmlDeclarationA *declaration = _dlgNode->GetDocument()->FirstChild()->ToDeclaration();
if (declaration)
{
const char * encodingStr = declaration->Encoding();
EncodingMapper *em = EncodingMapper::getInstance();
nativeLangEncoding = em->getEncodingFromString(encodingStr);
}
// Set Title
const char *titre = (_dlgNode->ToElement())->Attribute("title");
if (titre && titre[0])
{
const wchar_t *nameW = wmc->char2wchar(titre, nativeLangEncoding);
::SetWindowText(_hSelf, nameW);
}
// Set the text of child control
for (TiXmlNodeA *childNode = _dlgNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *sentinel = element->Attribute("id", &id);
const char *name = element->Attribute("name");
if (sentinel && (name && name[0]))
{
HWND hItem = ::GetDlgItem(_hSelf, id);
if (hItem)
{
const wchar_t *nameW = wmc->char2wchar(name, nativeLangEncoding);
::SetWindowText(hItem, nameW);
}
}
}
return true;
}
示例15: getProjectPanelLangMenuStr
generic_string NativeLangSpeaker::getProjectPanelLangMenuStr(const char * nodeName, int cmdID, const TCHAR *defaultStr) const
{
if (!_nativeLangA) return defaultStr;
TiXmlNodeA *targetNode = _nativeLangA->FirstChild("ProjectManager");
if (!targetNode) return defaultStr;
targetNode = targetNode->FirstChild("Menus");
if (!targetNode) return defaultStr;
targetNode = targetNode->FirstChild(nodeName);
if (!targetNode) return defaultStr;
const char *name = NULL;
for (TiXmlNodeA *childNode = targetNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *idStr = element->Attribute("id", &id);
if (idStr && id == cmdID)
{
name = element->Attribute("name");
break;
}
}
if (name && name[0])
{
#ifdef UNICODE
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
return wmc->char2wchar(name, _nativeLangEncoding);
#else
return name;
#endif
}
return defaultStr;
}