summaryrefslogtreecommitdiff
path: root/src/querystring_gui.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:39 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:39 +0000
commitc283a412485700ab8e81a374f080c1ef94fbf64d (patch)
tree4673dc71eac8f915dcbc6b846213157096260357 /src/querystring_gui.h
parentf5d8ba5d7f90abc72db6c0470da383ecf82da487 (diff)
downloadopenttd-c283a412485700ab8e81a374f080c1ef94fbf64d.tar.xz
(svn r24743) -Change: Unify the behaviour of ESC in filter editboxes.
Diffstat (limited to 'src/querystring_gui.h')
-rw-r--r--src/querystring_gui.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/querystring_gui.h b/src/querystring_gui.h
index 5c46ced84..a84e16746 100644
--- a/src/querystring_gui.h
+++ b/src/querystring_gui.h
@@ -31,6 +31,11 @@ enum HandleEditBoxResult
* Data stored about a string that can be modified in the GUI
*/
struct QueryString {
+ /* Special actions when hitting ENTER or ESC. (only keyboard, not OSK) */
+ static const int ACTION_NOTHING = -1; ///< Nothing.
+ static const int ACTION_DESELECT = -2; ///< Deselect editbox.
+ static const int ACTION_CLEAR = -3; ///< Clear editbox.
+
StringID caption;
int ok_button; ///< Widget button of parent window to simulate when pressing OK in OSK.
int cancel_button; ///< Widget button of parent window to simulate when pressing CANCEL in OSK.
@@ -44,7 +49,7 @@ struct QueryString {
* @param size Maximum size in bytes.
* @param chars Maximum size in chars.
*/
- QueryString(uint16 size, uint16 chars = UINT16_MAX) : ok_button(-1), cancel_button(-1), text(size, chars), orig(NULL)
+ QueryString(uint16 size, uint16 chars = UINT16_MAX) : ok_button(ACTION_NOTHING), cancel_button(ACTION_DESELECT), text(size, chars), orig(NULL)
{
}