| 777 | } |
| 778 | |
| 779 | bool GuiImpl::addTextbox(const char label[], char buf[], size_t bufSize, uint32_t lineCount, Gui::TextFlags flags) |
| 780 | { |
| 781 | bool fitWindow = is_set(flags, Gui::TextFlags::FitWindow); |
| 782 | if (fitWindow) |
| 783 | ImGui::PushItemWidth(ImGui::GetWindowWidth()); |
| 784 | |
| 785 | if (lineCount > 1) |
| 786 | { |
| 787 | const ImGuiInputTextFlags inputTextFlags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CtrlEnterForNewLine; |
| 788 | return ImGui::InputTextMultiline(label, buf, bufSize, ImVec2(-1.0f, ImGui::GetTextLineHeight() * lineCount), inputTextFlags); |
| 789 | } |
| 790 | else |
| 791 | { |
| 792 | return ImGui::InputText(label, buf, bufSize, ImGuiInputTextFlags_EnterReturnsTrue); |
| 793 | } |
| 794 | |
| 795 | if (fitWindow) |
| 796 | ImGui::PopItemWidth(); |
| 797 | } |
| 798 | |
| 799 | bool GuiImpl::addTextbox(const char label[], std::string& text, uint32_t lineCount, Gui::TextFlags flags) |
| 800 | { |
no test coverage detected