| 5001 | } |
| 5002 | |
| 5003 | void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state) |
| 5004 | { |
| 5005 | #ifndef IMGUI_DISABLE_DEBUG_TOOLS |
| 5006 | ImGuiContext& g = *GImGui; |
| 5007 | ImStb::STB_TexteditState* stb_state = &state->Stb; |
| 5008 | ImStb::StbUndoState* undo_state = &stb_state->undostate; |
| 5009 | Text("ID: 0x%08X, ActiveID: 0x%08X", state->ID, g.ActiveId); |
| 5010 | DebugLocateItemOnHover(state->ID); |
| 5011 | Text("CurLenW: %d, CurLenA: %d, Cursor: %d, Selection: %d..%d", state->CurLenW, state->CurLenA, stb_state->cursor, stb_state->select_start, stb_state->select_end); |
| 5012 | Text("has_preferred_x: %d (%.2f)", stb_state->has_preferred_x, stb_state->preferred_x); |
| 5013 | 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); |
| 5014 | if (BeginChild("undopoints", ImVec2(0.0f, GetTextLineHeight() * 15), true)) // Visualize undo state |
| 5015 | { |
| 5016 | PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); |
| 5017 | for (int n = 0; n < STB_TEXTEDIT_UNDOSTATECOUNT; n++) |
| 5018 | { |
| 5019 | ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n]; |
| 5020 | const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' '; |
| 5021 | if (undo_rec_type == ' ') |
| 5022 | BeginDisabled(); |
| 5023 | char buf[64] = ""; |
| 5024 | if (undo_rec_type != ' ' && undo_rec->char_storage != -1) |
| 5025 | 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); |
| 5026 | Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%s\"", |
| 5027 | undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf); |
| 5028 | if (undo_rec_type == ' ') |
| 5029 | EndDisabled(); |
| 5030 | } |
| 5031 | PopStyleVar(); |
| 5032 | } |
| 5033 | EndChild(); |
| 5034 | #else |
| 5035 | IM_UNUSED(state); |
| 5036 | #endif |
| 5037 | } |
| 5038 | |
| 5039 | //------------------------------------------------------------------------- |
| 5040 | // [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc. |
nothing calls this directly
no test coverage detected