Public Member Functions | |
| OskWindow (const WindowDesc *desc, Window *parent, int button) | |
| 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 | OnClick (Point pt, int widget, int click_count) |
| A click with the left mouse button has been made on the window. | |
| virtual void | OnEditboxChanged (int widget) |
| The text in an editbox has been edited. | |
| virtual void | OnInvalidateData (int data=0, bool gui_scope=true) |
| Some data on this window has become invalid. | |
| virtual void | OnFocusLost () |
| Called when window looses focus. | |
Data Fields | |
| StringID | caption |
| the caption for this window. | |
| QueryString * | qs |
| text-input | |
| int | text_btn |
| widget number of parent's text field | |
| 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 36 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 100 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 111 of file osk_gui.cpp.
References Textbuf::afilter, Textbuf::Assign(), Textbuf::buf, QueryString::cancel_button, Textbuf::DeleteChar(), HasBit(), Window::InvalidateData(), IsValidChar(), Textbuf::MovePos(), QueryString::ok_button, Window::OnClick(), OnEditboxChanged(), orig_str_buf, Window::parent, qs, Window::SetDirty(), shift, ToggleBit(), UpdateOskState(), 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, WID_OSK_SPECIAL, and WID_OSK_TEXT.
| virtual void OskWindow::OnEditboxChanged | ( | int | widget | ) | [inline, virtual] |
The text in an editbox has been edited.
| widget | The widget of the editbox. |
Reimplemented from Window.
Definition at line 193 of file osk_gui.cpp.
References Window::OnEditboxChanged(), Window::parent, Window::SetWidgetDirty(), text_btn, and WID_OSK_TEXT.
Referenced by OnClick().
| 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 200 of file osk_gui.cpp.
References Window::parent, Window::SetWidgetDirty(), text_btn, 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 95 of file osk_gui.cpp.
References caption, SetDParam(), and WID_OSK_CAPTION.
1.7.1