mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
InputFloat: When using ImGuiInputTextFlags_ReadOnly the step buttons are disabled. (#2257)
This commit is contained in:
parent
6b97ded438
commit
c738f9ef92
@ -62,6 +62,7 @@ Other Changes:
|
|||||||
This affects clamping window within the visible area: with this option enabled title bars need to be visible. (#899)
|
This affects clamping window within the visible area: with this option enabled title bars need to be visible. (#899)
|
||||||
- Window: Fixed using SetNextWindowPos() on a child window (which wasn't really documented) position the cursor as expected
|
- Window: Fixed using SetNextWindowPos() on a child window (which wasn't really documented) position the cursor as expected
|
||||||
in the parent window, so there is no mismatch between the layout in parent and the position of the child window.
|
in the parent window, so there is no mismatch between the layout in parent and the position of the child window.
|
||||||
|
- InputFloat: When using ImGuiInputTextFlags_ReadOnly the step buttons are disabled. (#2257)
|
||||||
- Error recovery: Extraneous/undesired calls to End() are now being caught by an assert in the End() function itself
|
- Error recovery: Extraneous/undesired calls to End() are now being caught by an assert in the End() function itself
|
||||||
at the call site (instead of being reported in EndFrame). Past the assert, they don't lead to crashes any more. (#1651)
|
at the call site (instead of being reported in EndFrame). Past the assert, they don't lead to crashes any more. (#1651)
|
||||||
- Error recovery: Missing calls to End(), pass the assert, should not lead to crashes or to the fallback Debug window
|
- Error recovery: Missing calls to End(), pass the assert, should not lead to crashes or to the fallback Debug window
|
||||||
|
@ -480,7 +480,7 @@ static void ShowDemoWindowWidgets()
|
|||||||
ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
|
ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
|
||||||
|
|
||||||
static float f0 = 0.001f;
|
static float f0 = 0.001f;
|
||||||
ImGui::InputFloat("input float", &f0, 0.01f, 1.0f);
|
ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f");
|
||||||
|
|
||||||
static double d0 = 999999.00000001;
|
static double d0 = 999999.00000001;
|
||||||
ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f");
|
ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f");
|
||||||
|
@ -2666,14 +2666,17 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
|
|||||||
PopItemWidth();
|
PopItemWidth();
|
||||||
|
|
||||||
// Step buttons
|
// Step buttons
|
||||||
|
ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups;
|
||||||
|
if (extra_flags & ImGuiInputTextFlags_ReadOnly)
|
||||||
|
button_flags |= ImGuiButtonFlags_Disabled;
|
||||||
SameLine(0, style.ItemInnerSpacing.x);
|
SameLine(0, style.ItemInnerSpacing.x);
|
||||||
if (ButtonEx("-", ImVec2(button_size, button_size), ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
|
if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
|
||||||
{
|
{
|
||||||
DataTypeApplyOp(data_type, '-', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
DataTypeApplyOp(data_type, '-', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
||||||
value_changed = true;
|
value_changed = true;
|
||||||
}
|
}
|
||||||
SameLine(0, style.ItemInnerSpacing.x);
|
SameLine(0, style.ItemInnerSpacing.x);
|
||||||
if (ButtonEx("+", ImVec2(button_size, button_size), ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
|
if (ButtonEx("+", ImVec2(button_size, button_size), button_flags))
|
||||||
{
|
{
|
||||||
DataTypeApplyOp(data_type, '+', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
DataTypeApplyOp(data_type, '+', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
||||||
value_changed = true;
|
value_changed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user