Skip to content

Commit

Permalink
InputText: Internals: rename CurLenA->TextLen, InitialTextA->TextToRe…
Browse files Browse the repository at this point in the history
…vertTo.

Follow the refactors in #7925.
  • Loading branch information
ocornut committed Nov 5, 2024
1 parent be2d006 commit 63234f8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
10 changes: 5 additions & 5 deletions imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,11 @@ struct IMGUI_API ImGuiInputTextState
ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
ImStbTexteditState* Stb; // State for stb_textedit.h
ImGuiID ID; // widget id owning the text state
int CurLenA; // UTF-8 length of the string in TextA (in bytes)
int TextLen; // UTF-8 length of the string in TextA (in bytes)
ImVector<char> TextA; // main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1).
ImVector<char> InitialTextA; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
ImVector<char> TextToRevertTo; // value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
ImVector<char> CallbackTextBackup; // temporary storage for callback to support automatic reconcile of undo-stack
int BufCapacityA; // end-user buffer capacity
int BufCapacity; // end-user buffer capacity (include zero terminator)
ImVec2 Scroll; // horizontal offset (managed manually) + vertical scrolling (pulled from child window's own Scroll.y)
float CursorAnim; // timer for cursor blink, reset on every user action so the cursor reappears immediately
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
Expand All @@ -1126,8 +1126,8 @@ struct IMGUI_API ImGuiInputTextState

ImGuiInputTextState();
~ImGuiInputTextState();
void ClearText() { CurLenA = 0; TextA[0] = 0; CursorClamp(); }
void ClearFreeMemory() { TextA.clear(); InitialTextA.clear(); }
void ClearText() { TextLen = 0; TextA[0] = 0; CursorClamp(); }
void ClearFreeMemory() { TextA.clear(); TextToRevertTo.clear(); }
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
void OnCharPressed(unsigned int c);

Expand Down
Loading

0 comments on commit 63234f8

Please sign in to comment.