Added simple bookmarks / comments feature. No saving yet though

This commit is contained in:
WerWolv
2020-11-28 00:33:26 +01:00
parent 3827919a32
commit 985e924e9d
6 changed files with 148 additions and 2 deletions

View File

@@ -264,6 +264,13 @@ namespace hex {
ImGui::EndMenu();
}
if (ImGui::MenuItem("Create bookmark", nullptr, false, this->m_memoryEditor.DataPreviewAddr != -1 && this->m_memoryEditor.DataPreviewAddrEnd != -1)) {
size_t start = std::min(this->m_memoryEditor.DataPreviewAddr, this->m_memoryEditor.DataPreviewAddrEnd);
size_t end = std::max(this->m_memoryEditor.DataPreviewAddr, this->m_memoryEditor.DataPreviewAddrEnd);
Region selectionRegion = { start, end - start + 1 };
View::postEvent(Events::AddBookmark, &selectionRegion);
}
ImGui::EndMenu();
}