This commit is contained in:
T0b1
2023-06-03 01:32:24 +02:00
parent ec2eeb10f7
commit 4f0f320ac4
9 changed files with 172 additions and 11 deletions

View File

@@ -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();
}