Cmenu
Cmenu is a Perl v5 Module designed to offer easy to use menuing facilities from within perl scripts. It is designed with the look and feel of the command line utility "dialog".
Download Cmenu now! (80k)
Features
As well as providing menuing facilities, Cmenu also includes limited facilities for the editing of data fields. Cmenu is intended for
character-based terminals; virtual, xterm or real.
- Text menus
- Allows simple menus with text labels, bounce bar, button bar and "intuitive" navigation.
- Numbered Menus
- Traditional menus with numbered options
- Radio lists
- Provides facilities for radio lists (single selection from multiple choices)
- Check Lists
- Provides facilites for check lists (multiple selections from multiple choices)
- Popup Windows
- Busy screens and splash screens
- Data field lists
- List fields from databases referencing record pointers on selection
- Data Field Editing
- Simple field editing of data fields; text fields are OK, numeric field formating and validation needs work
- Line Seperators
- Menu option spacing with optional descriptions
- Mixed Menus
- All above menu types can be mixed together on one menu
- Help Facility
- Various facilities to provide help-information to users including Help buttons
- User Configurable
- System-wide and User Specific configuration files to tailor appearance and behaviour of the module to user and site requirements
Cmenu provides a simple interface to the module requiring three main sub-routine calls for defining the menu, its items and retrieving user response. All navigation, layout, terminal control, etc is performed by the module. The module requires two additional modules to function;
- Curses: the curses module for perl which provide display manipultaion and keyboard input filtering; use terminfo database of terminal characteristics. You will need a version greater than 1.04 - v1.02 definitely will not work. This module is readily available from CPAN archives (if it is not already installed).
- Text::Wrap - a text massaging module to wrap a text stream into a fixed width display (window). Used to fill splash screen with unformatted text. Also available from CPAN archives.
Complex menus will require a good knowledge of perl to deal with return values and construct support routines to really benefit from the menuing and editing capabilities. A demonstration script is included with the package to illustrate its application and usage.
History
This project came about while trying to build simple scripts to interact with SQL databases providing data to backend processes (latex document processing). The command-line utility "dialog" looked a good bet but problems arose with getting SQL command-line tools to interact effectively through shell scripts.
Since perl has good support for SQL databases and is obviosuly quite clever at manipulating text, when I discovered the perlmenu module, this looked like the best possible solution. While perlmenu is extremely good, it does not really use the Curses module; this loses colour support and strong terminal support especially with function key navigation. So I decided to hack perlmenu to implement a Curses interface - and eventually Cmenu arrived. Cmenu has lost almost all vestiges of perlmenu and is not in the least compatible with it as it has embarked on a completly different track. In general, though, both support the same features.
Cmenu has just been finished (17th Jan 2001) and needs folk to give it a beating to see if can stand-up Ok. Please download it and try it out and send me your comments and suggestions for improvements.
Download Cmenu now! (80k)
Version history
| Jan 2001 | 5.0 |
Initial release of perlDialog
|
| Jan 2001 | 5.1 |
A few bug fixes; inclusion of SQL demonstration script
|
| Feb 2001 | 5.2 |
More bug fixes (thanks Gavin)
|
| Apr 2001 | 1.0 |
Package renamed to Cmenu to avoid clashes with other CPAN modules
|
| Oct 2001 | 1.1 |
Several changes to rendering routines especially configuration facilities; mono display facilities much better.
Added a few tweaks for an extra line and ability to disable Lynx-style motion.
|