Update of /cvsroot/gcblue/gcb_wx/src/sim
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30331/src/sim
Modified Files:
tcNetworkView.cpp
Log Message:
Replaced libxml2 with TinyXml to make Xml easier to use
Index: tcNetworkView.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcNetworkView.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tcNetworkView.cpp 20 Mar 2004 18:46:47 -0000 1.7
--- tcNetworkView.cpp 24 Mar 2004 21:09:27 -0000 1.8
***************
*** 32,36 ****
#include "tcEditBox.h"
#include "tcConsoleBox.h"
! #include "tcXMLFile.h"
#include "network/tcMultiplayerInterface.h"
#include "wxcommands.h"
--- 32,36 ----
#include "tcEditBox.h"
#include "tcConsoleBox.h"
! #include "common/tinyxml.h"
#include "network/tcMultiplayerInterface.h"
#include "wxcommands.h"
***************
*** 209,220 ****
if (config)
{
- config->GetRootNode().WriteDebug();
AddXMLControls();
}
! tcXMLNode root = config->GetRootNode();
// add IP edit box
! tcXMLNode current = root.GetChildMatching("EditIP");
! ipEdit = new tcEditBox(this, ¤t);
ipEdit->SetCommand(1);
ipEdit->SetClearOnReturn(false);
--- 209,230 ----
if (config)
{
AddXMLControls();
}
! else
! {
! std::cerr << "tcNetworkView::tcNetworkView - NULL xml config node\n";
! return;
! }
!
! TiXmlNode* root = config->FirstChild("Window");
! if (!root)
! {
! std::cerr << "tcNetworkView::tcNetworkView - Missing top level <Window> tag\n";
! return;
! }
// add IP edit box
! TiXmlNode* current = root->FirstChild("EditIP");
! ipEdit = new tcEditBox(this, current);
ipEdit->SetCommand(1);
ipEdit->SetClearOnReturn(false);
***************
*** 222,238 ****
// read status box parameters
! current = root.GetChildMatching("StatusBox");
! statusBoxBounds.x = current.GetChildMatching("X").GetAsInt();
! statusBoxBounds.y = current.GetChildMatching("Y").GetAsInt();
! statusBoxBounds.width = current.GetChildMatching("Width").GetAsInt();
! statusBoxBounds.height = current.GetChildMatching("Height").GetAsInt();
// add chat text console
! current = root.GetChildMatching("ChatBox");
! chatBox = new tcConsoleBox(this, ¤t);
// add chat text edit box
! current = root.GetChildMatching("ChatEntry");
! chatEntry = new tcEditBox(this, ¤t);
chatEntry->SetCommand(2);
chatEntry->SetClearOnReturn(true);
--- 232,257 ----
// read status box parameters
! current = root->FirstChild("StatusBox");
!
! if (current)
! {
! TiXmlElement* elt = current->ToElement();
! elt->Attribute("X", &statusBoxBounds.x);
! elt->Attribute("Y", &statusBoxBounds.y);
! elt->Attribute("Width", &statusBoxBounds.width);
! elt->Attribute("Height", &statusBoxBounds.height);
! }
! else
! {
! std::cerr << "tcNetworkView::tcNetworkView - no StatusBox xml node\n";
! }
// add chat text console
! current = root->FirstChild("ChatBox");
! chatBox = new tcConsoleBox(this, current);
// add chat text edit box
! current = root->FirstChild("ChatEntry");
! chatEntry = new tcEditBox(this, current);
chatEntry->SetCommand(2);
chatEntry->SetClearOnReturn(true);
|