Internals: InputText: Renaming. Comments.

This commit is contained in:
omar
2018-08-21 21:22:40 +02:00
parent 9f393c38e9
commit 2dc5ec95d7
4 changed files with 47 additions and 42 deletions

View File

@ -432,9 +432,9 @@ struct IMGUI_API ImGuiMenuColumns
struct IMGUI_API ImGuiInputTextState
{
ImGuiID ID; // widget id owning the text state
ImVector<ImWchar> Text; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
ImVector<char> InitialText; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
ImVector<char> TempTextBuffer;
ImVector<char> TempBuffer; // temporary buffer for callback and other other operations. size=capacity.
int CurLenA, CurLenW; // we need to maintain our buffer length in both UTF-8 and wchar format.
int BufCapacityA; // end-user buffer capacity
float ScrollX;
@ -454,7 +454,7 @@ struct IMGUI_API ImGuiInputTextState
bool HasSelection() const { return StbState.select_start != StbState.select_end; }
void ClearSelection() { StbState.select_start = StbState.select_end = StbState.cursor; }
void SelectAll() { StbState.select_start = 0; StbState.cursor = StbState.select_end = CurLenW; StbState.has_preferred_x = false; }
void OnKeyPressed(int key);
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
};
// Windows data saved in imgui.ini file