//************************************ // 函数名称: OnFolderChanged // 返回类型: bool // 参数信息: void * param // 函数说明: //************************************ bool CTreeViewUI::OnFolderChanged( void* param ) { TNotifyUI* pMsg = (TNotifyUI*)param; if(pMsg->sType == DUI_MSGTYPE_SELECTCHANGED) { CCheckBoxUI* pFolder = (CCheckBoxUI*)pMsg->pSender; CTreeNodeUI* pItem = (CTreeNodeUI*)pFolder->GetParent()->GetParent(); pItem->SetVisibleTag(!pFolder->GetCheck()); SetItemExpand(!pFolder->GetCheck(),pItem); return TRUE; } return TRUE; }
//************************************ // 函数名称: OnFolderChanged // 返回类型: bool // 参数信息: void * param // 函数说明: //************************************ bool CTreeViewUI::OnFolderChanged( void* param ) { TNotifyUI* pMsg = (TNotifyUI*)param; if(pMsg->sType == _T("selectchanged")) { CCheckBoxUI* pFolder = (CCheckBoxUI*)pMsg->pSender; CTreeNodeUI* pItem = (CTreeNodeUI*)pFolder->GetParent()->GetParent(); pItem->SetVisibleTag(!pFolder->GetCheck()); SetItemExpand(!pFolder->GetCheck(),pItem); return true; } return true; }
//************************************ // 函数名称: OnDBClickItem // 返回类型: bool // 参数信息: void * param // 函数说明: //************************************ bool CTreeViewUI::OnDBClickItem( void* param ) { TNotifyUI* pMsg = (TNotifyUI*)param; if(_tcsicmp(pMsg->sType, DUI_MSGTYPE_TREEITEMDBCLICK) == 0) { CTreeNodeUI* pItem = static_cast<CTreeNodeUI*>(pMsg->pSender); CCheckBoxUI* pFolder = pItem->GetFolderButton(); pFolder->Selected(!pFolder->IsSelected()); pItem->SetVisibleTag(!pFolder->GetCheck()); SetItemExpand(!pFolder->GetCheck(),pItem); return TRUE; } return FALSE; }
//************************************ // 函数名称: OnDBClickItem // 返回类型: bool // 参数信息: void * param // 函数说明: //************************************ bool CTreeViewUI::OnDBClickItem( void* param ) { TNotifyUI* pMsg = (TNotifyUI*)param; if(pMsg->sType == _T("itemdbclick")) { CTreeNodeUI* pItem = static_cast<CTreeNodeUI*>(pMsg->pSender); CCheckBoxUI* pFolder = pItem->GetFolderButton(); pFolder->Selected(!pFolder->IsSelected()); pItem->SetVisibleTag(!pFolder->GetCheck()); SetItemExpand(!pFolder->GetCheck(),pItem); return true; } return false; }
IMPL_LUA_FUNC(LuaCTreeNodeUI, SetVisibleTag) { try { CTreeNodeUI* self; self = static_cast<CTreeNodeUI*>(LuaStatic::CheckUserData(l, 1)); self->SetVisibleTag(lua_toboolean(l,2) != 0); return 0; } catch (...) { DuiException(_T("LuaCTreeNodeUI::SetVisibleTag")); return 0; } }