10#ifndef QUERYSTRING_GUI_H
11#define QUERYSTRING_GUI_H
29 std::optional<std::string> orig{};
37 QueryString(uint16_t size, uint16_t chars = UINT16_MAX) : text(size, chars)
#define Rect
Macro that prevents name conflicts between included headers.
#define Point
Macro that prevents name conflicts between included headers.
void ShowOnScreenKeyboard(Window *parent, WidgetID button)
Show the on-screen keyboard (osk) associated with a given textbox.
bool IsOSKOpenedFor(const Window *w, WidgetID button)
Check whether the OSK is opened for a specific editbox.
void UpdateOSKOriginalText(const Window *parent, WidgetID button)
Updates the original text of the OSK so when the 'parent' changes the original and you press on cance...
StrongType::Typedef< uint32_t, struct StringIDTag, StrongType::Compare, StrongType::Integer > StringID
Numeric value that represents a string, independent of the selected language.
QueryString(uint16_t size, uint16_t chars=UINT16_MAX)
Initialize string.
int ok_button
Widget button of parent window to simulate when pressing OK in OSK.
static const int ACTION_DESELECT
Deselect editbox.
int cancel_button
Widget button of parent window to simulate when pressing CANCEL in OSK.
ptrdiff_t GetCharAtPosition(const Window *w, WidgetID wid, const Point &pt) const
Get the character that is rendered at a position.
static const int ACTION_NOTHING
Nothing.
static const int ACTION_CLEAR
Clear editbox.
Point GetCaretPosition(const Window *w, WidgetID wid) const
Get the current caret position.
Rect GetBoundingRect(const Window *w, WidgetID wid, size_t from, size_t to) const
Get the bounding rectangle for a range of the query string.
Helper/buffer for input fields.
Data structure for an opened window.
Stuff related to text buffers.
Functions, definitions and such used only by the GUI.