MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / DebugNodeInputTextState

Method DebugNodeInputTextState

include/imgui/imgui_widgets.cpp:5704–5741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5702}
5703
5704void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state)
5705{
5706#ifndef IMGUI_DISABLE_DEBUG_TOOLS
5707 ImGuiContext& g = *GImGui;
5708 ImStb::STB_TexteditState* stb_state = state->Stb;
5709 ImStb::StbUndoState* undo_state = &stb_state->undostate;
5710 Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId);
5711 DebugLocateItemOnHover(state->ID);
5712 Text("TextLen: %d, Cursor: %d%s, Selection: %d..%d", state->TextLen, stb_state->cursor,
5713 (state->Flags & ImGuiInputTextFlags_WordWrap) ? (state->LastMoveDirectionLR == ImGuiDir_Left ? " (L)" : " (R)") : "",
5714 stb_state->select_start, stb_state->select_end);
5715 Text("BufCapacity: %d, LineCount: %d", state->BufCapacity, state->LineCount);
5716 Text("(Internal Buffer: TextA Size: %d, Capacity: %d)", state->TextA.Size, state->TextA.Capacity);
5717 Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x);
5718 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);
5719 if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 10), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY)) // Visualize undo state
5720 {
5721 PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
5722 for (int n = 0; n < IMSTB_TEXTEDIT_UNDOSTATECOUNT; n++)
5723 {
5724 ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n];
5725 const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' ';
5726 if (undo_rec_type == ' ')
5727 BeginDisabled();
5728 const int buf_preview_len = (undo_rec_type != ' ' && undo_rec->char_storage != -1) ? undo_rec->insert_length : 0;
5729 const char* buf_preview_str = undo_state->undo_char + undo_rec->char_storage;
5730 Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%.*s\"",
5731 undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf_preview_len, buf_preview_str);
5732 if (undo_rec_type == ' ')
5733 EndDisabled();
5734 }
5735 PopStyleVar();
5736 }
5737 EndChild();
5738#else
5739 IM_UNUSED(state);
5740#endif
5741}
5742
5743//-------------------------------------------------------------------------
5744// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc.

Callers

nothing calls this directly

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected