MCPcopy Create free account
hub / github.com/Rezonality/zep / AddTree

Method AddTree

src/editor.cpp:331–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331ZepWindow* ZepEditor::AddTree()
332{
333 auto pTree = GetEmptyBuffer("Tree.tree", FileFlags::Locked | FileFlags::ReadOnly);
334 auto pTreeWindow = GetActiveTabWindow()->AddWindow(pTree, nullptr, RegionLayoutType::HBox);
335
336 auto pActiveWindow = GetActiveTabWindow()->GetActiveWindow();
337 pActiveWindow->SetBuffer(pTree);
338
339 auto pTreeModel = std::make_shared<ZepFileTree>();
340 auto pRoot = pTreeModel->GetRoot();
341
342 pRoot->AddChild(std::make_shared<ZepFileNode>("Child1", ZepTreeNodeFlags::IsFolder));
343 auto pChild2 = pRoot->AddChild(std::make_shared<ZepFileNode>("Child2", ZepTreeNodeFlags::IsFolder));
344 pChild2->AddChild(std::make_shared<ZepFileNode>("Child2_1"));
345
346 pRoot->ExpandAll(true);
347
348 auto pMode = std::make_shared<ZepMode_Tree>(*this, pTreeModel, *pActiveWindow, *pTreeWindow);
349 pTree->SetMode(pMode);
350 pMode->Begin(pActiveWindow);
351 return pActiveWindow;
352}
353
354ZepWindow* ZepEditor::AddSearch()
355{

Callers 1

HandleExCommandMethod · 0.80

Calls 8

AddWindowMethod · 0.80
GetActiveWindowMethod · 0.80
SetBufferMethod · 0.80
GetRootMethod · 0.80
AddChildMethod · 0.80
ExpandAllMethod · 0.80
SetModeMethod · 0.80
BeginMethod · 0.45

Tested by

no test coverage detected