OpenTTD Source  20241108-master-g80f628063a
querystring_gui.h File Reference

Base for the GUIs that have an edit box in them. More...

#include "textbuf_type.h"
#include "textbuf_gui.h"
#include "window_gui.h"

Go to the source code of this file.

Data Structures

struct  QueryString
 Data stored about a string that can be modified in the GUI. More...
 

Functions

void ShowOnScreenKeyboard (Window *parent, WidgetID button)
 Show the on-screen keyboard (osk) associated with a given textbox. More...
 
void UpdateOSKOriginalText (const Window *parent, WidgetID button)
 Updates the original text of the OSK so when the 'parent' changes the original and you press on cancel you won't get the 'old' original text but the updated one. More...
 
bool IsOSKOpenedFor (const Window *w, WidgetID button)
 Check whether the OSK is opened for a specific editbox. More...
 

Detailed Description

Base for the GUIs that have an edit box in them.

Definition in file querystring_gui.h.

Function Documentation

◆ IsOSKOpenedFor()

bool IsOSKOpenedFor ( const Window w,
WidgetID  button 
)

Check whether the OSK is opened for a specific editbox.

Parameters
wWindow to check for
buttonEditbox of w to check for
Returns
true if the OSK is opened for button.

Definition at line 426 of file osk_gui.cpp.

References FindWindowById(), Window::parent, OskWindow::text_btn, and WC_OSK.

◆ ShowOnScreenKeyboard()

void ShowOnScreenKeyboard ( Window parent,
WidgetID  button 
)

Show the on-screen keyboard (osk) associated with a given textbox.

Parameters
parentpointer to the Window where this keyboard originated from
buttonwidget number of parent's textbox

Definition at line 395 of file osk_gui.cpp.

References CloseWindowById(), GetKeyboardLayout(), and WC_OSK.

◆ UpdateOSKOriginalText()

void UpdateOSKOriginalText ( const Window parent,
WidgetID  button 
)

Updates the original text of the OSK so when the 'parent' changes the original and you press on cancel you won't get the 'old' original text but the updated one.

Parameters
parentwindow that just updated its original text
buttonwidget number of parent's textbox to update

Definition at line 410 of file osk_gui.cpp.

References Textbuf::buf, FindWindowById(), OskWindow::orig_str, Window::parent, OskWindow::qs, Window::SetDirty(), OskWindow::text_btn, and WC_OSK.