2022-08-07 12:20:40 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <imgui.h>
|
|
|
|
#include <hex/ui/imgui_imhex_extensions.h>
|
|
|
|
|
2022-11-08 21:43:22 +01:00
|
|
|
namespace pl::ptrn { class Pattern; }
|
|
|
|
namespace hex::prv { class Provider; }
|
|
|
|
|
2022-08-07 12:20:40 +02:00
|
|
|
namespace hex::plugin::builtin::ui {
|
|
|
|
|
|
|
|
|
|
|
|
enum class SelectedRegion : int {
|
|
|
|
EntireData,
|
|
|
|
Selection
|
|
|
|
};
|
|
|
|
|
|
|
|
inline void regionSelectionPicker(SelectedRegion *region, bool showHeader = true, bool firstEntry = false) {
|
|
|
|
if (showHeader)
|
|
|
|
ImGui::Header("hex.builtin.common.range"_lang, firstEntry);
|
|
|
|
|
|
|
|
if (ImGui::RadioButton("hex.builtin.common.range.entire_data"_lang, *region == SelectedRegion::EntireData))
|
|
|
|
*region = SelectedRegion::EntireData;
|
|
|
|
if (ImGui::RadioButton("hex.builtin.common.range.selection"_lang, *region == SelectedRegion::Selection))
|
|
|
|
*region = SelectedRegion::Selection;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|