VOID CDataPool::WriteWindowEventToText(CString & text,CEGUI::Window* pWindow, const CString& gap) { EventArray* pEventArray = GetWindowEvent(pWindow->getName().c_str()); if (pEventArray) { CString textTemp; EventArray::iterator it = pEventArray->begin(); EventArray::iterator end = pEventArray->end(); for (; it != end; it++) { textTemp = gap; textTemp += "<Event Name=\""; textTemp += it->eventName; textTemp += "\" Function=\""; textTemp += it->funcName; if (it->isReadFromLayout) { textTemp += "\" />\n"; } else { textTemp += "()\" />\n"; } text += mbcs_to_utf8(textTemp); } } }
void CDataPool::AddWindowEventItem(const CString& szWindowName, const CString& szEventName, const CString& szFunction,BOOL isFromLayout /* =FALSE*/) { //如果没有,那么添加 AddWindowEvent(szWindowName); EventArray* pEA = GetWindowEvent(szWindowName); if (pEA) { //更新旧的 EventArray::iterator it = pEA->begin(); EventArray::iterator end = pEA->end(); for (; it != end; it++) { if(it->eventName == szEventName) { it->funcName = szFunction; return; } } //添加新的 Event_Define ed; ed.eventName = szEventName; ed.funcName = szFunction; ed.isReadFromLayout = isFromLayout; pEA->push_back(ed); } }
void closeAllEvent() { for (EventArray::iterator i = events.begin(), end = events.end(); i != end; i++) { ::CloseHandle(*i); } events.clear(); }