MCPcopy Create free account
hub / github.com/SatDump/SatDump / renderBitContainers

Function renderBitContainers

plugins/bitview_app/bitview.cpp:63–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 void renderBitContainers(std::vector<std::shared_ptr<satdump::BitContainer>> &all_bit_containers, std::shared_ptr<satdump::BitContainer> &current_container)
64 {
65 for (int i = 0; i < all_bit_containers.size(); i++)
66 {
67 auto &cont = all_bit_containers[i];
68
69 if (!cont)
70 continue;
71
72 ImGui::TreeNodeEx(cont->getName().c_str(), ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | (cont == current_container ? ImGuiTreeNodeFlags_Selected : 0));
73 if (ImGui::IsItemClicked())
74 {
75 current_container = cont;
76 }
77 ImGui::TreePush(std::string("##BitViewerTree" + cont->getID()).c_str());
78
79 bool del = false;
80 { // Closing button
81 ImGui::SameLine();
82 ImGui::Text(" ");
83 ImGui::SameLine();
84
85 ImGui::PushStyleColor(ImGuiCol_Text, style::theme.red.Value);
86 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4());
87 ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0);
88 if (ImGui::SmallButton(std::string(u8"\uf00d##dataset" + cont->getName()).c_str()))
89 {
90 logger->info("Closing bit container " + cont->getName());
91 del = true;
92 }
93 ImGui::PopStyleVar();
94 ImGui::PopStyleColor(2);
95 }
96
97 renderBitContainers(cont->all_bit_containers, current_container);
98 ImGui::TreePop();
99
100 if (del)
101 cont.reset();
102 }
103 }
104
105 void BitViewApplication::drawPanel()
106 {

Callers 1

drawPanelMethod · 0.85

Calls 14

PushStyleColorFunction · 0.85
ImVec4Class · 0.85
PushStyleVarFunction · 0.85
PopStyleVarFunction · 0.85
PopStyleColorFunction · 0.85
c_strMethod · 0.80
infoMethod · 0.80
stringFunction · 0.50
SameLineFunction · 0.50
TextFunction · 0.50
sizeMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected