@@ -105,6 +105,7 @@ import imgui.internal.Window
105105import java.util.*
106106import imgui.Context as g
107107import glm_.vec2.operators.div
108+ import imgui.ImGui.inputTextMultiline
108109import imgui.ImGui.isMouseDoubleClicked
109110import imgui.ImGui.newLine
110111
@@ -383,9 +384,9 @@ interface imgui_demoDebugInfo {
383384 }
384385 offset + = 4
385386 treeNode(" Rendering more text into the same block" ) {
386- selectable(" main.c" , selected, offset+ 0 ); sameLine(300f ); text(" 2,345 bytes" )
387- selectable(" Hello.cpp" , selected, offset+ 1 ); sameLine(300f ); text(" 12,345 bytes" )
388- selectable(" Hello.h" , selected, offset+ 2 ); sameLine(300f ); text(" 2,345 bytes" )
387+ selectable(" main.c" , selected, offset + 0 ); sameLine(300f ); text(" 2,345 bytes" )
388+ selectable(" Hello.cpp" , selected, offset + 1 ); sameLine(300f ); text(" 12,345 bytes" )
389+ selectable(" Hello.h" , selected, offset + 2 ); sameLine(300f ); text(" 2,345 bytes" )
389390 }
390391 offset + = 3
391392 treeNode(" In columns" ) {
@@ -416,7 +417,7 @@ interface imgui_demoDebugInfo {
416417 }
417418
418419 treeNode(" Filtered Text Input TODO" ) {
419- // static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
420+ // static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
420421// static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal);
421422// static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
422423// static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase);
@@ -430,28 +431,14 @@ interface imgui_demoDebugInfo {
430431// ImGui::SameLine(); ShowHelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
431432// ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank);
432433 }
433- //
434- // if (ImGui::TreeNode("Multi-line Text Input"))
435- // {
436- // static bool read_only = false;
437- // static char text[1024*16] =
438- // "/*\n"
439- // " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
440- // " the hexadecimal encoding of one offending instruction,\n"
441- // " more formally, the invalid operand with locked CMPXCHG8B\n"
442- // " instruction bug, is a design flaw in the majority of\n"
443- // " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
444- // " processors (all in the P5 microarchitecture).\n"
445- // "*/\n\n"
446- // "label:\n"
447- // "\tlock cmpxchg8b eax\n";
448- //
449- // ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
450- // ImGui::Checkbox("Read-only", &read_only);
451- // ImGui::PopStyleVar();
452- // ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput | (read_only ? ImGuiInputTextFlags_ReadOnly : 0));
453- // ImGui::TreePop();
454- // }
434+
435+ treeNode(" Multi-line Text Input TODO" ) {
436+ withStyleVar(StyleVar .FramePadding , Vec2 ()) {
437+ checkbox(" Read-only" , readOnly)
438+ }
439+ val flags = InputTextFlags .AllowTabInput or if (readOnly[0 ]) InputTextFlags .ReadOnly else InputTextFlags .Null
440+ // inputTextMultiline("##source", textMultiline, Vec2(-1f, textLineHeight * 16), flags)
441+ }
455442//
456443// static bool a=false;
457444// if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; }
@@ -2168,7 +2155,21 @@ interface imgui_demoDebugInfo {
21682155
21692156 val selected = BooleanArray (4 + 3 + 16 + 16 , { it == 1 || it == 23 + 0 || it == 23 + 5 || it == 23 + 10 || it == 23 + 15 })
21702157
2171- // { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
2158+ val readOnly = booleanArrayOf(false )
2159+
2160+ val textMultiline = CharArray (1024 * 16 ).also {
2161+ (""" /*
2162+ The Pentium F00F bug, shorthand for F0 0F C7 C8,
2163+ the hexadecimal encoding of one offending instruction,
2164+ more formally, the invalid operand with locked CMPXCHG8B
2165+ instruction bug, is a design flaw in the majority of
2166+ Intel Pentium, Pentium MMX, and Pentium OverDrive
2167+ processors (all in the P5 microarchitecture).
2168+ */
2169+
2170+ label""" .trimMargin() +
2171+ " \t lock cmpxchg8b eax\n " ).toCharArray(it)
2172+ }
21722173 }
21732174
21742175 /* * Demonstrating creating a simple console window, with scrolling, filtering, completion and history.
0 commit comments