64 const ImGuiStyle& style = ImGui::GetStyle();
66 {{ImGuiStyleVar_FramePadding,
67 ImVec2(std::max(4.0f, style.FramePadding.x),
68 std::max(3.0f, style.FramePadding.y - 1.0f))},
69 {ImGuiStyleVar_ItemSpacing,
70 ImVec2(std::max(4.0f, style.ItemSpacing.x),
71 std::max(3.0f, style.ItemSpacing.y - 1.0f))}});
74 ImGui::OpenPopup(
"JumpToAddress");
76 if (ImGui::IsItemHovered()) {
77 ImGui::SetTooltip(tr(
"Jump to specific address"));
82 ImGui::OpenPopup(
"SearchPattern");
84 if (ImGui::IsItemHovered()) {
85 ImGui::SetTooltip(tr(
"Search for hex pattern"));
90 ImGui::OpenPopup(
"Bookmarks");
92 if (ImGui::IsItemHovered()) {
93 ImGui::SetTooltip(tr(
"Manage address bookmarks"));
115 if (ImGui::BeginPopupModal(
"JumpToAddress",
nullptr,
116 ImGuiWindowFlags_AlwaysAutoResize)) {
122 ImGui::SetNextItemWidth(200);
125 ImGuiInputTextFlags_CharsHexadecimal |
126 ImGuiInputTextFlags_EnterReturnsTrue)) {
132 ImGui::CloseCurrentPopup();
135 ImGui::TextDisabled(tr(
"Format: 0x1C800 or 1C800"));
147 ImGui::CloseCurrentPopup();
151 ImGui::CloseCurrentPopup();
203 if (ImGui::BeginPopupModal(
"Bookmarks",
nullptr,
204 ImGuiWindowFlags_AlwaysAutoResize)) {
216 if (ImGui::Button(
ICON_MD_ADD " Add Current Address", ImVec2(250, 0))) {
220 absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
221 new_bookmark.
description =
"User-defined bookmark";
226 ImGui::BeginChild(
"##bookmarks_list", ImVec2(0, 300),
true);
227 if (ImGui::BeginTable(
"##bookmarks_table", 3,
228 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
229 ImGuiTableFlags_Resizable)) {
230 ImGui::TableSetupColumn(
"Name", ImGuiTableColumnFlags_WidthFixed, 150);
231 ImGui::TableSetupColumn(
"Address", ImGuiTableColumnFlags_WidthFixed,
233 ImGui::TableSetupColumn(
"Description",
234 ImGuiTableColumnFlags_WidthStretch);
235 ImGui::TableHeadersRow();
237 for (
size_t i = 0; i <
bookmarks_.size(); ++i) {
239 ImGui::PushID(
static_cast<int>(i));
241 ImGui::TableNextRow();
242 ImGui::TableNextColumn();
243 if (ImGui::Selectable(bm.name.c_str(),
false,
244 ImGuiSelectableFlags_SpanAllColumns)) {
247 ImGui::CloseCurrentPopup();
250 ImGui::TableNextColumn();
253 ImGui::TableNextColumn();
254 ImGui::TextDisabled(
"%s", bm.description.c_str());
263 if (ImGui::Button(
ICON_MD_ADD " Add Bookmark", ImVec2(150, 0))) {
267 absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
268 new_bookmark.
description =
"User-defined bookmark";
282 ImGui::CloseCurrentPopup();