X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fncurses.c;h=e349da211e406fa9eb1f53fae529eaeb7b498826;hb=40df80d8d3f96c991f55569bce475e71cc38be12;hp=863d5660f88b5fb0714b2ab6969bef04e65c176d;hpb=1051e5f924808ea27fcf8f5b624e63d07788b86e;p=ncurses.git diff --git a/test/ncurses.c b/test/ncurses.c index 863d5660..e349da21 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.288 2007/05/12 23:04:11 tom Exp $ +$Id: ncurses.c,v 1.292 2007/07/21 17:41:55 tom Exp $ ***************************************************************************/ @@ -3379,12 +3379,14 @@ FRAME WINDOW *wind; }; -#if defined(NCURSES_VERSION) && !NCURSES_OPAQUE -#define keypad_active(win) (win)->_use_keypad -#define scroll_active(win) (win)->_scroll +#if defined(NCURSES_VERSION) +#if NCURSES_VERSION_PATCH < 20070331 +#define is_keypad(win) (win)->_use_keypad +#define is_scrollok(win) (win)->_scroll +#endif #else -#define keypad_active(win) FALSE -#define scroll_active(win) FALSE +#define is_keypad(win) FALSE +#define is_scrollok(win) FALSE #endif /* We need to know if these flags are actually set, so don't look in FRAME. @@ -3396,7 +3398,7 @@ HaveKeypad(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); (void) win; - return keypad_active(win); + return is_keypad(win); } static bool @@ -3404,7 +3406,7 @@ HaveScroll(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); (void) win; - return scroll_active(win); + return is_scrollok(win); } static void @@ -5403,6 +5405,10 @@ demo_forms(void) int finished = 0, c; unsigned n = 0; +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + move(18, 0); addstr("Defined edit/traversal keys: ^Q/ESC- exit form\n"); addstr("^N -- go to next field ^P -- go to previous field\n"); @@ -5476,6 +5482,10 @@ demo_forms(void) free_fieldtype(fty_passwd); noraw(); nl(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif } #endif /* USE_LIBFORM */ @@ -6166,7 +6176,7 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != EOF) { + while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) { switch (c) { #ifdef NCURSES_VERSION case 'a':