Go to the documentation of this file.
10 #ifndef QUERYSTRING_GUI_H
11 #define QUERYSTRING_GUI_H
51 void DrawEditBox(
const Window *w,
int wid)
const;
52 void ClickEditBox(
Window *w,
Point pt,
int wid,
int click_count,
bool focus_changed);
53 void HandleEditBox(
Window *w,
int wid);
65 return this->text.
buf;
84 if (this->text.
markend == 0)
return nullptr;
int ok_button
Widget button of parent window to simulate when pressing OK in OSK.
const char * GetText() const
Get the current text.
~QueryString()
Make sure everything gets freed.
uint16 caretpos
the current position of the caret in the buffer, in bytes
uint16 markpos
the start position of the marked area in the buffer, in bytes
const char * GetCharAtPosition(const Window *w, int wid, const Point &pt) const
Get the character that is rendered at a position.
Data stored about a string that can be modified in the GUI.
char *const buf
buffer in which text is saved
Rect GetBoundingRect(const Window *w, int wid, const char *from, const char *to) const
Get the bounding rectangle for a range of the query string.
bool IsOSKOpenedFor(const Window *w, int button)
Check whether the OSK is opened for a specific editbox.
Coordinates of a point in 2D.
const char * GetCaret() const
Get the position of the caret in the text buffer.
uint16 markend
the end position of the marked area in the buffer, in bytes
uint32 StringID
Numeric value that represents a string, independent of the selected language.
int cancel_button
Widget button of parent window to simulate when pressing CANCEL in OSK.
void UpdateOSKOriginalText(const Window *parent, int button)
Updates the original text of the OSK so when the 'parent' changes the original and you press on cance...
const char * GetMarkedText(size_t *length) const
Get the currently marked text.
QueryString(uint16 size, uint16 chars=UINT16_MAX)
Initialize string.
static const int ACTION_CLEAR
Clear editbox.
Point GetCaretPosition(const Window *w, int wid) const
Get the current caret position.
Data structure for an opened window.
static const int ACTION_DESELECT
Deselect editbox.
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
Specification of a rectangle with absolute coordinates of all edges.
void ShowOnScreenKeyboard(Window *parent, int button)
Show the on-screen keyboard (osk) associated with a given textbox.
static const int ACTION_NOTHING
Nothing.
Helper/buffer for input fields.