1
0
mirror of synced 2024-12-11 15:36:01 +01:00
ImHex/plugins/builtin/include/ui/widgets.hpp

28 lines
825 B
C++
Raw Normal View History

#pragma once
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
namespace pl::ptrn { class Pattern; }
namespace hex::prv { class Provider; }
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;
}
}