Name

lcdui.settings — Returns or sets information about the graphical environment.

Synopsis

lcdui.settings [-color] [-alphalevels] [-alertimagewidth] [-alertimageheight] [-listimagewidth] [-listimageheight] [-choiceimagewidth] [-choiceimageheight] [-bg] [-fg] [-hilightbg] [-hilightfg] [-border] [-hilightborder] [-borderstyle] [-hilightborderstyle] [-cvfullscreen [ 1 | 0 ] ] [-cvdocmds [ 1 | 0 ] ] [-cvkeepcmdsinfullscreen [ 1 | 0 ] ] [-cvcmdbg [color] ] [-cvcmdfg [color] ] [-skleft [keycode] ] [-skright [keycode] ]

Description

The lcdui.settings command returns information about the phone the program is running on.

  • -color: is this a color display? 1 or 0

  • -alphalevels: number of alpha levels

  • -alertimagewidth: width in pixels of the alert image

  • -alertimageheight: height in pixels of the alert image

  • -listimagewidth: width in pixels of the list image

  • -listimageheight: height in pixels of the list image

  • -choiceimagewidth: width in pixels of the choice image

  • -choiceimageheight: height in pixels of the choice image

  • -bg: background color

  • -fg: foreground color

  • -hilightbg: background hilight color

  • -hilightfg: foreground hilight color

  • -border: border color

  • -hilightborder: border hilight color

  • -borderstyle: border style - can be either DOTTED (1) or SOLID (0)

  • -hilightborderstyle: border highlight style - can be either DOTTED (1) or SOLID (0)

  • -cvfullscreen: Get/set whether full screen mode is allowed for the canvas widget.

    This setting enables the use of fullscreen mode for a canvas. The lcdui Canvas class behaves different in fullscreen mode: it does not show commands. Full screen mode is enabled by default, so a canvas (being a subclass of lcdui.game.GameCanvas) can be created in fullscreen mode. On some devices the behavior in fullscreen mode is broken, so this setting gives you the chance to avoid the fullscreen usage without changing the application itself but only the application startup that might detect certain phone features and turn off fullscreen mode generally for all canvases.

    Devices being picky in fullscreen mode include most of the BlackBerry devices since handling of commands is totally different from other Java ME devices. Most BlackBerry devices use the dial to select between command entries.

  • -cvdocmds: Get/set whether to display commands in the full screen canvas or not.

    Enables the display of commands by the hecl canvas. When it fullscreen mode, canvases do not show commands. You may want a canvas in fullscreen mode and wish to use commands as usual, so the canvas in hecl provides a fallback mechanism to show commands attached to the canvas by itself.

  • -cvkeepcmdsinfullscreen: Get/set whether to add commands in full screen mode.

    Enables treatment of commands attached to a canvas even in fullscreen mode. This behavior is implemented in the Hecl midp layer and may be slidely different from the regular phone behavior for commands attached to other lcdui interafce elements like a form or list.The setting has an effect only for a canvas in fullscreen mode and enables command handling similar to the command handling of non-fullscreen canvases.

  • -cvcmdbg: Get/set color value for command background color in canvas, when Hecl's full screen Canvas command handling is enabled (see above).

  • -cvcmdfg: Get/set color value for command foreground color in canvas, when Hecl's full screen Canvas command handling is enabled (see above).

  • -skleft: Get/set the numeric keycode for the left soft key.

    The values are used to identify the keys triggering command handling for a canvas. The standard settings for these values are the usual keycode -6 (left) and -7 (right) that work on most Java ME devices. There are some well-known differences that are detected by the Hecl midp package:

    Siemens S65 and friends: -1 (left), -4 (right) - detected via existence of class com.siemens.mp.lcdui.Image BlackBerry: 524288=0x80000 (left), 0x1b0000 (right) - detected via existence of class net.rim.device.api.system.Application

    Application developers can tailor these settings for specific device models in their own applications.

  • -skright: Get/set the numeric keycode for the right soft key (see explanation above).

Example

set form [lcdui.form -title "Settings Demo" -commandaction menu1sel]
$form setcurrent

foreach s {"-color"
    "-alphalevels"
    "-alertimagewidth"
    "-alertimageheight"
    "-listimagewidth"
    "-listimageheight"
    "-choiceimagewidth"
    "-choiceimageheight"
    "-bg"
    "-fg"
    "-hilightbg"
    "-hilightfg"
    "-border"
    "-hilightborder"
    "-borderstyle"
    "-hilightborderstyle"
} {
    $form append [lcdui.stringitem -label "[strtrim $s -]:" -text \
        [lcdui.settings cget $s]]
}

Live example: http://www.heclbuilder.com/scripts/show/152