MCPcopy Create free account
hub / github.com/RenderKit/embree / DebugNodeInputTextState

Method DebugNodeInputTextState

tutorials/common/imgui/imgui_widgets.cpp:4851–4884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4849}
4850
4851void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state)
4852{
4853#ifndef IMGUI_DISABLE_DEBUG_TOOLS
4854 ImGuiContext& g = *GImGui;
4855 ImStb::STB_TexteditState* stb_state = &state->Stb;
4856 ImStb::StbUndoState* undo_state = &stb_state->undostate;
4857 Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId);
4858 DebugLocateItemOnHover(state->ID);
4859 Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenA, state->CurLenW, stb_state->cursor, stb_state->select_start, stb_state->select_end);
4860 Text("undo_point: %d, redo_point: %d, undo_char_point: %d, redo_char_point: %d", undo_state->undo_point, undo_state->redo_point, undo_state->undo_char_point, undo_state->redo_char_point);
4861 if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state
4862 {
4863 PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
4864 for (int n = 0; n < STB_TEXTEDIT_UNDOSTATECOUNT; n++)
4865 {
4866 ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n];
4867 const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' ';
4868 if (undo_rec_type == ' ')
4869 BeginDisabled();
4870 char buf[64] = "";
4871 if (undo_rec_type != ' ' && undo_rec->char_storage != -1)
4872 ImTextStrToUtf8(buf, IM_ARRAYSIZE(buf), undo_state->undo_char + undo_rec->char_storage, undo_state->undo_char + undo_rec->char_storage + undo_rec->insert_length);
4873 Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%s\"",
4874 undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf);
4875 if (undo_rec_type == ' ')
4876 EndDisabled();
4877 }
4878 PopStyleVar();
4879 }
4880 EndChild();
4881#else
4882 IM_UNUSED(state);
4883#endif
4884}
4885
4886//-------------------------------------------------------------------------
4887// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc.

Callers

nothing calls this directly

Calls 2

ImVec2Function · 0.85
ImTextStrToUtf8Function · 0.85

Tested by

no test coverage detected