(svn r24743) -Change: Unify the behaviour of ESC in filter editboxes.

This commit is contained in:
frosch
2012-11-14 22:50:39 +00:00
parent f5d8ba5d7f
commit c283a41248
6 changed files with 30 additions and 3 deletions

View File

@@ -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)
{
}