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

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

 

boxType

Description

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

Basic Example: 

var grp = new Group(20, 20, (window.w - 40), (window.h - 40)); window.add(grp); grp.boxType = Widget.BORDER_BOX;

NO_BOX draws nothing, and whatever is already on the screen remains.  Other BOX types draw filled images. FRAME types draw non-filled frames; i.e., the interior is transparent so anything already on the screen typically can be seen within the frame.

The following illustrations show the various boxType options applied to a widget defined by "new Group(20, 20, window.w - 40, window.h - 40)" and containing a single text widget at x=20, y=20:


Widget.FLAT_BOX

 Widget.FLAT_BOX is a solid (filled) rectangle with no border. Here it is shown on a black background.


Widget.NO_BOX

Widget.NO_BOX draws no box. Thus, the background color shows through the widget as seen in the first example.

The text in the second example is the same color as the background and, thus. is not visible.

 

image-20240301-133919.png

 

image-20240301-133930.png

 


Widget.BORDER_BOX

Widget.BORDER_BOX is similar to FLAT_BOX, except the image is a filled box with a border.

 

 


Widget.RFLAT_BOX 

Widget.RFLAT_BOX is a filled box with rounded corners and no border. Here it is shown on a black background.

 

 


Widget-ROUNDED_BOX 

Widget-ROUNDED_BOX is a filled box with a rounded border.

 

 


Widget.BORDER_FRAME

Widget.BORDER_FRAME creates a widget that is a transparent (non-filled) rectangle with a border. This example shows a group with its color set to black the background shows through the interior of the widget.

 

 


Widget.OVAL_FRAME

Widget.OVAL_FRAME creates a widget that is a transparent (non-filled) oval frame with a border. 

 

 


Widget. OVAL_BOX

Widget. OVAL_BOX is a filled oval shape with a border.

 

Return to Documentation Home I Return to Sangoma Support