Files
@ r10812:7d7098769c9e
Branch filter:
Location: cpp/openttd-patchpack/source/src/querystring_gui.h - annotation
r10812:7d7098769c9e
1.7 KiB
text/x-c
(svn r15147) -Fix (r15146): compile before commit
r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9897:9cbe1cc406a0 r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r10295:c0e73453a31c r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9179:660680ae613d r9179:660680ae613d r10295:c0e73453a31c r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r10276:22abdd1aa57a r9179:660680ae613d r9916:dfe4035b061f r9179:660680ae613d r10276:22abdd1aa57a r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9897:9cbe1cc406a0 r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r10563:12d6e31fa9ad r10547:46e9c74ed423 r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d r9179:660680ae613d | /* $Id$ */
/** @file querystring_gui.h Base for the GUIs that have an edit box in them. */
#ifndef QUERYSTRING_GUI_H
#define QUERYSTRING_GUI_H
#include "textbuf_gui.h"
#include "window_gui.h"
/**
* Return values for HandleEditBoxKey
*/
enum HandleEditBoxResult
{
HEBR_EDITING = 0, // Other key pressed.
HEBR_CONFIRM, // Return or enter key pressed.
HEBR_CANCEL, // Escape key pressed.
};
/**
* Data stored about a string that can be modified in the GUI
*/
struct QueryString {
StringID caption;
Textbuf text;
const char *orig;
CharSetFilter afilter;
bool handled;
/**
* Make sure everything gets initialized properly.
*/
QueryString() : orig(NULL)
{
}
/**
* Make sure everything gets freed.
*/
~QueryString()
{
free((void*)this->orig);
}
void DrawEditBox(Window *w, int wid);
void HandleEditBox(Window *w, int wid);
HandleEditBoxResult HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state);
};
struct QueryStringBaseWindow : public Window, public QueryString {
char *edit_str_buf;
char *orig_str_buf;
const uint16 edit_str_size; ///< maximum length of string (in bytes), including terminating '\0'
QueryStringBaseWindow(uint16 size, const WindowDesc *desc, WindowNumber window_number = 0) : Window(desc, window_number), edit_str_size(size)
{
assert(size != 0);
this->edit_str_buf = CallocT<char>(size);
}
~QueryStringBaseWindow()
{
free(this->edit_str_buf);
}
void DrawEditBox(int wid);
void HandleEditBox(int wid);
HandleEditBoxResult HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state);
virtual void OnOpenOSKWindow(int wid);
};
void ShowOnScreenKeyboard(QueryStringBaseWindow *parent, int button, int cancel, int ok);
#endif /* QUERYSTRING_GUI_H */
|