void iLcdSetFrame::ReadXmlFile()
{
TiXmlDocument doc(
"config.xml");
doc.LoadFile();
TiXmlElement* root = doc.FirstChildElement(
"ApplictionConfig");
if (root)
//检测主节点ApplictionConfig是否存在 {
//自启动节点 TiXmlElement* AutoStartElement = root->FirstChildElement(
"AutoStart" );
//时间间隔节点 TiXmlElement* TimeIntervalElement = root->FirstChildElement(
"TimeInterval" );
//背景图片节点 TiXmlElement* BgPicElement = root->FirstChildElement(
"BgPic" );
//背景音乐节点 TiXmlElement* BgMusicElement = root->FirstChildElement(
"BgMusic" );
//循环次数节点 TiXmlElement* RoNumElement = root->FirstChildElement(
"RoNum");
//自启动节点检测开始 if (AutoStartElement)
{
AutoStartStr = AutoStartElement->GetText();
wxString ASS(AutoStartStr, wxConvUTF8);
if (ASS.Cmp(wxT(
"1"))==0)
{
m_AutoStartCheck->SetValue(
true);
}
else {
m_AutoStartCheck->SetValue(
false);
}
}
//自启动节点检测结束 //时间间隔节点检测开始 if (TimeIntervalElement)
{
TimeIntervalStr = TimeIntervalElement->GetText();
wxString TIS(TimeIntervalStr, wxConvUTF8);
m_txtTimeCheck->SetValue(TIS);
//wxMessageBox(TIS, _("时间间隔")); }
//时间间隔节点检测结束 //背景图片节点检测开始 if (BgPicElement)
{
BgPicStr = BgPicElement->GetText();
wxString BGS(BgPicStr, wxConvUTF8);
m_txtBgPic->SetValue(BGS);
//wxMessageBox(BGS, _("背景图片节点检测")); }
//背景图片节点检测结束 //循环次数节点检测开始 if (RoNumElement)
{
RotateNumStr=RoNumElement->GetText();
wxString RN(RotateNumStr, wxConvUTF8);
m_txtRoateNum->SetValue(RN);
}
//循环次数节点检测结束 //背景音乐节点检测开始 if (BgMusicElement)
{
BgMusicStr = BgMusicElement->GetText();
wxString BGRS(BgMusicStr, wxConvUTF8);
m_txtBgMusic->SetValue(BGRS);
}
//背景图片节点检测结束 }
}