Class for the string query window. More...
Public Member Functions | |
QueryStringWindow (StringID str, StringID caption, uint max_bytes, uint max_chars, const WindowDesc *desc, Window *parent, CharSetFilter afilter, QueryStringFlags flags) | |
virtual void | UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) |
Update size and resize step of a widget in the window. | |
virtual void | OnPaint () |
The window must be repainted. | |
virtual void | SetStringParameters (int widget) const |
Initialize string parameters for a widget. | |
void | OnOk () |
virtual void | OnClick (Point pt, int widget, int click_count) |
A click with the left mouse button has been made on the window. | |
virtual void | OnMouseLoop () |
Called for every mouse loop run, which is at least once per (game) tick. | |
virtual EventState | OnKeyPress (uint16 key, uint16 keycode) |
A key has been pressed. | |
virtual void | OnOpenOSKWindow (int wid) |
Callback for when the OSK window is opened. | |
Data Fields | |
QueryStringFlags | flags |
Flags controlling behaviour of the window. |
Class for the string query window.
Definition at line 1361 of file misc_gui.cpp.
virtual void QueryStringWindow::OnClick | ( | Point | pt, | |
int | widget, | |||
int | click_count | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
pt | the point inside the window that has been clicked. | |
widget | the clicked widget. | |
click_count | Number of fast consecutive clicks at same position |
Reimplemented from Window.
Definition at line 1428 of file misc_gui.cpp.
References Textbuf::buf.
virtual EventState QueryStringWindow::OnKeyPress | ( | uint16 | key, | |
uint16 | keycode | |||
) | [inline, virtual] |
A key has been pressed.
key | the Unicode value of the key. | |
keycode | the untranslated key code including shift state. |
Reimplemented from Window.
Definition at line 1448 of file misc_gui.cpp.
References ES_NOT_HANDLED, FindWindowById(), Window::InvalidateData(), and Window::parent.
virtual void QueryStringWindow::OnOpenOSKWindow | ( | int | wid | ) | [inline, virtual] |
Callback for when the OSK window is opened.
wid | The widget the OSK is opened of. |
Reimplemented from QueryStringBaseWindow.
Definition at line 1466 of file misc_gui.cpp.
References ShowOnScreenKeyboard().
virtual void QueryStringWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 1402 of file misc_gui.cpp.
References Window::DrawWidgets().
virtual void QueryStringWindow::SetStringParameters | ( | int | widget | ) | const [inline, virtual] |
Initialize string parameters for a widget.
Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.
widget | Widget number. |
Reimplemented from Window.
Definition at line 1409 of file misc_gui.cpp.
References SetDParam().
virtual void QueryStringWindow::UpdateWidgetSize | ( | int | widget, | |
Dimension * | size, | |||
const Dimension & | padding, | |||
Dimension * | fill, | |||
Dimension * | resize | |||
) | [inline, virtual] |
Update size and resize step of a widget in the window.
After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.
widget | Widget number. | |
size | Size of the widget. | |
padding | Recommended amount of space between the widget content and the widget edge. | |
fill | Fill step of the widget. | |
resize | Resize step of the widget. |
Reimplemented from Window.
Definition at line 1392 of file misc_gui.cpp.
References flags, and QSF_ENABLE_DEFAULT.