CTreeTab::CTreeTab(CPaintManagerUI* ppm) { CDialogBuilder builder; CDialogBuilderCallbackEx cb (ppm); CContainerUI* pbtnTab = static_cast<CContainerUI*>(builder.Create(_T("tree.xml"), 0, &cb, ppm)); if( pbtnTab ) { this->Add(pbtnTab); } else { this->RemoveAll(); return; } CDuiTreeView* pTree1 = static_cast<CDuiTreeView*>(pbtnTab->FindSubControl(_T("Tree1"))); pTree1->OnNotify += MakeDelegate(this,&CTreeTab::OnFolderChanged); if (pTree1) { pTree1->SetDepth(4); pTree1->SetExpandImage(_T("tree_expand.png")); CDuiTreeView::Node* pCategoryNode = NULL; CDuiTreeView::Node* pGameNode = NULL; CDuiTreeView::Node* pServerNode = NULL; CDuiTreeView::Node* pRoomNode = NULL; pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÍƼöÓÎÏ·")); for (int i = 0; i < 4; ++i) { pGameNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}ËÄÈ˶·µØÖ÷"), pCategoryNode); for (int i = 0; i < 3; ++i) { pServerNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}²âÊÔ·þÎñÆ÷"), pGameNode); for (int i = 0; i < 3; ++i) { pRoomNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}²âÊÔ·¿¼ä"), pServerNode); } } } pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}×î½üÍæ¹ýµÄÓÎÏ·")); for (int i = 0; i < 2; ++i) { pTree1->AddNode(_T("Èýȱһ"), pCategoryNode); } pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÆåÅÆÓÎÏ·")); for (int i = 0; i < 8; ++i) { pTree1->AddNode(_T("Ë«¿Û"), pCategoryNode); } pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÐÝÏÐÓÎÏ·")); for (int i = 0; i < 8; ++i) { pTree1->AddNode(_T("·ÉÐÐÆå"), pCategoryNode); } } }
void CBookClient::InEdit() { m_bEdit = !m_bEdit; int num = this->GetCount(); CContainerUI* pCtrl = NULL; for (int i = 0; i < num; ++i) { pCtrl = static_cast<CContainerUI*>(this->GetItemAt(i)); pCtrl = static_cast<CContainerUI*>(pCtrl->FindSubControl(_T("btnbookdel"))); ASSERT(pCtrl != NULL); pCtrl->SetVisible(m_bEdit); } }