一、UIDesigner代碼問題 1、儲存skin檔案(*.xml)失敗,CLayoutManager::SaveSkinFile函數中開啟檔案失敗。
HANDLE hFile = ::CreateFile(pstrPathName, GENERIC_ALL, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
修改成
HANDLE hFile = ::CreateFile(pstrPathName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
2、DUILIB UIDesigner.exe 多個控制項布局的時候 總是會crash。
在使用UIDesigner.exe多個控制項布局總是出錯。發現代碼crash在
void CMultiUITracker::ExcludeChildren(CArray<CControlUI*,CControlUI*>&?arrSelected)
函數中,修改後正常。
void CMultiUITracker::ExcludeChildren(CArray<CControlUI*,CControlUI*>& arrSelected){int size = arrSelected.GetSize();int* pDepth = new int[size];for(int i=0; i<size; i++){ExtendedAttributes* pExtended = (ExtendedAttributes*)arrSelected[i]->GetTag();pDepth[i] = pExtended->nDepth;}for(int i=0; i<arrSelected.GetSize()-1; i++){CControlUI* pControl1 = arrSelected[i];for(int j=i+1; j<arrSelected.GetSize(); j++){if(pDepth[i] != pDepth[j]){CControlUI* pControl2 = arrSelected[j];if (pControl2){if (pDepth[i] < pDepth[j]){int depth = pDepth[j] - pDepth[i];while (depth--){CControlUI* tmp = pControl2->GetParent();if (tmp){pControl2 = tmp;}else{break;}}if (pControl1 == pControl2){arrSelected.RemoveAt(j--);}}else{int depth = pDepth[i] - pDepth[j];while (depth--){CControlUI* tmp = pControl1->GetParent();if (tmp){pControl1 = tmp;}else{break;}}if (pControl1 == pControl2){arrSelected.RemoveAt(i--);}}}}}}delete[] pDepth;}
代碼下載: uidesigner
二、介面設計器DuiDesigner使用方法
參考這篇文章: http://www.cnblogs.com/Alberl/p/3343838.html