11#include "imgui_stdlib.h"
15#pragma clang diagnostic push
16#pragma clang diagnostic ignored "-Wsign-conversion"
26static int InputTextCallback(ImGuiInputTextCallbackData* data)
29 if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
33 std::string* str = user_data->
Str;
34 IM_ASSERT(data->Buf == str->c_str());
35 str->resize(data->BufTextLen);
36 data->Buf = (
char*)str->c_str();
47bool ImGui::InputText(
const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback,
void* user_data)
49 IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
50 flags |= ImGuiInputTextFlags_CallbackResize;
53 cb_user_data.
Str = str;
56 return InputText(label, (
char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
59bool ImGui::InputTextMultiline(
const char* label, std::string* str,
const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback,
void* user_data)
61 IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
62 flags |= ImGuiInputTextFlags_CallbackResize;
65 cb_user_data.
Str = str;
68 return InputTextMultiline(label, (
char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data);
71bool ImGui::InputTextWithHint(
const char* label,
const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback,
void* user_data)
73 IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
74 flags |= ImGuiInputTextFlags_CallbackResize;
77 cb_user_data.
Str = str;
80 return InputTextWithHint(label, hint, (
char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
84#pragma clang diagnostic pop
bool InputText(Setting &setting)
void * ChainCallbackUserData
ImGuiInputTextCallback ChainCallback