bool wxTreeMultiXmlMapper::InitWizard(const wxString &xmlstring, const wxString &start_tag) { wxCHECK(m_ctrl, false); InitXML(); wxCHECK(m_tiDoc, false); // parse given XML string m_tiDoc->Parse(xmlstring.c_str()); if(!m_tiDoc->Error()) return DoInitWizard(start_tag); return false; }
bool wxTreeMultiXmlMapper::InitWizard(const wxFileName &xmlfile, const wxString &start_tag) { wxCHECK(m_ctrl, false); // create a new XML document InitXML(); wxCHECK(m_tiDoc, false); // load the contents from disk if(m_tiDoc->LoadFile(xmlfile.GetFullPath().c_str())) return DoInitWizard(start_tag); return false; }
//--------------------------------------- void CMiscAnnouncer::Init() { CryLog("CMiscAnnouncer::Init()"); IEntityClassRegistry *pEntityClassRegistry = gEnv->pEntitySystem->GetClassRegistry(); XmlNodeRef xmlData = GetISystem()->LoadXmlFromFile("Scripts/Sounds/MiscAnnouncements.xml"); InitXML(xmlData); CGameRules *pGameRules = g_pGame->GetGameRules(); pGameRules->RegisterRoundsListener(this); pGameRules->AddGameRulesListener(this); g_pGame->GetIGameFramework()->GetIItemSystem()->RegisterListener(this); }
BOOL CStartUAVDlg::OnInitDialog() { CDialog::OnInitDialog(); // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 m_ToolTip.Create(this); m_ToolTip.Activate(true); //图像大小 int nImageWidth =800; int nImageHeight =600; //计算对话框大小 int nDlgWidth =nImageWidth+10; int nDlgHeight =nImageHeight+110; CRect myRect; GetClientRect(&myRect); ClientToScreen(myRect); SetWindowPos(&CWnd::wndTop,myRect.left, myRect.top, nDlgWidth, nDlgHeight,SWP_NOMOVE); m_picLoc.MoveWindow(0,0,nImageWidth+5,nImageHeight+5); CRect rectPic; m_picLoc.GetWindowRect(&rectPic); ScreenToClient(&rectPic); m_BgContainer.Create ("STATIC" , _T(""), WS_CHILD|WS_VISIBLE|SS_NOTIFY , rectPic , this ,(UINT)-1); CString bmp_path = GetExePath() + "pic\\" + "界面.bmp"; m_BgContainer.SetImage(bmp_path); InitXML(); CreateButtons(); return TRUE; // 除非将焦点设置到控件,否则返回 TRUE }
ParticleFactory::ParticleFactory() { InitXML(); }