Commit Graph

43 Commits

Author SHA1 Message Date
dsl f19029a851 Add OPT_IGNORE flag which makes menu item inactive.
Add menu-dependant function to draw menu lines (when opt_name NULL).
2003-07-07 12:20:56 +00:00
dsl e28e42e092 Improve diagnostic message 2003-06-27 22:06:14 +00:00
dsl 18439070c7 Do not let the cursor sit on menu lines that do nothing.
(Maybe page up/down should behave similarly - but that one is harder)
2003-06-16 20:57:43 +00:00
dsl 19605a628c 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 "".
2003-06-10 17:19:04 +00:00
dsl 3c95a92e07 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
2003-06-09 18:48:40 +00:00
dsl 3f8c566477 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.
2003-06-04 19:07:39 +00:00
dsl 6af8425f81 Add a 'void *' argument to process_menu() so that some more global variables
can be killed.
2003-06-03 11:51:56 +00:00
dsl 76c4788c16 More trivial changes...
Exclude '<: page up, >: page down' line from m->h count to simplify code.
2003-06-03 08:49:53 +00:00
dsl 99778eca69 Whitespace and other layout stuff.
Change an elsif sequence to switch()
2003-06-02 21:19:35 +00:00
dsl 66fb8e715d Need 'const' on local variable - since I added const to the structure field. 2003-05-09 10:24:50 +00:00
dsl b143b30e1c 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.
2003-05-08 16:20:56 +00:00
dsl f579b0bca7 Let page up/down go to first/last menu item when it is already showing. 2003-05-07 16:54:39 +00:00
dsl 13bfd47102 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'.
2003-05-07 16:39:45 +00:00
christos c3e2d898b4 produce lint free code. 2003-01-10 20:00:50 +00:00
blymn 19f21e4357 Modified input key handling to use libcurses keypad mode to assemble
multi-byte key sequences instead of doing it itself.
2002-04-04 14:11:23 +00:00
ross a15e9b5f48 tweak previous for lp64 so sysinst will compile on alpha 2001-12-08 01:10:37 +00:00
christos 5c04ef3caa Fix for the new curses code. Inspired by changes from MINOURA Makoto. 2001-12-06 16:38:30 +00:00
perry c50182835e 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.
2001-11-17 01:12:47 +00:00
phil 0e57605760 Improve a parameter list, add the actual documentation for menuc. 2001-01-07 06:09:19 +00:00
phil 94c7405838 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.
2000-08-15 02:09:11 +00:00
hubertf 4e87e20dda 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
2000-08-15 01:01:41 +00:00
thorpej 0687dad67e 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.
2000-04-22 21:34:25 +00:00
cgd da4d528c80 need to provide an exit string for dynamic menus. hardcodes "Exit".
not pretty, but no worse than what the code did before.
1999-06-20 20:21:03 +00:00
cgd 8c3bc73ea2 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.
1999-06-20 05:41:45 +00:00
cgd b12d2926fa provide a way to set the string used for the 'Exit' menu item. 1999-06-20 02:07:18 +00:00
cgd 27ddbc286a size menus without titles correctly. also, correctly position titles so
that they don't have to be coded to include leading spaces.
1999-06-20 01:20:14 +00:00
cgd 96c4c464ea * 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.
1999-06-19 06:38:49 +00:00
simonb 9bdbe15263 Don't frob the interals of a WINDOW*, use the getmaxy() macro. 1999-04-18 03:29:18 +00:00
phil 11c7d5d3b1 Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus.  (Return !=0 means to exit menu dynamically.)
1998-07-23 17:56:00 +00:00
phil d20940b940 Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling.  Added dynamic menu to test meuns in testm.
1998-07-16 07:08:26 +00:00
phil 4229b1a8cc Fix bugs found in scrolling, make scrolling never leave blank
lines in the menu.
1998-07-03 15:20:30 +00:00
phil 3ff44f8429 Stop scrolling of a non-scrolling menu using arrow keys. 1998-07-01 23:02:50 +00:00
phil 5aa748c608 Bug fixes, tweeks to scrolling, beginnings of dynamic menus. 1998-07-01 07:46:02 +00:00
phil 8f97042b69 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?)
1998-06-30 06:57:57 +00:00
phil b30b562845 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.
1998-06-29 08:46:37 +00:00
phil 0c35cc0adb 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.)
1998-06-25 19:57:10 +00:00
phil 1063113ca9 Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
1998-06-25 09:58:57 +00:00
phil ec4d385aa3 Beep if no help is defined for a menu. 1998-06-24 14:44:52 +00:00
phil 21fceead47 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.
1998-06-24 06:46:23 +00:00
phil fe8c89a497 Do screen refresh correctly. 1997-11-14 18:27:17 +00:00
phil 24a09a1420 Make ^L redisplay the screen. 1997-11-14 16:31:45 +00:00
phil 1ec08fd982 Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
1997-11-09 20:59:11 +00:00
phil 95f3bf39d9 Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
1997-09-26 17:54:09 +00:00