mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Internal: InputText: Minor changes (intended to have side-effect but clarify next commit, however there is rarely such a thing as zero side effect in InputText land!)
This commit is contained in:
@ -104,6 +104,8 @@ namespace ImStb
|
||||
#define STB_TEXTEDIT_STRING ImGuiInputTextState
|
||||
#define STB_TEXTEDIT_CHARTYPE ImWchar
|
||||
#define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f
|
||||
#define STB_TEXTEDIT_UNDOSTATECOUNT 99
|
||||
#define STB_TEXTEDIT_UNDOCHARCOUNT 999
|
||||
#include "imstb_textedit.h"
|
||||
|
||||
} // namespace ImStb
|
||||
@ -593,6 +595,8 @@ struct IMGUI_API ImGuiInputTextState
|
||||
bool HasSelection() const { return Stb.select_start != Stb.select_end; }
|
||||
void ClearSelection() { Stb.select_start = Stb.select_end = Stb.cursor; }
|
||||
void SelectAll() { Stb.select_start = 0; Stb.cursor = Stb.select_end = CurLenW; Stb.has_preferred_x = 0; }
|
||||
int GetUndoAvailCount() const { return Stb.undostate.undo_point; }
|
||||
int GetRedoAvailCount() const { return STB_TEXTEDIT_UNDOSTATECOUNT - Stb.undostate.redo_point; }
|
||||
void OnKeyPressed(int key); // Cannot be inline because we call in code in stb_textedit.h implementation
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user