Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/menuc provide the ability to do horizontal centering...



details:   https://anonhg.NetBSD.org/src/rev/2963cbcd5efc
branches:  trunk
changeset: 473816:2963cbcd5efc
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sun Jun 20 05:41:45 1999 +0000

description:
provide the ability to do horizontal centering of menus, and make that
the default.  XXX: currently can't be turned back on for individual menus
if overridden by the menu definition's default setting.

diffstat:

 usr.bin/menuc/main.c       |  4 ++--
 usr.bin/menuc/menu_sys.def |  6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 733bdd287a34 -r 2963cbcd5efc usr.bin/menuc/main.c
--- a/usr.bin/menuc/main.c      Sun Jun 20 05:34:59 1999 +0000
+++ b/usr.bin/menuc/main.c      Sun Jun 20 05:41:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.5 1999/06/20 02:07:18 cgd Exp $     */
+/*     $NetBSD: main.c,v 1.6 1999/06/20 05:41:45 cgd Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -83,7 +83,7 @@
        default_info.helpstr = NULL;
        default_info.exitstr = NULL;
        default_info.mopt = 0;
-       default_info.x = 0;
+       default_info.x = -1;
        default_info.y = 0;
        default_info.h = 0;
        default_info.w = 0;
diff -r 733bdd287a34 -r 2963cbcd5efc usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Sun Jun 20 05:34:59 1999 +0000
+++ b/usr.bin/menuc/menu_sys.def        Sun Jun 20 05:41:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menu_sys.def,v 1.19 1999/06/20 02:07:18 cgd Exp $      */
+/*     $NetBSD: menu_sys.def,v 1.20 1999/06/20 05:41:45 cgd Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -285,7 +285,9 @@
                exit(1);
 
        }
-       if (m->x + m->w + wadd > max_cols)
+       if (m->x == -1)
+               m->x = (max_cols - (m->w + wadd)) / 2;  /* center */
+       else if (m->x + m->w + wadd > max_cols)
                m->x = max_cols - (m->w + wadd);
 
        /* Get the windows. */



Home | Main Index | Thread Index | Old Index