Public Member Functions | Data Fields

# OskWindow Struct Reference

Inheritance diagram for OskWindow:

## 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?

## Detailed Description

Definition at line 35 of file osk_gui.cpp.

## Member Function Documentation

virtual void OskWindow::DrawWidget | ( | const Rect & | r,
|  | int | widget |
| ) |  |  | const`[inline, virtual]`

Draw the contents of a nested widget.

Parameters:

  | r | Rectangle occupied by the widget.
  | widget | Number of the widget to draw.

Note:
  This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 99 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.

Parameters:

  | 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 110 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.

Parameters:

  | widget | The widget of the editbox.

Reimplemented from Window.

Definition at line 192 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.

Parameters:

  | 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 199 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.

Parameters:

  | widget | Widget number.

Reimplemented from Window.

Definition at line 94 of file osk_gui.cpp.

References caption, SetDParam(), and WID_OSK_CAPTION.

The documentation for this struct was generated from the following file:

- src/osk_gui.cpp