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 | 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 | |
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 97 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 115 of file osk_gui.cpp.
References Textbuf::Assign(), Textbuf::buf, QueryString::cancel_button, Textbuf::DeleteChar(), HasBit(), IsValidChar(), Textbuf::MovePos(), QueryString::ok_button, Window::OnClick(), orig_str_buf, Window::parent, qs, Window::SetDirty(), Window::SetFocusedWidget(), SetFocusedWindow(), shift, text_btn, 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, 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 223 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 108 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 92 of file osk_gui.cpp.
References caption, SetDParam(), and WID_OSK_CAPTION.