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 |
---|---|
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. |
Â
Properties
Name | Description |
---|---|
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:
|
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). |
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). | |
visible | Whether or not the widget is displayed. |
Width/height of the widget. | |
Position of top left corner of the widget. |
Â