27 lines
728 B
C++
27 lines
728 B
C++
#include "../include/LogWindow.h"
|
|
#include "../include/ConnectionWindow.h"
|
|
#include "imgui.h"
|
|
|
|
void LogWindow::render(bool* paramOpen, ConnectionWindow& connectionWindow) {
|
|
if (!ImGui::Begin("Transaction Log", paramOpen)) {
|
|
ImGui::End();
|
|
return;
|
|
}
|
|
|
|
std::string& log_ref = connectionWindow.getSharedLog();
|
|
|
|
ImGui::BeginChild("ScrollingRegion", ImVec2(0, -ImGui::GetFrameHeightWithSpacing()), true, ImGuiWindowFlags_HorizontalScrollbar);
|
|
ImGui::TextUnformatted(log_ref.c_str());
|
|
|
|
if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
|
|
ImGui::SetScrollHereY(1.0f);
|
|
}
|
|
ImGui::EndChild();
|
|
|
|
if (ImGui::Button("Clear Log")) {
|
|
log_ref.clear();
|
|
}
|
|
|
|
ImGui::End();
|
|
}
|