Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/menuc Add left and right arrows to list of keys that...



details:   https://anonhg.NetBSD.org/src/rev/f14a6a62473f
branches:  trunk
changeset: 546825:f14a6a62473f
user:      dsl <dsl%NetBSD.org@localhost>
date:      Wed May 07 16:39:45 2003 +0000

description:
Add left and right arrows to list of keys that page menes up/down.
Make 'page down' go to 'exit' extry on menu (not stop one short).
Make 'exitstring' imply 'exit'.

diffstat:

 usr.bin/menuc/menu_sys.def |  23 +++++++++++++----------
 usr.bin/menuc/parse.y      |   5 +++--
 2 files changed, 16 insertions(+), 12 deletions(-)

diffs (81 lines):

diff -r 435c701d4ca1 -r f14a6a62473f usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Wed May 07 16:18:53 2003 +0000
+++ b/usr.bin/menuc/menu_sys.def        Wed May 07 16:39:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menu_sys.def,v 1.30 2003/01/10 20:00:50 christos Exp $ */
+/*     $NetBSD: menu_sys.def,v 1.31 2003/05/07 16:39:45 dsl Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -93,7 +93,7 @@
                switch (ch) {
                case '\n':
                        return REQ_EXECUTE;
-               case '\016':  /* Contnrol-P */
+               case '\016':  /* Control-P */
                case KEY_DOWN:
                        return REQ_NEXT_ITEM;
                case '\020':  /* Control-N */
@@ -104,11 +104,13 @@
                case '<':
                case '\010':  /* Control-H (backspace) */
                case KEY_PPAGE:
+               case KEY_LEFT:
                        return REQ_SCROLLUP;
-               case '\026':
+               case '\026':  /* Control-V */
                case '>':
                case ' ':
                case KEY_NPAGE:
+               case KEY_RIGHT:
                        return REQ_SCROLLDOWN;
                case '?':
                        return REQ_HELP;
@@ -437,9 +439,9 @@
                else if (m->topline == 0)
                        mbeep();
                else {
-                       m->topline = MAX(0,m->topline-m->h+1);
-                       m->cursel = MAX(0, m->cursel-m->h+1);
-                       wclear (m->mw);
+                       m->topline = MAX(0, m->topline - m->h + 1);
+                       m->cursel = MAX(0, m->cursel - m->h + 1);
+                       wclear(m->mw);
                        refr = 1;
                }
 
@@ -449,10 +451,11 @@
                else if (m->topline + m->h - 1 >= m->numopts + hasexit)
                        mbeep();
                else {
-                       m->topline = MIN(m->topline+m->h-1,
-                                        m->numopts+hasexit-m->h+1);
-                       m->cursel = MIN(m->numopts-1, m->cursel+m->h-1);
-                       wclear (m->mw);
+                       m->topline = MIN(m->topline + m->h - 1,
+                                        m->numopts + hasexit - m->h + 1);
+                       m->cursel = MIN(m->numopts + hasexit - 1,
+                                       m->cursel + m->h - 1);
+                       wclear(m->mw);
                        refr = 1;
                }
 
diff -r 435c701d4ca1 -r f14a6a62473f usr.bin/menuc/parse.y
--- a/usr.bin/menuc/parse.y     Wed May 07 16:18:53 2003 +0000
+++ b/usr.bin/menuc/parse.y     Wed May 07 16:39:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.y,v 1.9 2000/08/15 02:09:11 phil Exp $   */
+/*     $NetBSD: parse.y,v 1.10 2003/05/07 16:39:45 dsl Exp $   */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -141,7 +141,8 @@
          | W "=" INT_CONST     { cur_menu->info->w = atoi($3); }
          | H "=" INT_CONST     { cur_menu->info->h = atoi($3); }
          | TITLE STRING        { cur_menu->info->title = $2; }
-         | EXITSTRING STRING   { cur_menu->info->exitstr = $2; }
+         | EXITSTRING STRING   { cur_menu->info->exitstr = $2;
+                                 cur_menu->info->mopt &= ~NOEXITOPT; }
          ;
 
 option_list : option



Home | Main Index | Thread Index | Old Index