Public Member Functions | |
| OskWindow (const WindowDesc *desc, QueryStringBaseWindow *parent, int button, int cancel, int ok) | |
| void | UpdateOskState () |
| Only show valid characters; do not show characters that would only insert a space when we have a spacebar to do that or characters that are not allowed to be entered. | |
| virtual void | SetStringParameters (int widget) const |
| Initialize string parameters for a widget. | |
| virtual void | DrawWidget (const Rect &r, int widget) const |
| Draw the contents of a nested widget. | |
| virtual void | OnPaint () |
| The window must be repainted. | |
| virtual void | OnClick (Point pt, int widget, int click_count) |
| A click with the left mouse button has been made on the window. | |
| void | InvalidateParent () |
| virtual void | OnMouseLoop () |
| Called for every mouse loop run, which is at least once per (game) tick. | |
| virtual void | OnInvalidateData (int data=0, bool gui_scope=true) |
| Some data on this window has become invalid. | |
Data Fields | |
| StringID | caption |
| the caption for this window. | |
| QueryString * | qs |
| text-input | |
| int | text_btn |
| widget number of parent's text field | |
| int | ok_btn |
| widget number of parent's ok button (=0 when ok shouldn't be passed on) | |
| int | cancel_btn |
| widget number of parent's cancel button (=0 when cancel shouldn't be passed on; text will be reverted to original) | |
| Textbuf * | text |
| pointer to parent's textbuffer (to update caret position) | |
| char * | orig_str_buf |
| Original string. | |
| bool | shift |
| Is the shift effectively pressed? | |
Definition at line 35 of file osk_gui.cpp.
| virtual void OskWindow::DrawWidget | ( | const Rect & | r, | |
| int | widget | |||
| ) | const [inline, virtual] |
Draw the contents of a nested widget.
| r | Rectangle occupied by the widget. | |
| widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 101 of file osk_gui.cpp.
References DrawCharCentered(), shift, and WID_OSK_LETTERS.
| virtual void OskWindow::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 119 of file osk_gui.cpp.
References Textbuf::buf, cancel_btn, DeleteTextBufferChar(), HasBit(), InsertTextBufferChar(), IsValidChar(), MoveTextBufferPos(), ok_btn, Window::OnClick(), Window::parent, qs, Window::SetDirty(), Window::SetFocusedWidget(), SetFocusedWindow(), shift, text_btn, ToggleBit(), UpdateOskState(), UpdateTextBufferSize(), WID_OSK_BACKSPACE, WID_OSK_CANCEL, WID_OSK_CAPS, WID_OSK_LEFT, WID_OSK_LETTERS, WID_OSK_OK, WID_OSK_RIGHT, WID_OSK_SHIFT, WID_OSK_SPACE, and WID_OSK_SPECIAL.
| virtual void OskWindow::OnInvalidateData | ( | int | data = 0, |
|
| bool | gui_scope = true | |||
| ) | [inline, virtual] |
Some data on this window has become invalid.
| data | Information about the changed data. | |
| gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details. |
Reimplemented from Window.
Definition at line 229 of file osk_gui.cpp.
References Window::SetWidgetDirty(), and WID_OSK_TEXT.
| virtual void OskWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 112 of file osk_gui.cpp.
References Window::DrawWidgets(), qs, and WID_OSK_TEXT.
| virtual void OskWindow::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 96 of file osk_gui.cpp.
References caption, SetDParam(), and WID_OSK_CAPTION.
1.7.1