13 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6, 4));
14 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 4));
17 ImGui::OpenPopup(
"JumpToAddress");
19 if (ImGui::IsItemHovered()) {
20 ImGui::SetTooltip(
"Jump to specific address");
25 ImGui::OpenPopup(
"SearchPattern");
27 if (ImGui::IsItemHovered()) {
28 ImGui::SetTooltip(
"Search for hex pattern");
33 ImGui::OpenPopup(
"Bookmarks");
35 if (ImGui::IsItemHovered()) {
36 ImGui::SetTooltip(
"Manage address bookmarks");
45 ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
49 ImGui::PopStyleVar(2);
58 if (ImGui::BeginPopupModal(
"JumpToAddress",
nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
59 ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
64 ImGui::SetNextItemWidth(200);
66 ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_EnterReturnsTrue)) {
71 ImGui::CloseCurrentPopup();
74 ImGui::TextDisabled(
"Format: 0x1C800 or 1C800");
85 ImGui::CloseCurrentPopup();
89 ImGui::CloseCurrentPopup();
96 if (ImGui::BeginPopupModal(
"SearchPattern",
nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
97 ImGui::TextColored(ImVec4(0.4f, 0.8f, 0.4f, 1.0f),
102 ImGui::SetNextItemWidth(300);
104 ImGuiInputTextFlags_EnterReturnsTrue)) {
106 ImGui::CloseCurrentPopup();
108 ImGui::TextDisabled(
"Use ?? for wildcard (e.g. FF 00 ?? 12)");
113 if (ImGui::SmallButton(
"LDA")) {
117 if (ImGui::SmallButton(
"STA")) {
121 if (ImGui::SmallButton(
"JSR")) {
131 ImGui::CloseCurrentPopup();
135 ImGui::CloseCurrentPopup();
142 if (ImGui::BeginPopupModal(
"Bookmarks",
nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
143 ImGui::TextColored(ImVec4(1.0f, 0.843f, 0.0f, 1.0f),
154 if (ImGui::Button(
ICON_MD_ADD " Add Current Address", ImVec2(250, 0))) {
157 new_bookmark.
name = absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
158 new_bookmark.
description =
"User-defined bookmark";
163 ImGui::BeginChild(
"##bookmarks_list", ImVec2(500, 300),
true);
164 if (ImGui::BeginTable(
"##bookmarks_table", 3,
165 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
166 ImGuiTableFlags_Resizable)) {
167 ImGui::TableSetupColumn(
"Name", ImGuiTableColumnFlags_WidthFixed, 150);
168 ImGui::TableSetupColumn(
"Address", ImGuiTableColumnFlags_WidthFixed, 100);
169 ImGui::TableSetupColumn(
"Description", ImGuiTableColumnFlags_WidthStretch);
170 ImGui::TableHeadersRow();
172 for (
size_t i = 0; i <
bookmarks_.size(); ++i) {
174 ImGui::PushID(
static_cast<int>(i));
176 ImGui::TableNextRow();
177 ImGui::TableNextColumn();
178 if (ImGui::Selectable(bm.name.c_str(),
false, ImGuiSelectableFlags_SpanAllColumns)) {
180 ImGui::CloseCurrentPopup();
183 ImGui::TableNextColumn();
184 ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
"0x%06X", bm.address);
186 ImGui::TableNextColumn();
187 ImGui::TextDisabled(
"%s", bm.description.c_str());
196 if (ImGui::Button(
ICON_MD_ADD " Add Bookmark", ImVec2(150, 0))) {
199 new_bookmark.
name = absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
200 new_bookmark.
description =
"User-defined bookmark";
214 ImGui::CloseCurrentPopup();