Adams/View uses dialog boxes that contain a variety of interface objects, such as labels, fields, buttons, and more. You can use the MD Adams Dialog-Box Builder to create and modify dialog boxes to better suit your needs and preferences. For example, you can add a new button to a standard dialog box that selects options you commonly use, or create a new dialog box to execute special procedures you run often, including one or more macros.
|
1.
|
On the Tools menu, point to Dialog Box, and then select Create.
|
|
2.
|
On the Dialog Box menu in the Dialog-Box Builder, select New.
|
|
4.
|
In the Name text box, enter a title for your dialog box.
|
Once you create a dialog box, the Dialog-Box Builder changes to modify mode. You can then add a variety of interface objects to the dialog box, as well as customize the layout, appearance, commands, and size of the objects in the dialog box.
|
1.
|
On the Tools menu, point to Dialog Box, and then select Modify.
|
|
1.
|
From the Tools menu in the Dialog-Box Builder, point to Dialog Box, and then select Modify.
|
|
3.
|
From the Dialog Box menu, select Rename.
|
|
1.
|
On the Create menu in the Dialog-Box Builder, select the object you want to add.
|
You can add more standard buttons to your dialog box even after you've created several using the Predefined menu. For example, if you did not place an
Apply button on your dialog box and would like to add one after you created your dialog box, you can do so from the
Predefined menu.
|
•
|
On the Create menu, point to Predefined, and select a predefined object to add.
|
For sample images, see the directory /install_dir/aview/bitmaps where
install_dir is the directory where you installed your Adams products.
|
1.
|
On the Create menu, select Label.
|
|
6.
|
In the Icon File box, enter the path to and name of the image.
|
|
7.
|
From the Justified option buttons, select the alignment for the image.
|
|
•
|
Using the Arrow tools  in the Dialog-Box Builder. The tools move objects to the edges of the dialog box or to the edges of other objects. The tools are located along the top of the Dialog-Box Builder.
|
To move objects using coordinate locations:
|
2.
|
On the Edit menu, select Attributes to load the object’s attributes for that object into the Dialog-Box Builder.
|
|
4.
|
In the Left: and Top: boxes, enter your coordinate values. The lower the value, the closer your object is to the upper left corner of your dialog box or container.
|
|
5.
|
From the Units option buttons, select the type of locations you entered in Step 4. You can define the location of the objects by entering absolute pixel locations ( Absolute) or relative locations ( Relative) as a percentage of the parent object.
|
|
2.
|
Select the Arrow tool indicating the direction in which to move your object.
|
|
2.
|
On the Edit menu, select Attributes to load the object’s attributes for that object into the Dialog-Box Builder window.
|
|
•
|
Height tool  to make objects the same height.
|
|
•
|
Width tool  to make objects the same width.
|
|
1.
|
From the Preferences menu on the Dialog-Box Builder, select Separation.
|
|
2.
|
Enter a value for Horizontal and Vertical Border Width to specify the distance from the object to the dialog box border.
|
|
3.
|
Enter a value for Horizontal and Vertical Separation to specify the distance between other interface objects.
|
In the Dialog-Box Builder, you can restrict the size and position of interface objects by using the Snap Grid option. It works similar to the grid in the modeling window. When you drag an item with the mouse to move or resize it, the mouse position will snap to the nearest grid point.
|
1.
|
On the Preferences menu on the Dialog-Box Builder, select Snap Grid.
|
|
2.
|
Enter values for the Horizontal and Vertical Grid Spacing to set the spacing distance between grid points.
|
|
3.
|
Enter values for the Horizontal and Vertical Grid Offset to set where to begin snap grid points from the top and left borders.
|
To delete interface objects from a dialog box in the Dialog-Box Builder:
|
2.
|
On the Edit menu in the Dialog-Box Builder, select Delete.
|
|
1.
|
From the Attributes option menu, select Help.
|
|
2.
|
In the Tip Text text box, enter the text you want displayed in the Status toolbar (at the bottom of the Adams/View window) when your dialog box is open.
|
|
3.
|
In the Help File text box, enter the complete path and file name of your help file.
|
Most objects have commands that Adams/View executes when the object changes or a user selects it. These commands do the real work of the interface, changing your model or changing the interface as users enter data and make selections.
You use the Adams/View command language to create commands for objects. You can use the Command Navigator to find the commands you need. Once you find the commands, copy the commands from the command window or log file, and paste or type them in to the command text box for the dialog box object.
You can view and edit the commands in an existing dialog box. Some objects have more than one set of commands. Push buttons, for example, have commands for a single-click and additional commands for a double-click. Note that single commands are executed even on double-click. Windows, dialog boxes, and containers also have special sets of commands which are described below.
Before executing the commands, Adams/View performs several types of text substitutions. These substitutions let you include values from interface objects into commands. For example, you can include a value a user has entered in a text box.
|
|
$object_name refers to an interface object whose name is the same as object_name. When Adams/View executes the command, it substitutes the current value of object_name for $object_name. For example, $my_field substitutes the value of the interface object my_field. The following table lists the values for different interface objects:
You can specify other values for Adams/View to substitute. In the toggle button Value attributes, there are fields to set the toggle values. In the Option Menu and Radio Box Value attributes, you can add a substitution value after the text for each choice, separated by a vertical bar "|". The values do not affect the displayed text; they are only used in commands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$_value substitutes the value of the object that contains the command. For example, if the commands are on a button named my_toggle, $_value is the same as $my_toggle. Another example might be if you want to create a toggle button that returns a value of "1" or "0". You would do so with commands like the following:
Wherever possible, you should use $_value instead of the name of the actual object because it is easier to understand and maintain since it does not rely on the name of the object holding the command. If you see $_value in a command, you know immediately that it refers to the value of the interface object. In addition, if you change the name of the object, you do not need to change the commands. You will find this especially helpful for toggle buttons, radio boxes, and option menus, where you almost always want the value of the object in the associated commands.
|
|
|
These substitute the name of the object executing the commands, the object's immediate parent, or the parent dialog box, window, or toolbar. When Adams/View executes the commands, it substitutes the full database name of the appropriate object.
If you use this command and you rename the dialog box, you don't have to change the command. Wherever possible, it's a good idea to make your object names refer to $_self or $_parent rather than literal full names.
|
|
|
The window or dialog-box, and any child of the window or dialog box, can include $_1,... in the commands. When Adams/View executes the commands, it substitutes the current value of the parameter. This allows you to pass information to a window or dialog box as you display it. You might, for example, pass the name of an object to a dialog box. Commands executed by the dialog box or objects in the dialog box can then refer to this object.
|
|
|
The window or dialog-box, and any child of the window or dialog box, can include $_1,... in the commands. When Adams/View executes the commands, it substitutes the current value of the parameter. This allows you to pass information to a window or dialog box as you display it. You might, for example, pass the name of an object to a dialog box. Commands executed by the dialog box or objects in the dialog box can then refer to this object.
|
Back quotes contain a conditional substitution. If any $name or $value substitution inside the quotes is empty, then Adams/View removes the text between the

. $name is empty if the text returned is empty (

) or if the object is disabled or not displayed.
Conditional substitution makes it easier to handle optional or mutually-exclusive parameters in commands. For example, if you use a command such as the following and the user does not supply a value, the command fails:
The same technique handles mutually-exclusive parameters. As long as the parameters are wrapped in 
, and only one option is displayed or enabled at a time, the command only includes the displayed parameter.
Conditional expansion allows for the commands for custom interface objects to ignore parameters in which the user does not enter any value. Back quotes [

parameter=value

] indicate parameters that will be collapsed when the command is executed. This makes the resulting custom interface object easier to use and relieves you from having to handle error checking for empty fields.
The problem with this configuration is that the user must enter all of the fields in the dialog box or the entire command fails. For example, if the user left the Damping Ratio Field blank, its command would fail with the following error:
Conditional expansion is valid for all parameter types in addition to fields that can return no value. Conditional expansion can be included for none, some, or all parameters in a command. In the example above, the beam_name parameter is required by the command, so the single quotes are not included.
Special Commands for Windows, Dialog Boxes, and Containers
Windows, dialog boxes, and containers have special sets of commands: start, execution, and finish commands. Adams/View automatically executes start commands when the object is displayed and automatically executes finish commands when an object is undisplayed. Execution commands are executed by the interface dialog_box/window/container execute command.
Start and finish commands help you initialize settings and put default values into fields when an interface object is displayed. If necessary, finish commands also allow you to clean up when the object is not displayed.
You can display windows and dialog boxes with a list of parameters. These parameters can be used by the interface objects and commands within that interface object. The parameters are passed as quoted text strings into the interface object.
Once the window or dialog box is displayed, it can make use of these parameters in its own commands. These parameters are automatically assigned the special names $_1, $_2, ..., $_n, for each parameter that is passed to it.
This functionality is especially useful for specifying default values for fields or other interface objects in the new window or dialog box. For example, a button labeled
Easy Beam Size has been added to the custom Easy Beam Properties dialog box. The button contains commands that display a new dialog box for further modification of a beam:
interface field set field_name=$_self.f_beam_name str="$_1"
field_name=$_self.f_length &
database_field="$f_beam_name.length"
field_name=$_self.f_area_of_cross_section &
data_base_field="$f_beam_name.area"
field_name=$_self.f_i_marker_name &
database_field="$f_beam_name.i_marker_name"
field_name=$_self.f_j_marker_name &
database_field="$f_beam_name.j_marker_name"
The if statements check to see if the passed parameter "$_1" contains a value. If a value is found, the interface field set command loads with the name passed from the calling interface object (in this case, the name of the beam). The second if statement checks to see if the field was set to a beam name. If so, it gets the current values for the beam and sets the appropriate fields.
|
1.
|
On the Options menu, select Test Box.
|
|
•
|
On the Dialog Box menu on the Dialog-Box Builder, point to Export, and then select Command File.
|
Before you reload your dialog box, note that Adams/View does not allow the command file to create interface objects with the same names as objects that already exist in the database. You must delete or rename to read in the command file.
|
•
|
On the File menu, select Import, and then read in the desired command file.
|
|
1.
|
On the Tools menu, point to Dialog Box, and then select Display.
|
|
•
|
From the Dialog Box menu of the Dialog-Box Builder, select Exit.
|