MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / TempInputText

Method TempInputText

KBotExt/imgui/imgui_widgets.cpp:3367–3385  ·  view source on GitHub ↗

Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets) FIXME: Facilitate using this in variety of other situations.

Source from the content-addressed store, hash-verified

3365// Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets)
3366// FIXME: Facilitate using this in variety of other situations.
3367bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags)
3368{
3369 // On the first frame, g.TempInputTextId == 0, then on subsequent frames it becomes == id.
3370 // We clear ActiveID on the first frame to allow the InputText() taking it back.
3371 ImGuiContext& g = *GImGui;
3372 const bool init = (g.TempInputId != id);
3373 if (init)
3374 ClearActiveID();
3375
3376 g.CurrentWindow->DC.CursorPos = bb.Min;
3377 bool value_changed = InputTextEx(label, NULL, buf, buf_size, bb.GetSize(), flags | ImGuiInputTextFlags_MergedItem);
3378 if (init)
3379 {
3380 // First frame we started displaying the InputText widget, we expect it to take the active id.
3381 IM_ASSERT(g.ActiveId == id);
3382 g.TempInputId = g.ActiveId;
3383 }
3384 return value_changed;
3385}
3386
3387static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(ImGuiDataType data_type, const char* format)
3388{

Callers

nothing calls this directly

Calls 1

GetSizeMethod · 0.80

Tested by

no test coverage detected