Name

lcdui item options — common options for lcdui.choicegroup, lcdui.date, lcdui.gauge, lcdui.imageitem, lcdui.spacer, and lcdui.stringitem

Common lcdui item options

The lcdui "item" elements have a number of options in common, which are described here.

Many of these options are layout options, and correspond to what is described here: http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Form.html#layout

lcdui item configuration options

These options may be set as follows, or as options at the time the item is created.

$itemcmd configure -optname optvalue

  • -label text: the item's label

  • -anchor position: One of the following positions. For more information, see http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html

    • n: top/center

    • ne: top/right

    • e: right/vertically centered

    • se: bottom/right

    • s: bottom/center

    • sw: bottom/left

    • w: left/vertically centered

    • nw: top/left

    • center: horizontally and vertically centered

    • default: top/left

    • bl: left/baseline

    • bc: centered/baseline

    • br: right/baseline

  • -shrink 1 | 0 Indicate that this item's width may be reduced to its minimum width.

  • -expand 1 | 0 Indicate that this item's width may be increased to fill available space. width.

  • -vexpand 1 | 0 Indicate that this item's height may be increased to fill available space. width.

  • -newlinebefore 1 | 0 Indicate that the next item (if any) in the container should be placed on a new line or row.

  • -newlineafter 1 | 0 Indicate that this item should be placed at the beginning of a new line or row.

  • -layout2 1 | 0 A layout directive indicating that new MIDP 2.0 layout rules are in effect for this item.

  • -preferredwidth width Preferred width for the item.

  • -preferredheight height Preferred height for the item.

  • -defaultcommand command If this item is clicked on, the default command to call. command refers to a command object, and not a Hecl proc or command.

  • -commandaction command The Hecl command to call when a command is dispatched.

read-only configuration information

All of the above attributes may be read as well as written. There are several more attributes that are "read only". They can be obtained like so:

$itemcmd cget -optname optvalue

  • -minwidth : Returns the minimum width for this item.

  • -minheight : Returns the minimum height for this item.