mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Added ImGuiInputTextFlags_ReadOnly flag for InputText()/InputTextMultiline() (#211)
This commit is contained in:
parent
f5fb5f0c1e
commit
b4f1e88860
3 changed files with 38 additions and 22 deletions
|
|
@ -422,8 +422,12 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||
|
||||
if (ImGui::TreeNode("Multi-line Text Input"))
|
||||
{
|
||||
static bool read_only = false;
|
||||
static char text[1024*16] = "// F00F bug\nlabel:\n\tlock cmpxchg8b eax\n";
|
||||
ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
|
||||
ImGui::Checkbox("Read-only", &read_only);
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput | (read_only ? ImGuiInputTextFlags_ReadOnly : 0));
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue