Home | History | Annotate | Download | only in menuc
History log of /src/usr.bin/menuc/menu_sys.def
RevisionDateAuthorComments
 1.72  23-Jun-2019  christos use calloc properly.
 1.71  23-Jun-2019  martin Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
 1.70  22-Jun-2019  christos Conserve space: make ints to shorts and make OPT_NOMENU 0 instead of -1
so we don't require initializing it.
 1.69  12-Apr-2019  martin Backout previous - our pool is zeroed, no need to reinitializ here.
 1.68  12-Apr-2019  martin new_menu: add missing initializations - we might be using a previously
freed menu entry which has not been zeroed.
 1.67  25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.66  16-Feb-2019  martin Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
 1.65  06-Feb-2019  martin Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).
 1.64  09-Jan-2019  martin Allow argument expansion in menu titles as well.
 1.63  06-Jan-2019  martin Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
 1.62  04-Jan-2019  martin Add an option for single (disabled) menu lines to have no shortcut.
 1.61  02-Jan-2019  martin If a menu starts with disabled options, skip those and start at the
first enabled one instead.
 1.60  21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.59  06-Mar-2012  mbalmer branches: 1.59.30; 1.59.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.58  20-Feb-2006  dsl branches: 1.58.44;
Allow menu entry option names to be code fragments that (should) call
wprintw(menu->mw, ftm, args) to generate the menu label.
Allows static menu labels to contain the current value (like a lot of the
dynamic menus do).
Correct width calculations, and bound menu table lookup.
 1.57  17-Sep-2004  wrstuden In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.
 1.56  17-Sep-2004  wrstuden Add parenthesis to silence a compiler warning.
 1.55  14-Aug-2004  dsl Call doupdate() before copying out of stdscr (avoids PR 26660)
Delete a diagnostic variable.
 1.54  02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.53  29-Feb-2004  dsl branches: 1.53.4;
Allow menu boxes to be forced down the screen if the message text is long.
 1.52  21-Dec-2003  dsl Use an array of pointers to menu definitions so the array can grow without
leaving code having stale pointers to menu ites.
 1.51  30-Nov-2003  dsl Add '[no] clear' to lex/yacc spec.
Fix some menu sizing bugs for menus where the user code changes the size.
Don't reduce the size of a menu with 'scroll' every timeit is displayed.
 1.50  22-Nov-2003  dsl - Call delwin() when we stop displaying a window, saves space and newwin
is fast enough anyway. Lets the calling code change some fields (eg
the title for the 'yes/no' menu) between calls.
- Don't update m->x, m->y, m->w the changed values aren't needed once
the window has been created.
- Allow the window title to span multiple lines.
- Fix a nasty bug caused by having pointers into the memory area freed
by realloc when creating lots of dynamic menus.
- Fix check that ought to have allowed dynamic menus to be deleted.
 1.49  20-Nov-2003  dsl Fix box width calculation for menus without a 'shortcut' ("a: ").
 1.48  18-Oct-2003  dsl Add an MC_ALWAYS_SCROLL to mean "always allow space for 'scrolltext'".
All scrolltext to be #defined so it can be translated.
 1.47  27-Sep-2003  dsl Allow -ve integer constants in menu file.
Make y == -1 => after current messages (if msg_defs.h included).
Defer menu initialisation until after post_act() called (so function can
fiddle with more things.)
 1.46  21-Sep-2003  takemura Fixed array index checking to avoid segmentation fault problem.
 1.45  27-Jul-2003  dsl More tweaks for sysinst.
Let 'display action' routine set menu->cursel (ie default menu item).
Remove 'opt' parameter I added to action routine (not that useful).
Make man page slightly closer to reality.
 1.44  25-Jul-2003  dsl Spinkle some consts and remove/change parameter names so that sysinst
will compile with WARNS=3.
 1.43  07-Jul-2003  dsl Add OPT_IGNORE flag which makes menu item inactive.
Add menu-dependant function to draw menu lines (when opt_name NULL).
 1.42  27-Jun-2003  dsl Improve diagnostic message
 1.41  16-Jun-2003  dsl Do not let the cursor sit on menu lines that do nothing.
(Maybe page up/down should behave similarly - but that one is harder)
 1.40  10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.39  09-Jun-2003  dsl More changes to improve sysinst:
- pass 'menudesc' and 'arg' values to post_act() and exit_act()
- add set_menu_numopt() for variable length menus
- fix (badly broken) allocation/free of dynamic menus
- option to allow default selection to be the exit line
 1.38  04-Jun-2003  dsl Add 'exit' (for exit text) parameter to new_menu() for dynamic menus.
Correct calculation of menu height and whether scrolling needs (was wrong
if a height was specified that was smaller that the number of lines needed).
Move keypad(m->mw, TRUE) to stop core dump when newwin() fails.
Allow for calling code hacking m->h (to reduce number of lines displayed).
Add a MC_NOCLEAR option to leave menu text showing when doing action.
 1.37  03-Jun-2003  dsl Add a 'void *' argument to process_menu() so that some more global variables
can be killed.
 1.36  03-Jun-2003  dsl More trivial changes...
Exclude '<: page up, >: page down' line from m->h count to simplify code.
 1.35  02-Jun-2003  dsl Whitespace and other layout stuff.
Change an elsif sequence to switch()
 1.34  09-May-2003  dsl Need 'const' on local variable - since I added const to the structure field.
 1.33  08-May-2003  dsl Accept variable names for menu titles and options to allow internationalisation.
Allow user code to define a hook to lookup message texts before any get used.
It is now possible to have a langauge independant menu file.
 1.32  07-May-2003  dsl Let page up/down go to first/last menu item when it is already showing.
 1.31  07-May-2003  dsl 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'.
 1.30  10-Jan-2003  christos produce lint free code.
 1.29  04-Apr-2002  blymn branches: 1.29.2;
Modified input key handling to use libcurses keypad mode to assemble
multi-byte key sequences instead of doing it itself.
 1.28  08-Dec-2001  ross tweak previous for lp64 so sysinst will compile on alpha
 1.27  06-Dec-2001  christos Fix for the new curses code. Inspired by changes from MINOURA Makoto.
 1.26  17-Nov-2001  perry 1) Use standard box drawing characters. It looks a whole lot better
than *'s.
2) On displays that handle color, do a cheesy white-on-blue theme.

As silly as it may seem, many people seem to respond better to color
and nice borders for sysinst.

XXX will rig up a way to do this more cleanly.
 1.25  07-Jan-2001  phil Improve a parameter list, add the actual documentation for menuc.
 1.24  15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.23  15-Aug-2000  hubertf Changes:
* bring closer to KNF
* when selecting a item in a menu, call the opt_action() callback with
a pointer to the struct menudesc, so the callback has a chance to find
out which item was selected. Having a seperate callback for each
item is ok for small menus, but not for ones with many objects.
* Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
in front of list items. Again, this is for menues with lots of entries
as e.g. the upcoming sysinst set_timezone() function composes.
* Fix a long-standing bug WRT pagewise scrolling - the cursor is now
properly placed one page up/down
 1.22  22-Apr-2000  thorpej branches: 1.22.4;
Make this work again now that curses no longer does an implicit tgetent()
via initscr() by calling t_getstr() with curses' internal terminal info
initialized in setterm() (which is called by initscr()).

XXX THIS IS A HORRIBLE KLUDGE! ...and I'm almost embarassed to commit it.
XXX It really should be fixed by using normal curses facilities.
 1.21  20-Jun-1999  cgd need to provide an exit string for dynamic menus. hardcodes "Exit".
not pretty, but no worse than what the code did before.
 1.20  20-Jun-1999  cgd 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.
 1.19  20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.18  20-Jun-1999  cgd size menus without titles correctly. also, correctly position titles so
that they don't have to be coded to include leading spaces.
 1.17  19-Jun-1999  cgd * be more descriptive with the windor/screen too small for menu messages
(say width or height).
* work harder to make menu fit width-wise. (if necessary, move the menu
further left, and if that's not good enough exit with an error.)
* move menu system initialization out of process_menu() so that it can
be called earlier (e.g. by the sysinst main()), since it initializes
curses and other code might want to access the curses data structures
before process_menu() is invoked.
 1.16  18-Apr-1999  simonb Don't frob the interals of a WINDOW*, use the getmaxy() macro.
 1.15  23-Jul-1998  phil branches: 1.15.2;
Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus. (Return !=0 means to exit menu dynamically.)
 1.14  16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.13  03-Jul-1998  phil Fix bugs found in scrolling, make scrolling never leave blank
lines in the menu.
 1.12  01-Jul-1998  phil Stop scrolling of a non-scrolling menu using arrow keys.
 1.11  01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.10  30-Jun-1998  phil Fixed a couple of simple bugs, added data returned for arrow keys for
xterm that is different than xterm termcap entry states. (Does curses
change what is returned for arrow keys?)
 1.9  29-Jun-1998  phil Bug fixes in scrolling menues, better error detection with small screens,
bettern keypad support with suport form multiple key "commands" like
ESC-v for previous page.
 1.8  25-Jun-1998  phil Tweeks to option lettering ... to allow 51 options per menu. Also
to generate an error if there are more. (Checkpoint before furthur
changes to recognize more keypad keys.)
 1.7  25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.6  24-Jun-1998  phil Beep if no help is defined for a menu.
 1.5  24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.4  14-Nov-1997  phil Do screen refresh correctly.
 1.3  14-Nov-1997  phil Make ^L redisplay the screen.
 1.2  09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1  26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1  26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.2  18-Nov-1997  mellon Pull rev 1.3 and 1.4 up from trunk (phil)
 1.1.1.1.2.1  09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.15.2.1  24-Jun-1999  cgd pull up rev(s) 1.16-1.21 from trunk. (cgd)
 1.22.4.2  12-Aug-2003  itojun usr.bin/menuc/menuc.1 1.5
usr.bin/menuc/menu_sys.def 1.25 via patch

Improve a parameter list, add the actual documentation for menuc.
To make sysinst compile.
[masanobu, ticket #65]
 1.22.4.1  15-Aug-2000  hubertf Pull up to netbsd-1-5 branch, OK'd by thorpej:

Revisions:
> cvs rdiff -r1.15 -r1.16 basesrc/usr.bin/menuc/mdb.c
> cvs rdiff -r1.22 -r1.23 basesrc/usr.bin/menuc/menu_sys.def

Log Message:
> * bring closer to KNF
> * when selecting a item in a menu, call the opt_action() callback with
> a pointer to the struct menudesc, so the callback has a chance to find
> out which item was selected. Having a seperate callback for each
> item is ok for small menus, but not for ones with many objects.
> * Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
> in front of list items. Again, this is for menues with lots of entries
> as e.g. the upcoming sysinst set_timezone() function composes.
> * Fix a long-standing bug WRT pagewise scrolling - the cursor is now
> properly placed one page up/down
 1.29.2.1  24-Dec-2003  jmc Pullup hand patch (requested by martin in ticket #1571)
The opt_action function may allocate new menus,
which may make m a stale pointer into the old
menus array. So re-target it.
 1.53.4.4  23-Jul-2005  snj Pull up revision 1.57 (requested by riz in ticket #5515):
In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.
 1.53.4.3  23-Jul-2005  snj Pull up revision 1.56 (requested by riz in ticket #5515):
Add parenthesis to silence a compiler warning.
 1.53.4.2  23-Jul-2005  snj Pull up revision 1.55 (requested by riz in ticket #5515):
Call doupdate() before copying out of stdscr (avoids PR 26660)
Delete a diagnostic variable.
 1.53.4.1  23-Jul-2005  snj Pull up revision 1.54 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.58.44.1  17-Apr-2012  yamt sync with head
 1.59.32.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.59.32.1  10-Jun-2019  christos Sync with HEAD
 1.59.30.2  18-Jan-2019  pgoyette Synch with HEAD
 1.59.30.1  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts

RSS XML Feed