From 9c399ee3be90509d93de58d755a54dc781a72aa3 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 17 Jun 2015 18:36:06 -0600 Subject: [PATCH] Demo for InputTextMultiline() (#200) --- imgui.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index fbb6fa18..d1113525 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10822,6 +10822,15 @@ void ImGui::ShowTestWindow(bool* opened) ImGui::TreePop(); } + if (ImGui::TreeNode("Multi-line Text Input")) + { + static char text[1024*4] = "// F00F bug\nlabel:\n\tlock cmpxchg8b eax\n"; + ImGui::PushItemWidth(-1.0f); + ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(0.f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput); + ImGui::PopItemWidth(); + ImGui::TreePop(); + } + if (ImGui::TreeNode("Dragging")) { ImGui::TextWrapped("You can use ImGui::GetItemActiveDragDelta() to query for the dragged amount on any widget."); @@ -10953,15 +10962,6 @@ void ImGui::ShowTestWindow(bool* opened) //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4); //ImGui::PopItemWidth(); - if (ImGui::TreeNode("Multi-line text input")) - { - static char text[1024*4] = "// F00F bug\nlabel:\n\tlock cmpxchg8b eax\n"; - ImGui::PushItemWidth(-1.0f); - ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(0.f, ImGui::GetTextLineHeight() * 8), ImGuiInputTextFlags_AllowTabInput); - ImGui::PopItemWidth(); - ImGui::TreePop(); - } - if (ImGui::TreeNode("Multi-component Widgets")) { ImGui::Unindent();