1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-08 23:19:40 +01:00

Data types: moved ImGuiDataType_String to public API as a convenience enum value only. (#8266)

This commit is contained in:
ocornut 2025-01-06 14:22:03 +01:00
parent f169102c8e
commit 80aafbc81b
3 changed files with 4 additions and 3 deletions

View File

@ -29,7 +29,7 @@
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.91.7 WIP"
#define IMGUI_VERSION_NUM 19163
#define IMGUI_VERSION_NUM 19164
#define IMGUI_HAS_TABLE
/*
@ -1399,6 +1399,7 @@ enum ImGuiDataType_
ImGuiDataType_Float, // float
ImGuiDataType_Double, // double
ImGuiDataType_Bool, // bool (provided for user convenience, not supported by scalar widgets)
ImGuiDataType_String, // char* (provided for user convenience, not supported by scalar widgets)
ImGuiDataType_COUNT
};

View File

@ -827,8 +827,7 @@ struct ImGuiDataTypeInfo
// Extend ImGuiDataType_
enum ImGuiDataTypePrivate_
{
ImGuiDataType_String = ImGuiDataType_COUNT + 1,
ImGuiDataType_Pointer,
ImGuiDataType_Pointer = ImGuiDataType_COUNT + 1,
ImGuiDataType_ID,
};

View File

@ -2171,6 +2171,7 @@ static const ImGuiDataTypeInfo GDataTypeInfo[] =
{ sizeof(float), "float", "%.3f","%f" }, // ImGuiDataType_Float (float are promoted to double in va_arg)
{ sizeof(double), "double","%f", "%lf" }, // ImGuiDataType_Double
{ sizeof(bool), "bool", "%d", "%d" }, // ImGuiDataType_Bool
{ 0, "char*","%s", "%s" }, // ImGuiDataType_String
};
IM_STATIC_ASSERT(IM_ARRAYSIZE(GDataTypeInfo) == ImGuiDataType_COUNT);