Skip to end of metadata
Go to start of metadata

Methods and properties of the Widget object are used to control basic properties for any UI items. It is not possible to construct a Widget object directly, but all UI classes and onscreen items inherit their basic functionality from this Widget base class. 


Name Description 

Removes softkey assignments for the widget.


Assigns a value to the specified widget property and returns the widget. This function can be used to chain multiple property assignments.


Sets the label and (optionally) handler for a specific softkey when this widget has keyboard focus.


Sets an image object to display at the top left corner of the softkey. Useful for indicating a hard key that calls the same handler. Suggested image size is 5x5 pixels.


Sets up multiple softkeys at once. Assigning more than four softKeys causes the fourth softkey to be a More softkey, which cycles the other three softkeys through the list.


Jumps to a specific page of softKeys (starting with 1), after calling setSoftkeysByList.


Gives the selected widget keyboard focus. Calling this method triggers the object's onFocus handler to be called, which must return true to take focus.



Name Description 

Sets the type of box that is drawn around the widget.




Value for the background color

Value for the foreground color of all widgets except Input fields

Value for the foreground color of Input fields

For D40, D45, D50 and D70 model phones: white or black.

For D60, D62, D65 model phones:

  • bgcolor - main background color (grey 900)
  • fgcolor - main foreground text color (grey 200)
  • titlebgcolor - title background (blue title bar)
  • titlefgcolor - title foreground (white title bar text)
  • selectbgcolor - select background (light blue select bar)
  • selectfgcolor - select foreground (dark select text grey 900)
  • modalbgcolor - dark grey modal background (grey 800)
  • errorbgcolor - error background (red)
  • errorfgcolor - error foreground (white text)
  • fieldbgcolor - input field default background (light grey 300)
  • fieldfgcolor - input field default foreground (dark text grey 900)
  • tablfg2color - table 2 text medium dark grey (grey 500)
  • tablfg3color - table 3 text medium light grey text (grey 400)
  • tablfg4color - table 4 text red (red 900 also matches red softkey)
  • tablbdrcolor - table border color (dark grey border lines grey 700)
  • skdialcolor - soft key green dial color (green 900)
  • skerasecolor - soft key red delete color (red 900)

Whether or not the widget is able to receive keyboard focus.


Function to execute when the widget loses keyboard focus.


Function to execute when the widget is targeted for keyboard focus. This function must return true for the widget to actually gain keyboard focus.

onhideFunction to execute when the widget is hidden. (typically used to ensure Input field highlight colors are set to their normal background color when a screen is exited or hidden).

Handler for when the key specified by [key] is pressed. Key handlers start by checking on the current focused widget. If none are found, they will move up the UI chain to any parent widgets.


Set an event handler for one of the four softkeys. Replace [key] with the corresponding value of 1 - 4 (left to right).


Whether or not the widget is displayed.


Width/height of the widget.


Position of top left corner of the widget.

  • No labels