1
0
mirror of synced 2024-11-30 18:34:29 +01:00
ImHex/plugins/builtin/include/ui/widgets.hpp

25 lines
747 B
C++
Raw Normal View History

#pragma once
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
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;
}
}