mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-12 07:49:55 +02:00
TypingSelect: fast switch between characters in + debug, internal renames.
# Conflicts: # imgui.cpp # imgui_internal.h
This commit is contained in:
@ -154,7 +154,7 @@ struct ImGuiTableInstanceData; // Storage for one instance of a same table
|
||||
struct ImGuiTableTempData; // Temporary storage for one table (one per table in the stack), shared between tables.
|
||||
struct ImGuiTableSettings; // Storage for a table .ini settings
|
||||
struct ImGuiTableColumnsSettings; // Storage for a column .ini settings
|
||||
struct ImGuiTypingSelectData; // Storage for GetTypingSelectRequest()
|
||||
struct ImGuiTypingSelectState; // Storage for GetTypingSelectRequest()
|
||||
struct ImGuiTypingSelectRequest; // Storage for GetTypingSelectRequest() (aimed to be public)
|
||||
struct ImGuiWindow; // Storage for one window
|
||||
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
|
||||
@ -1574,20 +1574,22 @@ struct IMGUI_API ImGuiTypingSelectRequest
|
||||
int SearchBufferLen;
|
||||
const char* SearchBuffer;
|
||||
bool SelectRequest; // Set when buffer was modified this frame, requesting a selection.
|
||||
bool SingleCharMode; // Notify when buffer contains same character repeated, to implement special mode.
|
||||
bool SingleCharMode; // Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication.
|
||||
ImS8 SingleCharSize; // Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input.
|
||||
};
|
||||
|
||||
// Storage for GetTypingSelectRequest()
|
||||
struct IMGUI_API ImGuiTypingSelectData
|
||||
struct IMGUI_API ImGuiTypingSelectState
|
||||
{
|
||||
ImGuiTypingSelectRequest Request; // User-facing data
|
||||
char SearchBuffer[64]; // Search buffer: no need to make dynamic as this search is very transient.
|
||||
ImGuiID FocusScope;
|
||||
int LastRequestFrame = 0;
|
||||
float LastRequestTime = 0.0f;
|
||||
bool SingleCharModeLock = false; // After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing.
|
||||
|
||||
ImGuiTypingSelectData() { memset(this, 0, sizeof(*this)); }
|
||||
ImGuiTypingSelectState() { memset(this, 0, sizeof(*this)); }
|
||||
void Clear() { SearchBuffer[0] = 0; SingleCharModeLock = false; } // We preserve remaining data for easier debugging
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -2082,7 +2084,7 @@ struct ImGuiContext
|
||||
short TooltipOverrideCount;
|
||||
ImVector<char> ClipboardHandlerData; // If no custom clipboard handler is defined
|
||||
ImVector<ImGuiID> MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once
|
||||
ImGuiTypingSelectData TypingSelectData;
|
||||
ImGuiTypingSelectState TypingSelectState; // State for GetTypingSelectRequest()
|
||||
|
||||
// Platform support
|
||||
ImGuiPlatformImeData PlatformImeData; // Data updated by current frame
|
||||
@ -3124,7 +3126,7 @@ namespace ImGui
|
||||
|
||||
// Typing-Select API
|
||||
IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);
|
||||
IMGUI_API int TypingSelectFindResult(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
||||
IMGUI_API int TypingSelectFindTargetIndex(ImGuiTypingSelectRequest* req, int items_count, const char* (*get_item_name_func)(void*, int), void* user_data, int nav_item_idx);
|
||||
|
||||
// Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API)
|
||||
IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
|
||||
@ -3337,6 +3339,7 @@ namespace ImGui
|
||||
IMGUI_API void DebugNodeTable(ImGuiTable* table);
|
||||
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings);
|
||||
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);
|
||||
IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);
|
||||
IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);
|
||||
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);
|
||||
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);
|
||||
|
Reference in New Issue
Block a user