| 546 | } |
| 547 | |
| 548 | void RedisDataUI::BackgroudWorkForRenderLevel(void) |
| 549 | { |
| 550 | /// 在OnKeyAdd pNode->GetFolderButton()->Selected(true) 会自动触发dbclick事件 所以此处要屏蔽自动产生的 |
| 551 | int dbNum = 0; |
| 552 | |
| 553 | /// 加载首层 |
| 554 | if (m_pAssistNode->GetParentNode() == m_pRootNode) |
| 555 | { |
| 556 | dbNum = m_pAssistNode->GetTag() - 1; |
| 557 | TkeyTree::const_iterator treeit = m_oKeyRoot[dbNum].begin(); |
| 558 | TkeyTree::const_iterator treeitend = m_oKeyRoot[dbNum].end(); |
| 559 | for (; treeit != treeitend; ++treeit) |
| 560 | { |
| 561 | if (treeit->second != NULL) continue; |
| 562 | |
| 563 | std::string theValue = treeit->first; |
| 564 | /// 叶子节点删除默认前缀@ |
| 565 | theValue.erase(theValue.begin()); |
| 566 | CTreeNodeUI* pPNode = m_pAssistNode; |
| 567 | |
| 568 | CTreeNodeUI* pnode = NewNode(theValue, treeit->second == NULL); |
| 569 | pnode->SetTag(treeit->second == NULL ? 0 : 1); |
| 570 | TreeKeyContactData* pData = new TreeKeyContactData; |
| 571 | pData->pPNode = pPNode; |
| 572 | pData->pNode = pnode; |
| 573 | ::PostMessage(GetHWND(), WM_USER_TREEADD, (WPARAM)pData, NULL); |
| 574 | } |
| 575 | treeit = m_oKeyRoot[dbNum].begin(); |
| 576 | for (; treeit != treeitend; ++treeit) |
| 577 | { |
| 578 | if (treeit->second == NULL) continue; |
| 579 | std::string theValue = treeit->first; |
| 580 | CTreeNodeUI* pPNode = m_pAssistNode; |
| 581 | |
| 582 | CTreeNodeUI* pnode = NewNode(theValue, treeit->second == NULL); |
| 583 | pnode->SetTag(treeit->second == NULL ? 0 : 1); |
| 584 | TreeKeyContactData* pData = new TreeKeyContactData; |
| 585 | pData->pPNode = pPNode; |
| 586 | pData->pNode = pnode; |
| 587 | ::PostMessage(GetHWND(), WM_USER_TREEADD, (WPARAM)pData, NULL); |
| 588 | } |
| 589 | } |
| 590 | else |
| 591 | { |
| 592 | CTreeNodeUI* pPNode = m_pAssistNode; |
| 593 | std::vector<string> vec; |
| 594 | while (pPNode) |
| 595 | { |
| 596 | if (pPNode->GetParentNode() == m_pRootNode) |
| 597 | { |
| 598 | dbNum = pPNode->GetTag() - 1; |
| 599 | break; |
| 600 | } |
| 601 | std::string key = Base::CharacterSet::UnicodeToANSI(pPNode->GetItemText().GetData()); |
| 602 | vec.push_back(key); |
| 603 | pPNode = pPNode->GetParentNode(); |
| 604 | } |
| 605 | TkeyTree *item = &m_oKeyRoot[dbNum]; |
nothing calls this directly
no test coverage detected