mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-23 15:06:04 +08:00
Added InputTextWithHint() (#2400)
Squashed commit of the following: commit1970d84051Author: Lucas Lazare <lazarelucas@yahoo.fr> Date: Tue Mar 5 12:20:39 2019 -0500 Removing sneaky tabulations #2 (why, editor T-T) I should update my settings, I guess commit219bdfcb7fAuthor: Lucas Lazare <lazarelucas@yahoo.fr> Date: Tue Mar 5 12:17:27 2019 -0500 Removing useless check introduced in b0d172 commit8afd7a2b45Author: Lucas Lazare <lazarelucas@yahoo.fr> Date: Tue Mar 5 11:49:24 2019 -0500 Removing sneaky tabulations commit8e04908631Author: Lucas Lazare <lazarelucas@yahoo.fr> Date: Tue Mar 5 11:45:13 2019 -0500 Moving InputTextHinted code to InputTextEx commitb0d1723a2fAuthor: Lucas Lazare <lazarelucas@yahoo.fr> Date: Tue Mar 5 00:23:02 2019 -0500 C++11 to C++98 commit9afeae3998Author: Lucas Lazare <lazarelucas@yahoo.fr> Date: Mon Mar 4 23:43:28 2019 -0500 Added InputTextHinted
This commit is contained in:
+4
-1
@@ -481,10 +481,13 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
{
|
||||
static char str0[128] = "Hello, world!";
|
||||
static int i0 = 123;
|
||||
ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
|
||||
ImGui::SameLine(); ShowHelpMarker("USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp).");
|
||||
|
||||
static char str1[128] = "";
|
||||
ImGui::InputTextWithHint("input text (w/ hint)", "enter text here", str1, IM_ARRAYSIZE(str1));
|
||||
|
||||
static int i0 = 123;
|
||||
ImGui::InputInt("input int", &i0);
|
||||
ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user