WIP
This commit is contained in:
@@ -27,6 +27,16 @@ Frontend::Frontend()
|
||||
|
||||
void Frontend::run_frame()
|
||||
{
|
||||
if (_draw_metric_window)
|
||||
{
|
||||
ImGui::ShowMetricsWindow();
|
||||
}
|
||||
|
||||
if (_draw_stack_tool)
|
||||
{
|
||||
ImGui::ShowStackToolWindow();
|
||||
}
|
||||
|
||||
this->handle_msgs();
|
||||
this->draw_open_popup();
|
||||
this->draw_header();
|
||||
@@ -98,6 +108,13 @@ void Frontend::draw_header()
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
if (ImGui::BeginMenu("Debug"))
|
||||
{
|
||||
ImGui::MenuItem("Metrics", nullptr, &_draw_metric_window);
|
||||
ImGui::MenuItem("Stack Tool", nullptr, &_draw_stack_tool);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ namespace dbgui::frontend
|
||||
|
||||
bool _draw_second = false;
|
||||
|
||||
bool _draw_metric_window = false;
|
||||
bool _draw_stack_tool = false;
|
||||
|
||||
bool _draw_open_popup = false;
|
||||
ImGuiID _open_popup_id = 0;
|
||||
std::vector<char> _open_popup_name_buf = {};
|
||||
|
||||
@@ -88,6 +88,7 @@ void RegWindow::draw(const Frontend &frontend)
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: formatting options
|
||||
switch (reg.bytes.size())
|
||||
{
|
||||
case 1: std::snprintf(buf, sizeof(buf), "%X", reg.bytes[0]); break;
|
||||
@@ -109,7 +110,24 @@ void RegWindow::draw(const Frontend &frontend)
|
||||
default: std::snprintf(buf, sizeof(buf), "<val too large>"); break;
|
||||
}
|
||||
|
||||
ImGui::PushID(set_idx * 1000 + i);
|
||||
ImGui::Text(buf);
|
||||
if (ImGui::IsItemHovered()
|
||||
&& ImGui::IsMouseClicked(ImGuiMouseButton_Right))
|
||||
{
|
||||
ImGui::OpenPopup("Context");
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopup("Context"))
|
||||
{
|
||||
if (ImGui::Selectable("Copy"))
|
||||
{
|
||||
ImGui::SetClipboardText(buf);
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user