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

Method NewNode

RedisStudio/RedisDataUI.cpp:1059–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057}
1058
1059CTreeNodeUI* RedisDataUI::NewNode(const string& text, bool isLeaf)
1060{
1061 CTreeNodeUI* pNodeTmp = new CTreeNodeUI;
1062 pNodeTmp->SetItemTextColor(0XFF000000);
1063 pNodeTmp->SetItemHotTextColor(0XFF000000);
1064 pNodeTmp->SetSelItemTextColor(0XFF000000);
1065 pNodeTmp->SetItemText(Base::CharacterSet::ANSIToUnicode(text).c_str());
1066 pNodeTmp->SetAttribute(_T("height"), _T("22"));
1067 pNodeTmp->SetAttribute(_T("inset"), _T("0,0,0,0"));
1068 if (isLeaf)
1069 {
1070 pNodeTmp->SetAttribute(_T("itemattr"), _T("valign=\"left\" font=\"5\" textpadding=\"5,3,0,0\""));
1071 pNodeTmp->SetAttribute(_T("folderattr"), _T("padding=\"21,3,0,0\" width=\"16\" height=\"16\" selectedimage=\"file='TreeStandard.png' source='112,32,128,48'\" normalimage=\"file='TreeStandard.png' source='112,32,128,48'\""));
1072 }
1073 else
1074 {
1075 pNodeTmp->SetAttribute(_T("folderattr"), _T("padding=\"0,3,0,0\" width=\"16\" height=\"16\" selectedimage=\"file='tree_expand.png' source='0,0,16,16'\" normalimage=\"file='tree_expand.png' source='16,0,32,16'\""));
1076 pNodeTmp->SetAttribute(_T("itemattr"), _T("bkimage=\"file='TreeStandard.png' source='112,0,128,16' dest='5,3,21,19'\" valign=\"left\" font=\"5\" textpadding=\"25,3,0,0\""));
1077 }
1078 pNodeTmp->GetFolderButton()->SetEnabled(false);
1079 // if (isLeaf) pNodeTmp->SetAttribute(_T("folderattr"), _T("padding=\"0,3,0,0\" width=\"16\" height=\"16\" selectedimage=\"file='TreeStandard.png' source='112,32,128,48'\" normalimage=\"file='TreeStandard.png' source='112,32,128,48'\""));
1080 // else pNodeTmp->SetAttribute(_T("folderattr"), _T("padding=\"0,3,0,0\" width=\"16\" height=\"16\" selectedimage=\"file='TreeStandard.png' source='112,0,128,16'\" normalimage=\"file='TreeStandard.png' source='112,16,128,32'\""));
1081 return pNodeTmp;
1082}
1083
1084 void RedisDataUI::DelChildNode( CTreeNodeUI* pNode )
1085 {

Callers

nothing calls this directly

Calls 6

SetItemHotTextColorMethod · 0.80
SetSelItemTextColorMethod · 0.80
SetItemTextMethod · 0.80
SetItemTextColorMethod · 0.45
SetAttributeMethod · 0.45
SetEnabledMethod · 0.45

Tested by

no test coverage detected