void SVSEView::editSVSEList(string &szName, string &szIndex) { if(!m_svSEList.empty()) { SVTableRow *pRow = m_svSEList.Row(szIndex); if(pRow) { SVTableCell * pCell = pRow->Cell(2); if(pCell) { if(pCell->Type() == adText) { ((WText*)pCell->Value())->setText(szName); ((WText*)pCell->Value())->setToolTip(szName); } } } } }
bool CSVSortList::checkDisplayIndex() { irow it; map<int, string, less<int> > lsDis; map<int, string, less<int> >::iterator lsDisItem; for(it = m_svList.begin(); it != m_svList.end(); it++) { SVTableCell *pCell = (*it).second.Cell(1); if(pCell && pCell->Type() == adLineEdit) { if(pCell->Value()) { string szIndex = ((WLineEdit*)pCell->Value())->text(); int nIndex = 0; if(!szIndex.empty()) nIndex = atoi(szIndex.c_str()); lsDisItem = lsDis.find(nIndex); while(lsDisItem != lsDis.end()) { nIndex ++; lsDisItem = lsDis.find(nIndex); } lsDis[nIndex] = pCell->Property(); } } } switch(m_nType) { case Tree_GROUP: saveGroup(lsDis); break; case Tree_DEVICE: saveDevice(lsDis); break; case Tree_MONITOR: saveMonitor(lsDis); break; } return true; }
//界面排序完毕 void CTuopList::SortOk() { string strUserID = GetWebUserID(); HitLog LogItem; LogItem.sUserName = strUserID; LogItem.sHitPro = "TuopList"; LogItem.sHitFunc = "SortOk"; LogItem.sDesc = strSaveSort; DWORD dcalBegin=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 0, 0); //数据有效性判断 如果编辑过程中 输入无效的序号 怎么处理?---》小于等于零 有重复数字 不连续 等?---》不容易完全判定清楚, 暂时不判定。 //是数字吗? //if(!pAlertStop->text().empty()) //{ // nRet = sscanf(pAlertStop->text().c_str(), "%d", &nTmp); // if(nRet == EOF || nRet == 0 || nTmp < 0) // { // errorMsgList.push_back(strAlertStopError); // bError = true; // } // else // { // sprintf(chItem, "%d", nTmp); // pAlertStop->setText(chItem); // } //} //写拓扑图的顺序数据到ini for(row it = m_svSortList.begin(); it != m_svSortList.end(); it++) { SVTableCell * pcell = it->second.Cell(1); if(pcell) { // 修改每一项的选择状态 if (pcell->Type() == adLineEdit) { // int nSort = 0; string strSortId = ((WLineEdit*)pcell->Value())->text(); sscanf(strSortId.c_str(), "%d", &nSort); //OutputDebugString(pcell->Row()); //OutputDebugString(strSortId.c_str()); // #ifdef Tuopu WriteIniFileInt("sort", pcell->Row(), nSort, "tuopfile.ini"); #else WriteIniFileInt("sort", pcell->Row(), nSort, "maintainfile.ini"); #endif } } } //更新拓扑列表的数据 //RecordList需要重新构造---》刷新函数能解决此问题吗?---》应该能解决 refresh(); //界面隐现 pSortTable->hide(); m_pTopologyListTable->show(); DWORD dcalEnd1=GetTickCount(); InsertHitRecord(LogItem.sUserName, LogItem.sHitPro, LogItem.sHitFunc, LogItem.sDesc, 1, dcalEnd1 - dcalBegin); }