void Cwhu_FaxSettingDlg::whu_AddAutoForArr(CStringArray &m_SorArr,CStringArray &m_AddArr) { int size = m_SorArr.GetSize(); CString m_FaxNum = m_AddArr.GetAt(0); int NumCount = 0; for (int i=0;i<size;i++) { CString m_str = m_SorArr.GetAt(i); if ((m_str == m_FaxNum)&&(i < size-1)) { CString m_str2 = m_SorArr.GetAt(i+1); int CharCount = m_str2.GetLength(); //字符串数组长度如果低于四,说明是来描述转发号码个数的标志位。//// if(CharCount<4) { int NumCount = _ttoi(m_str2); m_SorArr.RemoveAt(i,NumCount+2); break; } } } int m_AddSize = m_AddArr.GetSize(); if (m_AddSize>2) { m_SorArr.Append(m_AddArr); } }
//Ham tim co so toi thieu roi nhau //Vao: aszX //Ra : aszY void Minimum(CStringArray& aszX, CStringArray& aszY ) { aszY.RemoveAll(); CStringArray aszTemp; int i; aszTemp.Append(aszX); while(aszTemp.GetSize()) { CString tempS1,tempS2,S1,S2,S3; tempS1 = aszTemp[0]; aszTemp.RemoveAt(0); for(i=0; i<aszTemp.GetSize(); i++) { S1 = Common(tempS1,aszTemp[i]); if(!S1.IsEmpty()) break; } if(i==aszTemp.GetSize())//Neu X,Y khong co thuoc tinh chung { if(!tempS1.IsEmpty()) aszY.Add(tempS1); } else { tempS2 = aszTemp[i]; aszTemp.RemoveAt(i); if(!S1.IsEmpty()) aszTemp.Add(S1); S2 = Sub(tempS1,tempS2); if((!S2.IsEmpty())&&(S2 != S1)) aszTemp.Add(S2); S3 = Sub(tempS2,tempS1); if((!S3.IsEmpty())&&(S3 != S1)&&(S3 != S2)) aszTemp.Add(S3); } } }
// Get the list of database files associated void CLogObjectCAN::Der_GetDatabaseFiles(CStringArray& omList) { omList.Append(m_omListDBFiles); }
void CzhftoolApp::InitApplication(void) { CMDIFrameWnd* pAcadFrame = acedGetAcadFrame(); CString strPaletteSetNames[] = {_T("平面图库"), _T("地铁图库")} ; for (int iIndexSet=0; iIndexSet<2; iIndexSet++) { CZhfPaletteSet* pSet = new CZhfPaletteSet ; CRect rect(0, 0, 320, 300); pSet->Create(strPaletteSetNames[iIndexSet], WS_OVERLAPPED|WS_DLGFRAME, rect, pAcadFrame, PSS_EDIT_NAME | PSS_PROPERTIES_MENU | PSS_AUTO_ROLLUP | PSS_CLOSE_BUTTON) ; if (iIndexSet==0) { CString strFolds[] = {_T("xhj\\lj"), _T("xhj\\lf"), _T("xhj\\lfn"), _T("xhj\\dc"), _T("xhj\\yg"), _T("xhj\\tg"), _T("xhj\\fs"), _T("xhj\\dt"), _T("dc"), _T("jyj"), _T("box"), _T("dltb"), _T("jdq"), _T("sign"), _T("bg"), _T("dz"), _T("conti"), _T("pmt")} ; CString strPaletteNames[] = {_T("接车"), _T("发车"), _T("发车2"), _T("调车"), _T("预告"), _T("通过"), _T("复示"), _T("地铁"), _T("道岔"), _T("绝缘节"), _T("箱盒"), _T("电路"), _T("继电器"), _T("签字栏"), _T("表格"), _T("端子"), _T("连接符"), _T("其他")} ; int iFilterModes[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0} ; for (int i=0; i<18; i++) { CZhfPalette* pZhfPalette = new CZhfPalette() ; pZhfPalette->m_iFilterMode = iFilterModes[i] ; CString strFilePath ; CStringArray strArrayFile ; strFilePath.Format(_T("%s\\support\\%s"), g_strBasePath, strFolds[i]) ; CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayFile, 1) ; CBlkUtility::SortStringArray(strArrayFile) ; if (i==8)//将转辙机图形加入道岔项里面 { strFilePath.Format(_T("%s\\support\\zzj"), g_strBasePath) ; CStringArray strArrayPlus ; CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayPlus, 1) ; strArrayFile.Append(strArrayPlus) ; } if (i==12) { CStringArray strArrayFileNew ; for (int iJqdIndex=0; iJqdIndex<strArrayFile.GetCount(); iJqdIndex++) { if (strArrayFile.GetAt(iJqdIndex).Find(_T("Bold"))==-1) { strArrayFileNew.Add(strArrayFile.GetAt(iJqdIndex)) ; } } strArrayFile.RemoveAll() ; strArrayFile.Copy(strArrayFileNew) ; } pZhfPalette->m_strArrayFile.Copy(strArrayFile) ; CString strFileName ; for (int j=0; j<strArrayFile.GetCount(); j++) { CBlkUtility::GetFileName(strArrayFile.GetAt(j), strFileName) ; if (i<7) { CStringArray strArrayText ; CBlkUtility::DivideString(strFileName, _T("_"), strArrayText) ; strFileName.Format(_T("%s_%s"), strArrayText.GetAt(1), strArrayText.GetAt(2)) ; } pZhfPalette->m_strArrayFileName.Add(strFileName) ; } //if (i==1) { pZhfPalette->m_iCtrlWidth=80 ; pZhfPalette->m_iCtrlHeight = 80 ; } pZhfPalette->Create(WS_CHILD | WS_VISIBLE|WS_VSCROLL,strPaletteNames[i], pSet, PS_EDIT_NAME); //pZhfPalette->AddControls() ; pSet->AddPalette(pZhfPalette) ; } // Finally show the palette set pSet->EnableDocking(CBRS_ALIGN_ANY); pSet->RestoreControlBar(); } else if (iIndexSet==1) { CString strFolds[] = {_T("dt")} ; CString strPaletteNames[] = {_T("地铁")} ; int iFilterModes[] = {0} ; for (int i=0; i<1; i++) { CZhfPalette* pZhfPalette = new CZhfPalette() ; pZhfPalette->m_iFilterMode = iFilterModes[i] ; CString strFilePath ; CStringArray strArrayFile ; strFilePath.Format(_T("%s\\support\\%s"), g_strBasePath, strFolds[i]) ; CBlkUtility::FindFile(strFilePath, _T("dwg"), strArrayFile, 1) ; CBlkUtility::SortStringArray(strArrayFile) ; pZhfPalette->m_strArrayFile.Copy(strArrayFile) ; CString strFileName ; for (int j=0; j<strArrayFile.GetCount(); j++) { CBlkUtility::GetFileName(strArrayFile.GetAt(j), strFileName) ; // if (i<7) // { // CStringArray strArrayText ; // CBlkUtility::DivideString(strFileName, _T("_"), strArrayText) ; // strFileName.Format(_T("%s_%s"), strArrayText.GetAt(1), strArrayText.GetAt(2)) ; // } pZhfPalette->m_strArrayFileName.Add(strFileName) ; } //if (i==1) { pZhfPalette->m_iCtrlWidth=80 ; pZhfPalette->m_iCtrlHeight = 80 ; } pZhfPalette->Create(WS_CHILD | WS_VISIBLE|WS_VSCROLL,strPaletteNames[i], pSet, PS_EDIT_NAME); pSet->AddPalette(pZhfPalette) ; } // Finally show the palette set pSet->EnableDocking(CBRS_ALIGN_ANY); pSet->RestoreControlBar(); } pAcadFrame->ShowControlBar(pSet, FALSE, FALSE); g_pArrayZhfPaletteSet.Add(pSet) ; } g_bIsTukuFirst = false ; //插入信号机时是否加绝缘节 DWORD iAddJyj = 1 ; CBlkUtility::QueryValueReg(_T("ZHFTOOLS"), _T("AddJyjWhenInsertXhj"), iAddJyj) ; g_bAddJyjWhenInsertXhj = (iAddJyj==1?true:false) ; }
void INISetting::GetAllAppName(CStringArray & aAppNames) { aAppNames.RemoveAll(); aAppNames.Append(m_aAppNameArray); }