HTBasic Help
×
Menu
Index

Dialogs and Widgets

 

Dialogs Overview

Dialogs are fundamental controls in BuilderPlus. They are used in GUIs to interact with the user and get input (with a TIMEOUT). From the user's point of view, a dialog appears as a popup panel that disappears when the user responds. See List of Dialogs for a description of the HTBasic dialogs.
 

Widgets Overview

Widgets are detailed in the Reference Manual. Widgets are very flexible controls that can be used to build sophisticated user interfaces. For example, you can create "virtual instruments" that include buttons, sliders, and text, meters and graphics displays, and pulldown menus.
 
Widgets can be loosely grouped into five categories, but some widgets may belong to more than one category. See List of Widgets for an alphabetical listing of each widget. See Widget List by Category for a list of widgets by functional category.
 

Dialogs/Widgets Attributes

Dialogs and widgets have common and specific attribute settings that allow you to customize the dialog or widget. Common attributes includes items such as the position of the object on the screen, the background color of the object, and the size of the object. Most dialogs and widgets also have attributes specific to that object.
 
For example, the STRIPCHART widget has over thirty specific attributes, including number of channels displayed, color assigned to each channel, and control over the number of points displayed, number of points in the display buffer, and how the display is updated.
 

Setting Input Focus

Setting the FOCUS attribute to a value of 0 gives focus to the specified widget. A value of 1 moves focus from the Widget to the HTBasic program window.
 

Widget Stacking Order

The value of STACKING ORDER represents the depth of a particular widget in the widget hierarchy on the screen. The STACKING ORDER of the widget that is popped to the top on the screen is 0, the widget just below the top widget has a STACKING ORDER of 1, below that 2, and so on.
 
STACKING ORDER applies to the hierarchy inside the child stack as well as the hierarchy level-0, parent, and child stacks. To bring a level-0 widget to the top on the screen, do one of the following:
 
·
Set the value of its STACKING ORDER attribute to 0 with a CONTROL command
                                 or
·
Click on the title bar of the widget
 
After you do this, the other level-0 widgets on the screen will have their STACKING ORDER attributes set to a new value by the widget management software - a value that represents their new order in the hierarchy.
 
The STACKING ORDER attribute value is dynamic, based on what is happening with other widgets on the screen. Therefore, you should not assume each widget's STACKING ORDER value. Always get the value of STACKING ORDER just before you need to use it in your program. New (just created) widgets have a STACKING ORDER of 0 and therefore will appear on top of the previously created widgets.
 
Transient widgets have special implications for the STACKING ORDER attribute. A transient widget cannot be "stacked" under its parent widget. If you attempt to set the STACKING ORDER of a parent of a transient widget to 0, the transient widget's STACKING ORDER will be set to 0 and the parent's STACKINGORDER will be set to 1.
 
However, it is possible for a transient widget's STACKING ORDER value to be more than one number less than its parent's: the level-0 transient widget may be "on top" of the screen (STACKING ORDER = 0), while its parent is covered completely with other level-0 widgets and has a STACKING ORDER of, say, 9.
 
The HTBasic widget management software is in control of each widget's STACKING ORDER at all times, except when you set the STACKING ORDER from your program. The widget management software maintains a hierarchy of widgets. The nature of that hierarchy is:
 
·
There is one and only one widget "on top" on the screen at any one time.  That is, with a STACKING ORDER of 0. There are level-0, parent widgets each of which can contain any number of child widgets
 
·
The widget management software maintains a STACKING ORDER hierarchy for the level-0 windows and a separate STACKING ORDER hierarchy for the child widgets within each level-0 widget.
 
·
If you set the STACKING ORDER of a child widget to zero, but it is visually occluded by another level-0 widget, the child widget will not pop to the top position on the screen. It will pop to the top of its parent widget's hierarchy, but will remain occluded by the level-0 widget.
 
·
The visual appearance of the screen may or may not accurately represent the state of the widget management software's hierarchy.
 
For example, if two level-0 widgets are on the screen and they do not visually overlap, it will appear as if they both have a STACKING ORDER of 0. However, only one of the widgets on the screen can have a STACKING ORDER of 0. If you move the STACKING ORDER-of-1 widget toward the STACKING ORDER-of-0 widget, it will slide "under" thetrue "on top" widget.