Phone API Reference - UI Classes (Widgets) - Widget (Base Class)

Desk Phone API features described in this section are deprecated and supported only on the following models: D40, d45, d50, d60, d62, d65, d70

 

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. 

Methods

Name 

Description 

Name 

Description 

clearSoftkeys

Removes softkey assignments for the widget.

setProp

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

setSoftkey

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

setSoftkeyIcon

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.

setSoftkeysByList

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.

showSoftkeysPage

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

takeFocus

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.

 

Properties

Name 

Description 

Name 

Description 

boxType

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

color 

labelColor

textColor

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)

focusable 

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

onblur 

Function to execute when the widget loses keyboard focus.

onfocus 

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

onhide

Function 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).

onkey[key]

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.

onsoftkey[key]

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

visible 

Whether or not the widget is displayed.

w/h

Width/height of the widget.

x/y

Position of top left corner of the widget.

 

Return to Documentation Home I Return to Sangoma Support