ux: Update region setting after ticking "Match Selection" checkbox
This commit is contained in:
parent
e688d34587
commit
143cdbd44b
@ -107,7 +107,12 @@ namespace hex {
|
|||||||
|
|
||||||
ImGui::InputScalar("hex.view.disassembler.base"_lang, ImGuiDataType_U64, &this->m_baseAddress, nullptr, nullptr, "%08llX", ImGuiInputTextFlags_CharsHexadecimal);
|
ImGui::InputScalar("hex.view.disassembler.base"_lang, ImGuiDataType_U64, &this->m_baseAddress, nullptr, nullptr, "%08llX", ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
ImGui::InputScalarN("hex.view.disassembler.region"_lang, ImGuiDataType_U64, this->m_codeRegion, 2, nullptr, nullptr, "%08llX", ImGuiInputTextFlags_CharsHexadecimal);
|
ImGui::InputScalarN("hex.view.disassembler.region"_lang, ImGuiDataType_U64, this->m_codeRegion, 2, nullptr, nullptr, "%08llX", ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
|
|
||||||
ImGui::Checkbox("hex.common.match_selection"_lang, &this->m_shouldMatchSelection);
|
ImGui::Checkbox("hex.common.match_selection"_lang, &this->m_shouldMatchSelection);
|
||||||
|
if (ImGui::IsItemEdited()) {
|
||||||
|
// Force execution of Region Selection Event
|
||||||
|
EventManager::post<RequestSelectionChange>(Region{ 0, 0 });
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::TextUnformatted("hex.view.disassembler.settings.header"_lang);
|
ImGui::TextUnformatted("hex.view.disassembler.settings.header"_lang);
|
||||||
|
@ -49,7 +49,11 @@ namespace hex {
|
|||||||
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;
|
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;
|
||||||
|
|
||||||
ImGui::Checkbox("hex.common.match_selection"_lang, &this->m_shouldMatchSelection);
|
ImGui::Checkbox("hex.common.match_selection"_lang, &this->m_shouldMatchSelection);
|
||||||
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;
|
if (ImGui::IsItemEdited()) {
|
||||||
|
// Force execution of Region Selection Event
|
||||||
|
EventManager::post<RequestSelectionChange>(Region{ 0, 0 });
|
||||||
|
this->m_shouldInvalidate = true;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::TextUnformatted("hex.view.hashes.settings"_lang);
|
ImGui::TextUnformatted("hex.view.hashes.settings"_lang);
|
||||||
|
@ -138,13 +138,14 @@ namespace hex {
|
|||||||
|
|
||||||
if (!page.has_value())
|
if (!page.has_value())
|
||||||
return;
|
return;
|
||||||
if (region.size == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
provider->setCurrentPage(page.value());
|
if (region.size != 0) {
|
||||||
u64 start = region.address;
|
provider->setCurrentPage(page.value());
|
||||||
this->m_memoryEditor.GotoAddrAndSelect(start - provider->getBaseAddress(), start + region.size - provider->getBaseAddress() - 1);
|
u64 start = region.address;
|
||||||
EventManager::post<EventRegionSelected>(region);
|
this->m_memoryEditor.GotoAddrAndSelect(start - provider->getBaseAddress(), start + region.size - provider->getBaseAddress() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
EventManager::post<EventRegionSelected>(Region { this->m_memoryEditor.DataPreviewAddr, (this->m_memoryEditor.DataPreviewAddrEnd - this->m_memoryEditor.DataPreviewAddr) + 1});
|
||||||
});
|
});
|
||||||
|
|
||||||
EventManager::subscribe<EventProjectFileLoad>(this, []() {
|
EventManager::subscribe<EventProjectFileLoad>(this, []() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user