Select region when clicking on string, disassembly or pattern data item

This commit is contained in:
WerWolv
2020-11-23 13:10:14 +01:00
parent c281372b8d
commit 84f80b3e06
8 changed files with 65 additions and 1 deletions

View File

@@ -56,6 +56,19 @@ namespace hex {
if (filePath != nullptr)
this->openFile(filePath);
});
View::subscribeEvent(Events::SelectionChangeRequest, [this](const void *userData) {
const Region &region = *reinterpret_cast<const Region*>(userData);
auto page = this->m_dataProvider->getPageOfAddress(region.address);
if (!page.has_value())
return;
this->m_dataProvider->setCurrentPage(page.value());
this->m_memoryEditor.GotoAddr = region.address;
this->m_memoryEditor.DataPreviewAddr = region.address;
this->m_memoryEditor.DataPreviewAddrEnd = region.address + region.size - 1;
});
}
ViewHexEditor::~ViewHexEditor() {