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