|
|
|
@ -2471,14 +2471,20 @@ bool ImGui::DragScalar(ImStrv label, ImGuiDataType data_type, void* p_data, floa |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
// FIXME-IMSTR
|
|
|
|
|
char format_0[64]; // format may not end with \0
|
|
|
|
|
const char* format = format_0; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_0)); |
|
|
|
|
ImStrncpy(format_0, format_p, IM_ARRAYSIZE(format_0)); |
|
|
|
|
|
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
const char* format; |
|
|
|
|
char format_buf[64]; |
|
|
|
|
if (!format_p) |
|
|
|
|
{ |
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
format = DataTypeGetInfo(data_type)->PrintFmt; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Copy format string (format may not be zero-terminated)
|
|
|
|
|
format = format_buf; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_buf)); |
|
|
|
|
ImStrncpy(format_buf, format_p, IM_ARRAYSIZE(format_buf)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); |
|
|
|
|
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id); |
|
|
|
@ -3070,13 +3076,20 @@ bool ImGui::SliderScalar(ImStrv label, ImGuiDataType data_type, void* p_data, co |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
// FIXME-IMSTR
|
|
|
|
|
char format_0[64]; // format may not end with \0
|
|
|
|
|
const char* format = format_0; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_0)); |
|
|
|
|
|
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
const char* format; |
|
|
|
|
char format_buf[64]; |
|
|
|
|
if (!format_p) |
|
|
|
|
{ |
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
format = DataTypeGetInfo(data_type)->PrintFmt; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Copy format string (format may not be zero-terminated)
|
|
|
|
|
format = format_buf; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_buf)); |
|
|
|
|
ImStrncpy(format_buf, format_p, IM_ARRAYSIZE(format_buf)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); |
|
|
|
|
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id); |
|
|
|
@ -3241,13 +3254,20 @@ bool ImGui::VSliderScalar(ImStrv label, const ImVec2& size, ImGuiDataType data_t |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
// FIXME-IMSTR
|
|
|
|
|
char format_0[64]; // format may not end with \0
|
|
|
|
|
const char* format = format_0; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_0)); |
|
|
|
|
|
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
const char* format; |
|
|
|
|
char format_buf[64]; |
|
|
|
|
if (!format_p) |
|
|
|
|
{ |
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
format = DataTypeGetInfo(data_type)->PrintFmt; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Copy format string (format may not be zero-terminated)
|
|
|
|
|
format = format_buf; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_buf)); |
|
|
|
|
ImStrncpy(format_buf, format_p, IM_ARRAYSIZE(format_buf)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags); |
|
|
|
|
const bool clicked = hovered && IsMouseClicked(0, ImGuiInputFlags_None, id); |
|
|
|
@ -3527,13 +3547,20 @@ bool ImGui::InputScalar(ImStrv label, ImGuiDataType data_type, void* p_data, con |
|
|
|
|
ImGuiStyle& style = g.Style; |
|
|
|
|
|
|
|
|
|
// FIXME-IMSTR
|
|
|
|
|
char format_0[64]; // format may not end with \0
|
|
|
|
|
const char* format = format_0; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_0)); |
|
|
|
|
ImStrncpy(format_0, format_p, IM_ARRAYSIZE(format_0)); |
|
|
|
|
|
|
|
|
|
const char* format; |
|
|
|
|
char format_buf[64]; |
|
|
|
|
if (!format_p) |
|
|
|
|
{ |
|
|
|
|
// Default format string when passing NULL
|
|
|
|
|
format = DataTypeGetInfo(data_type)->PrintFmt; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Copy format string (format may not be zero-terminated)
|
|
|
|
|
format = format_buf; |
|
|
|
|
IM_ASSERT(format_p.End - format_p.Begin < IM_ARRAYSIZE(format_buf)); |
|
|
|
|
ImStrncpy(format_buf, format_p, IM_ARRAYSIZE(format_buf)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void* p_data_default = (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasRefVal) ? &g.NextItemData.RefVal : &g.DataTypeZeroValue; |
|
|
|
|
|
|
|
|
|