Commit Graph

156 Commits

Author SHA1 Message Date
christos c9e3ec3ad5 Use OPT_NOMENU instead of -1 2019-06-23 22:48:15 +00:00
christos 7743b1bf0c use calloc properly. 2019-06-23 22:47:22 +00:00
christos 48d8b2ae49 don't cast malloc. 2019-06-23 22:46:53 +00:00
christos e2deb0a92c define as hex and make MC_VALID smaller so it fits in a short. 2019-06-23 22:46:41 +00:00
martin d8297eb873 Menu 0 does not exist anymore (it is now OPT_NOMENU), so emit an empty
menu defintion for it.
2019-06-23 11:31:10 +00:00
martin 5908298eb7 Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
2019-06-23 11:22:48 +00:00
christos 4cd30f5b0c Conserve space: make ints to shorts and make OPT_NOMENU 0 instead of -1
so we don't require initializing it.
2019-06-22 20:44:54 +00:00
martin e8ac518b01 Backout previous - our pool is zeroed, no need to reinitializ here. 2019-04-12 15:59:34 +00:00
martin 44df961cb4 new_menu: add missing initializations - we might be using a previously
freed menu entry which has not been zeroed.
2019-04-12 15:47:41 +00:00
martin a7fc6d1692 Add an option to supress the vertical space between menu title and
menu items.
2019-02-25 20:47:37 +00:00
martin 37df7b8973 Typo in member variable name 2019-02-16 19:09:07 +00:00
martin c8239d06af 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).
2019-02-16 18:57:21 +00:00
martin fbb0a702e6 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).
2019-02-06 20:08:15 +00:00
martin 8a7549a99f Allow argument expansion in menu titles as well. 2019-01-09 19:43:37 +00:00
martin afdad64472 Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
2019-01-06 11:08:34 +00:00
martin b8b0f2eea4 Add an option for single (disabled) menu lines to have no shortcut. 2019-01-04 15:27:19 +00:00
martin 01b87e76cf If a menu starts with disabled options, skip those and start at the
first enabled one instead.
2019-01-02 16:32:59 +00:00
uwe 415ab74c4d Try to provide the typesetting help requested. 2018-11-21 22:42:26 +00:00
martin 34c5a1a313 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...
2018-11-21 20:04:48 +00:00
sevan 7a75668892 drop main() prototype 2018-01-23 22:12:52 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
christos 9f630f8bc1 avoid redefinitions 2013-10-18 20:19:36 +00:00
roy 258cf0abec Add capfile(5) to describe the termcap format.
Adjust various man pages and other documentation to point to capfile(5)
instead of termcap(5).
Remove getcap(3) as curses hasn't been building it for a long time.
Punt wrterm.c as tset no longer uses it.
2012-04-21 12:27:24 +00:00
mbalmer 5cd43bc624 Remove the advertising clause and appease the eye a bit (still not good, but
better).  Almost no functional change.
2012-03-06 16:55:18 +00:00
joerg 2eacf5d5a2 Mark __menu_initerror as dead in the output. 2011-09-06 18:16:38 +00:00
christos 926a7cc331 option noinput 2009-10-29 14:35:25 +00:00
joerg 5f6627fa61 mandoc(1): -width is redundant for a item list 2009-07-11 18:38:30 +00:00
drochner 0fa7059102 define YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160 2009-04-20 16:05:29 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
joerg 1cc1109801 Specify width for tag list. 2009-03-10 20:23:47 +00:00
joerg 997634fe14 Fix preamble to match order set out by mdoc(7). Discussed with wiz. 2009-03-09 19:24:26 +00:00
tls 2a6850b9a9 Fix PR37377 from Devon O'Dell: num_menus can be referenced without being
emitted if dynamic menus are not enabled.
2008-01-16 09:21:33 +00:00
he d59cb8e7b8 Fully initialize the last element of menu_def[]. 2006-10-23 19:29:48 +00:00
reed 37bfcfc9dd Another mispelling fix. I should have done these all in one commmit
but I was editing several files and didn't realize the multiple
were all in one file.
2006-06-17 02:27:05 +00:00
reed 5cb179a5f0 Fix typo (or mispelling). 2006-06-17 02:19:57 +00:00
reed c5f16e7060 Fix mispelling. 2006-06-17 02:06:17 +00:00
dsl 2acc3971af 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.
2006-02-20 21:06:40 +00:00
simonb 3cebd9325e White space nit- don't put a space before/after increment/decrement
operators.
2005-02-11 06:21:21 +00:00
wrstuden 699e5d41fb In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.
2004-09-17 18:27:28 +00:00
wrstuden e22217703e Catch up with current menuc. 2004-09-17 18:16:44 +00:00
wrstuden af7a153178 Scoot a menu so it fits better in an xterm. 2004-09-17 18:16:31 +00:00
wrstuden 3f87739bc4 Add parenthesis to silence a compiler warning. 2004-09-17 18:15:01 +00:00
dsl c4d2d498a2 Call doupdate() before copying out of stdscr (avoids PR 26660)
Delete a diagnostic variable.
2004-08-14 15:51:08 +00:00
wiz 27ef0f1c37 Sort sections; avoid to mark up punctuation unnecessarily; use \*[Lt]\*[Gt]
instead of <>; use Sq.
2004-08-02 22:27:36 +00:00
dsl f5b2286ba1 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.
2004-08-02 21:29:07 +00:00
dsl e92cba3e15 Make '0' be a valid number 2004-07-18 10:57:32 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
dsl 273835431b Allow menu boxes to be forced down the screen if the message text is long. 2004-02-29 23:13:23 +00:00
dsl e2be127214 Use an array of pointers to menu definitions so the array can grow without
leaving code having stale pointers to menu ites.
2003-12-21 21:42:48 +00:00
dsl 092f7d2e16 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.
2003-11-30 09:22:25 +00:00