diff options
Diffstat (limited to 'contrib/dialog/dlg_keys.h')
-rw-r--r-- | contrib/dialog/dlg_keys.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/contrib/dialog/dlg_keys.h b/contrib/dialog/dlg_keys.h index 34b4cba..3469e40 100644 --- a/contrib/dialog/dlg_keys.h +++ b/contrib/dialog/dlg_keys.h @@ -1,9 +1,9 @@ /* - * $Id: dlg_keys.h,v 1.26 2011/06/21 22:09:22 tom Exp $ + * $Id: dlg_keys.h,v 1.31 2012/07/02 23:57:52 tom Exp $ * * dlg_keys.h -- runtime binding support for dialog * - * Copyright 2005-2010,2011 Thomas E. Dickey + * Copyright 2005-2011,2012 Thomas E. Dickey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License, version 2.1 @@ -23,6 +23,7 @@ #ifndef DLG_KEYS_H_included #define DLG_KEYS_H_included 1 +/* *INDENT-OFF* */ #include <dialog.h> @@ -31,7 +32,7 @@ #define dlg_toupper(ch) towupper((wint_t)ch) #define dlg_isupper(ch) iswupper((wint_t)ch) #else -#define dlg_toupper(ch) toupper(ch) +#define dlg_toupper(ch) (((ch) > 0 && (ch) <= 255) ? toupper(ch) : (ch)) #define dlg_isupper(ch) (isalpha(ch) && isupper(ch)) #endif @@ -45,7 +46,7 @@ typedef struct { int dialog_key; } DLG_KEYS_BINDING; -#define DLG_KEYS_DATA(dialog, curses) { curses >= KEY_MIN, curses, dialog } +#define DLG_KEYS_DATA(dialog, curses) { (curses) >= KEY_MIN, curses, dialog } #define END_KEYS_BINDING { -1, 0, 0 } @@ -75,6 +76,11 @@ typedef enum { DLGK_FIELD_LAST, DLGK_FIELD_NEXT, DLGK_FIELD_PREV, + /* moving from form-field to form-field (or buttons) */ + DLGK_FORM_FIRST, + DLGK_FORM_LAST, + DLGK_FORM_NEXT, + DLGK_FORM_PREV, /* moving within a grid */ DLGK_GRID_UP, DLGK_GRID_DOWN, @@ -136,6 +142,15 @@ typedef enum { DLG_KEYS_DATA( DLGK_PAGE_PREV, 'b' ), \ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ) +#define TRAVERSE_BINDINGS \ + DLG_KEYS_DATA( DLGK_ENTER, ' ' ), \ + DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ), \ + DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), \ + DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \ + DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ), \ + DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \ + DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ) + extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/); extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/); extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/); @@ -145,10 +160,12 @@ extern void dlg_unregister_window(WINDOW * /*win*/); #ifdef HAVE_RC_FILE extern int dlg_parse_bindkey(char * /*params*/); extern void dlg_dump_keys(FILE * /*fp*/); +extern void dlg_dump_window_keys(FILE * /*fp*/, WINDOW * /*win*/); #endif #ifdef __cplusplus } #endif +/* *INDENT-ON* */ #endif /* DLG_KEYS_H_included */ |