Keywords: Cmenu

Next: menu_display Up: Function Reference Previous: menu_init Contents

## menu_item

Creates a menu item; the main element of the module. Called like this;
menu_item("menu text","label",$type,"tag","format");

menu text
  (mandatory) the menu's descriptive text
label
  a text label associated with the menu item; unless over-ridden, this will be returned when an option is selected
$type
  the type of a menu item controlling its rendering and behaviour
  0 default
    simple menu option returning the label if selected
  1 numeric
    instead of text labels, offers numeric options
  2 radio list
    a radio list selects ONLY one from a list
  3 check list
    a check list select any (including none) from a list
  4 data label
    a regular label usually used to accompany data fields for information only
  5 display
    a right-aligned label for data information fields
  6 alpha-edit
    an editable textfield
  7 numeric-edit
    an editable numeric field
  8 encoded
    for fields from a database it is often convenient to display a descriptive label but requiring a different return value
  9 spacer
    like a comment, create a spacre-line in the menu
tag
  only used in some item types to contains alternate return values (type 8) or indicate active list selections (types 2 or 3)
format
  for editable fields specifies the field size and numeric formating; phrased as a space seperate list like "25 2 0" which has field-width 25 and 2 decimal places. (I forget why I wanted the third digit)

For a demonstration of all these options and how to use them in real menus, run and play with the included demo script.

Next: menu_display Up: Function Reference Previous: menu_init Contents