Skip to content

Commit

Permalink
Return true on user done
Browse files Browse the repository at this point in the history
  • Loading branch information
LAK132 authored and LAK132 committed Aug 24, 2018
1 parent 06e917f commit 6c6ddd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11388,6 +11388,8 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2

if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0)
return enter_pressed;
else if ((flags & ImGuiInputTextFlags_UserDoneReturnsTrue) != 0)
return value_changed && clear_active_id;
else
return value_changed;
}
Expand Down
1 change: 1 addition & 0 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input)
ImGuiInputTextFlags_CallbackResize = 1 << 18, // Allow buffer capacity resize + notify when the string wants to be resized (for string types which hold a cache of their Size) (see misc/stl/imgui_stl.h for an example of using this)
ImGuiInputTextFlags_UserDoneReturnsTrue = 1 << 19,
// [Internal]
ImGuiInputTextFlags_Multiline = 1 << 20 // For internal use by InputTextMultiline()
};
Expand Down

0 comments on commit 6c6ddd5

Please sign in to comment.