src/querystring_gui.h
changeset 9179 780666b686ed
child 9203 082fbf0500c4
equal deleted inserted replaced
9178:3235f895bf12 9179:780666b686ed
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file querystring_gui.h Base for the GUIs that have an edit box in them. */
       
     4 
       
     5 #ifndef QUERYSTRING_GUI_H
       
     6 #define QUERYSTRING_GUI_H
       
     7 
       
     8 #include "textbuf_gui.h"
       
     9 #include "window_gui.h"
       
    10 
       
    11 struct QueryString {
       
    12 	StringID caption;
       
    13 	Textbuf text;
       
    14 	const char *orig;
       
    15 	CharSetFilter afilter;
       
    16 	bool handled;
       
    17 
       
    18 	void DrawEditBox(Window *w, int wid);
       
    19 	void HandleEditBox(Window *w, int wid);
       
    20 	int HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, bool &cont);
       
    21 };
       
    22 
       
    23 struct QueryStringBaseWindow : public Window, public QueryString {
       
    24 	char edit_str_buf[64];
       
    25 	char orig_str_buf[64];
       
    26 
       
    27 	QueryStringBaseWindow(const WindowDesc *desc, void *data = NULL, WindowNumber window_number = 0) : Window(desc, data, window_number)
       
    28 	{
       
    29 	}
       
    30 
       
    31 	void DrawEditBox(int wid);
       
    32 	void HandleEditBox(int wid);
       
    33 	int HandleEditBoxKey(int wid, uint16 key, uint16 keycode, bool &cont);
       
    34 };
       
    35 
       
    36 void ShowOnScreenKeyboard(QueryStringBaseWindow *parent, int button, int cancel, int ok);
       
    37 
       
    38 #endif /* QUERYSTRING_GUI_H */