You will use the following tools to design and construct a graphical interface using the IDL GUIBuilder:
The IDL GUIBuilder has its own toolbar in the IDE, which you use to create the widgets for your user interface. The following figure shows the toolbar.
These are the widget types you can create using the IDL GUIBuilder toolbar:
|
Widget
|
Description
|
|---|---|
|
Base
|
Creates a container for a group of widgets within a top-level base container. A top-level base is contained in the IDL GUIBuilder window, and you build your interface in it. Use base widgets within the top-level base to set up the widget hierarchy, layout, and to organize the application. For example, you can use a base widget to group a set of buttons. For information on base properties, see Base Widget Properties.
|
|
Button
|
Creates a push button. The easiest way to allow a user to interact with your application is through a button click. You can have button widgets display labels, menus, or bitmaps. For information on button properties, see Button Widget Properties.
|
|
Radio Button
|
Creates a toggle button that is always grouped within a base container. Use radio buttons to present a set of choices from which the user can pick only one. For information on radio button properties, see Button Widget Properties.
|
|
Checkbox
|
Creates a checkbox, which you can use either as a single toggle button to indicate a particular state is on or off or as a list of choices from which the user can select none to all choices. Checkboxes are created within a base container. For information on checkbox properties, see Button Widget Properties.
|
|
Text
|
Creates a text widget. Use text widgets to get input from users or to display multiple lines of text. For information on text widget properties, see Text Widget Properties.
|
|
Label
|
Creates a label. Use label widgets to identify areas of your application or to label widgets that do not have their own label property. Use labels when you have only a single line of text and you do not want the user to be able to change the text. For information on label widget properties, see Label Widget Properties.
|
|
Horizontal and Vertical Sliders
|
Creates a slider with a horizontal or vertical layout. Use slider widgets to allow the user to control program input, such as adjust the speed of movement for a rotating image. For information on slider properties, see Slider Widget Properties.
|
|
Droplist
|
Creates a droplist widget, which you can use to present a scrollable list of items for the user to select from. The droplist is an effective way to present a lot of choices without using too much interface space. For information on droplist properties, see Droplist Widget Properties.
|
|
Listbox
|
Creates a list widget, which you can use to present a scrollable list of items for the user to select from. For information on listbox properties, see Listbox Widget Properties.
|
|
Draw Area
|
Creates a draw area, which you can use to display graphics in your application. The draw area can display IDL Direct Graphics or IDL Object Graphics, depending on how you set its properties. For information on the draw area properties, see Draw Widget Properties.
|
|
Table
|
Creates a table widget, which you can use to display data in a row and column format. You can allow users to edit the contents of the table. For information on the table widget properties, see Table Widget Properties.
|
|
Tab
|
Creates a tab widget on which different "pages" (base widgets and their children) can be displayed by selecting the appropriate tab. For information on the tab widget properties, see Tab Widget Properties.
|
|
Tree
|
Creates a tree widget, which presents a hierarchical view that can be used to organize a wide variety of data structures and information. For information on the tree widget properties, see Tree Widget Properties.
|
| Note |
All widgets for a user interface must be descendents of a top-level base; in the IDL GUIBuilder window, all widgets must be contained in a top-level base widget. When you open an IDL GUIBuilder window, it contains a top-level base. You can add base widgets to that top-level widget to form a widget hierarchy. The added bases can act as containers for groups of widgets.
To create a widget, do one of the following:
After you add widgets to a top-level base, you can resize, move, and delete them, and you can change their parent base. You can also set properties for each widget. For information on how to operate on widgets, see Widget Operations, and for information on setting properties, see Using the Properties Dialog.
For each widget, you can define attribute and event procedure properties. A widget's attributes define how it will display on the screen and its basic behaviors. The attributes you can set for a selected widget are displayed on the Attributes tab of the Properties dialog. These attributes are initially set to default values.
Event procedures are the predefined set of events a widget can recognize. When you write an application, you decide if and how the widget will respond to each of the possible events. The events that a selected widget recognizes are displayed on the Events tab of the Properties dialog. The event values are initially undefined. Supply event routine names for only those events to which you want the application to respond.
To open the Properties dialog for a widget, do one of the following:
These actions open a Properties dialog similar to the one shown in the following figure.
The status area at the bottom of the Properties dialog contains a description of the currently selected attribute or event. In addition, for each property that maps directly to an IDL keyword, there is a tool-tip that provides the name of the IDL keyword.
To display a tool-tip, place the cursor over the property name. The tool-tips are displayed only for properties that map to IDL keywords.
| Note |
To keep the Properties dialog on top, click the push pin button.
The Properties dialog will close as soon as it loses focus, unless you click the push pin button. If you click the push pin button, the Properties dialog stays on top and updates to reflect the properties of the currently selected widget.
To close the Properties dialog when the push pin is being used, do one of the following:
Any changes you make to values in the Properties dialog are automatic; you will see the results of all visual changes immediately. For example, any changes you make to the alignment or column setting will change the layout position of the widget immediately.
All widgets share a common set of properties, and each widget has its own specific properties. These properties are arranged in the following order on the Attributes tab of the Properties dialog:
On the Events tab of the Properties dialog, the properties are displayed in alphabetical order with common and widget-specific events combined.
For information on the properties you can set for each widget, see Widget Properties.
There are several widget properties that you can set to multiple string values. The attribute's Value field contains a popup edit control in which you can enter multiple strings.
To enter more than one string in the edit control, do one of the following:
These actions move you to the next line. When you have entered the necessary string, press Enter to set the values.
The Widget Browser of the IDL GUIBuilder is a dialog window that presents the current GUI in a tree control. This presents the user with a different view into the GUI they are designing.
To start the Widget Browser, right-click on any component in an IDL GUIBuilder window, then choose Browse from the menu. This opens the Widget Browser, like the one shown in the following figure.
The Widget Browser is helpful when you want to see your widget hierarchy and when you need to operate on overlapping widgets in your interface layout, which can happen when you design an interface to show or hide widgets on specific events. For an example that uses the Widget Browser for this purpose, see Controlling Widget Display.
| Note |
You can expand the widget tree by clicking on the plus sign, or collapse it by clicking on the minus sign.
When you select a widget in the hierarchy by clicking on it, the widget is selected in the IDL GUIBuilder window, and the Properties dialog updates to display the selected widget's properties.
Right-click on a component to display a context menu from which you can cut, copy, paste, or delete the widget. From the context menu, you can also open the Properties dialog and the Menu Editor, when appropriate. To delete a widget from the Widget Browser, use the context menu, or select a widget and press the Delete key.
To change a widget's Name attribute in the Widget Browser, select the widget name with two single clicks on the name. This changes the name into an editable text box in which you can enter the new name. The Name attribute must be unique to the widget hierarchy.
For more information on other ways to operate on widgets, see Widget Operations.
You can add menus to top-level bases or to buttons that have the Type attribute set to Menu. To define menus for your interface, use the Menu Editor, which is shown in the following figure with defined menus. This dialog allows you to define menus, menu items, submenu titles, and submenus, and all their associated event procedures.
For instructions on how to define the menus shown in the following figure, see Defining Menus for the Top-level Base.
To define basic menus, menu items, submenu titles, submenus, and their associated event procedures to top-level bases, follow these general steps:
| Note |
| Note |
| Note |
You can also create buttons that contain menus. To add a menu to a button, follow these basic steps:
| Note |
To view menus on buttons, do one of the following:
Use the Bitmap Editor to create 16 color bitmaps to be displayed on push buttons. The Bitmap Editor can read and write bitmap files (*.bmp). Using the editor, you can create your own bitmaps, or you can open existing bitmap files and modify them.
IDL supplies a set of bitmap files you can use in the buttons of your applications. The files are always available for loading. The bitmaps are located in the following directory:
IDL_DIR\resource\bitmaps
To display a bitmap on a button, follow these steps:
*.bmp file, it is placed on the button.When you complete one of these processes, the filename of the selected bitmap appears in the Bitmap field of the Properties dialog, and the bitmap is displayed on the button.
| Note |
The Bitmap Editor tools allow you to select from the color palette, and then use the Pencil (pixel fill), the Flood fill (fill clear area), or the Eraser (clear or color areas). The Bitmap Editor tools are shown in the following figure.
You can select a color by clicking on it in the color selection tool, or you can select your primary colors, the left-button and right-button colors, and then click on a tool and draw on the bitmap canvas. You can change the primary color selections at any time.
To define a tree widget hierarchy for your interface, use the Tree Editor, shown in the following figure. This dialog allows you to define tree nodes and folders, menus, menu items, submenu titles, and submenus, and all their associated event procedures.
To create a tree hierarchy, do the following: