MCPcopy Create free account
hub / github.com/cinience/RedisStudio / SetItemExpand

Method SetItemExpand

DuiLib/Control/UITreeView.cpp:1133–1166  ·  view source on GitHub ↗

��������: SetItemExpand ��������: void ������Ϣ: bool _Expanded ������Ϣ: CTreeNodeUI * _TreeNode ����˵��:

Source from the content-addressed store, hash-verified

1131 // ����˵��:
1132 //************************************
1133 void CTreeViewUI::SetItemExpand( bool _Expanded,CTreeNodeUI* _TreeNode /*= NULL*/ )
1134 {
1135 if(_TreeNode)
1136 {
1137 if(_TreeNode->GetCountChild() > 0)
1138 {
1139 int nCount = _TreeNode->GetCountChild();
1140 for(int nIndex = 0;nIndex < nCount;nIndex++)
1141 {
1142 CTreeNodeUI* pItem = _TreeNode->GetChildNode(nIndex);
1143 pItem->SetVisible(_Expanded);
1144
1145 if(pItem->GetCountChild() && !pItem->GetFolderButton()->IsSelected())
1146 SetItemExpand(_Expanded,pItem);
1147 }
1148 }
1149 }
1150 else
1151 {
1152 int nIndex = 0;
1153 int nCount = GetCount();
1154 while(nIndex < nCount)
1155 {
1156 CTreeNodeUI* pItem = (CTreeNodeUI*)GetItemAt(nIndex);
1157
1158 pItem->SetVisible(_Expanded);
1159
1160 if(pItem->GetCountChild() && !pItem->GetFolderButton()->IsSelected())
1161 SetItemExpand(_Expanded,pItem);
1162
1163 nIndex++;
1164 }
1165 }
1166 }
1167
1168 //************************************
1169 // ��������: SetVisibleFolderBtn

Callers

nothing calls this directly

Calls 4

GetCountChildMethod · 0.80
GetChildNodeMethod · 0.80
SetVisibleMethod · 0.45
IsSelectedMethod · 0.45

Tested by

no test coverage detected