Update InputHex variants, gui::Canvas
This commit is contained in:
@@ -55,6 +55,7 @@ class Canvas {
|
|||||||
auto Points() const { return points_; }
|
auto Points() const { return points_; }
|
||||||
auto GetDrawList() const { return draw_list_; }
|
auto GetDrawList() const { return draw_list_; }
|
||||||
auto GetZeroPoint() const { return canvas_p0_; }
|
auto GetZeroPoint() const { return canvas_p0_; }
|
||||||
|
auto Scrolling() const { return scrolling_; }
|
||||||
auto GetCurrentDrawnTilePosition() const { return drawn_tile_pos_; }
|
auto GetCurrentDrawnTilePosition() const { return drawn_tile_pos_; }
|
||||||
auto GetCanvasSize() const { return canvas_sz_; }
|
auto GetCanvasSize() const { return canvas_sz_; }
|
||||||
void SetCanvasSize(ImVec2 canvas_size) {
|
void SetCanvasSize(ImVec2 canvas_size) {
|
||||||
|
|||||||
@@ -24,6 +24,18 @@ bool InputHexShort(const char* label, uint32_t* data) {
|
|||||||
ImGuiInputTextFlags_CharsHexadecimal);
|
ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InputHexWord(const char* label, uint16_t* data) {
|
||||||
|
return ImGui::InputScalar(label, ImGuiDataType_U16, data, &kStepOneHex,
|
||||||
|
&kStepFastHex, "%04X",
|
||||||
|
ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool InputHexByte(const char* label, uint8_t* data) {
|
||||||
|
return ImGui::InputScalar(label, ImGuiDataType_U8, data, &kStepOneHex,
|
||||||
|
&kStepFastHex, "%02X",
|
||||||
|
ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
|
}
|
||||||
|
|
||||||
void ItemLabel(absl::string_view title, ItemLabelFlags flags) {
|
void ItemLabel(absl::string_view title, ItemLabelFlags flags) {
|
||||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||||
const ImVec2 lineStart = ImGui::GetCursorScreenPos();
|
const ImVec2 lineStart = ImGui::GetCursorScreenPos();
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ constexpr ImVec2 kZeroPos = ImVec2(0, 0);
|
|||||||
|
|
||||||
IMGUI_API bool InputHex(const char* label, uint64_t* data);
|
IMGUI_API bool InputHex(const char* label, uint64_t* data);
|
||||||
IMGUI_API bool InputHexShort(const char* label, uint32_t* data);
|
IMGUI_API bool InputHexShort(const char* label, uint32_t* data);
|
||||||
|
IMGUI_API bool InputHexWord(const char* label, uint16_t* data);
|
||||||
|
IMGUI_API bool InputHexByte(const char* label, uint8_t* data);
|
||||||
|
|
||||||
using ItemLabelFlags = enum ItemLabelFlag {
|
using ItemLabelFlags = enum ItemLabelFlag {
|
||||||
Left = 1u << 0u,
|
Left = 1u << 0u,
|
||||||
|
|||||||
Reference in New Issue
Block a user