Quattro Pro lets you create custom dialog boxes and controls. When you create a dialog box, you can add controls and then customize their appearance and behavior.
In this section, you'll learn about
creating custom dialog boxes
editing and positioning dialog boxes
adding dialog box controls
assigning properties to dialog box controls
attaching actions to dialog box controls
editing and positioning dialog box controls
working with child controls in dialog boxes
creating Help and tips for controls
using macros to display a dialog box
For more information about working with custom dialog boxes and controls, see "Reference: Working with custom dialog boxes and controls."
Creating custom dialog boxes
You can create custom dialog boxes in Quattro Pro. Dialog boxes are stored on the Objects sheet and saved with the notebook in which they are created.
You can add controls to dialog boxes. When you add a control to a dialog box, it is inactive. For example, list boxes do not contain information and check boxes are not linked to anything. For information about activating controls and buttons, see "Attaching actions to dialog box controls."
Adding labels to dialog box controls lets you identify the purpose of each control. Some controls have a label text property that is used to display a label with the control (for example, buttons).
You can hide controls when they are not relevant.
Whenever a change is made to the dialog box, you can test the dialog box and its controls. For example, you can test a new control after assigning properties or creating links to see if the control behaves in the manner intended. When in Test mode, the dialog box displays as it will in the application. In Test mode, you cannot activate any other windows to display as the active object unless you have configured a control in the dialog box to do so. For example, you can have a second custom dialog box display only when you click a button on the first dialog box.
For more information about controls, see Properties of dialog box controls and Properties of form controls in the reference information section of the Quattro Pro online Help.
To create a custom dialog box
1 Click Tools Macro Dialog designer.
2 Right-click the dialog box background, and click Dialog properties Name.
3 Type a name for the title bar in the Enter text box.
4 Click OK.
5 Right-click the dialog box background, and click Dialog properties Title.
6 Type a title in the Enter text box.
Notes
You cannot save a file when creating a custom dialog box unless you deactivate the dialog designer by clicking the spreadsheet.
Password protection rights can be assigned to dialog boxes. For information about working with passwords, see "Using password protection."
Tip
You can also create a dialog box on the Objects sheet by clicking the Quick tab button at the bottom of the application window, and clicking the Create dialog box button.
To add a control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert, and click a control to add.
4 In the dialog box, drag diagonally to create the control.
5 Right-click the control, and click Connect.
6 Type the cell reference in the Target field.
If you want to immediately send control value changes to a cell or another control, enable the Dynamic connection check box.
Note
For information about the behavior of specific controls, see "Understanding dialog box controls."
Tip
If you want to customize a control, right-click the control, click Properties, and click any option in the submenu that displays.
To add a label to a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Label text.
4 Click where you want to add the label.
If you need more room, drag the control to a new location.
5 Double-click the label.
6 Type the label text.
Tip
You can also add a label to a dialog box by clicking the Label tool on the property bar.
To hide a control on a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Hidden Yes.
You can also
Make a control display grayed Right-click the control, and click Properties Grayed Yes.
Disable a control Right-click the control, and click Properties Disabled Yes.
Note
When the Hidden property is applied, the control still displays in the dialog window while you are editing, but will disappear when you test the dialog box with the Test button.
To test a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click the Test button on the property bar.
4 Test the dialog box.
Editing and positioning dialog boxes
You can edit the properties of dialog box windows, including their size, position, and name. Dialog boxes are created with a default object name (for example, Dialog 1). Macros, link commands, and formulas use this name when referring to a specific dialog box.
A dialog box can be copied to another notebook. You can also disable a dialog box. As well, you can delete a dialog box.
For information about specific dialog box properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
To edit a dialog box window
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click the title bar, click Dialog properties, and click one of the following:
Dimension-lets you specify the size and position of the dialog box window
Title-lets you change the title that displays on the title bar
Position adjust-lets you specify how the dialog box moves when the window is resized
Grid options-lets you display a grid to aid with placing controls
Name-lets you type an object name to which macros, link commands, and formulas can refer
To copy a dialog box to another notebook
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Edit Copy.
4 In the notebook to which you are copying the dialog box, click the Quick tab button at the bottom of the application window to display the Objects sheet.
5 Click Edit Paste.
Tip
You can also copy a dialog box to another notebook by holding down CTRL, selecting the dialog box, and dragging it to the second notebook's Object sheet.
To disable a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click the title bar on the dialog box, and click Dialog properties Disabled Yes.
To delete a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Click a dialog box icon.
3 Press DELETE.
Adding dialog box controls
After you create a default dialog box, you can add any of the following controls to a dialog box.
To specify the action performed when you select a control, right-click the control, and click Connect to connect the control to another control or display its value in a cell, or Links to specify the action to perform.
For more information about control properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
Bitmap buttons
A bitmap button displays a bitmap image on the face of the button. Bitmap buttons can imitate the behavior of all button types (for example, radio buttons).
Push buttons
You can add buttons to dialog boxes that can execute a macro, link to a Web site, or activate another custom dialog box when the button is clicked. Buttons do not have a value; buttons execute an event such as clicking instead of displaying a value that is transferred to a cell on a spreadsheet or to another control.
Check boxes
You can add check boxes to a dialog box. Each check box displays next to a default label.
Color controls
Adding color controls let you choose a color or create a custom color.
Combo boxes
You can add combo boxes, which are a type of list box that lets you add items to a list.
Label controls
You can add a label control to a dialog box. The label control lets you place text on the dialog box as a standalone feature or near a control that does not have a label, such as a rectangle control.
Edit boxes
Adding edit boxes to dialog boxes let you add data. The input data can be characters, numbers, cell addresses, or can make the typed data hidden.
File controls
A file control consists of a box for typing filenames and a browse button that displays a list of files on disk. Adding a file control lets you choose a filename, folder, and drive.
Group boxes
You can add a group box control, which acts as a container for other controls. Group boxes can contain radio buttons, check boxes, or buttons. These controls are considered child controls of the group box. You can use a group box to manage the controls it contains as a single unit. For example, when you move a group box in the dialog box, you also move the contents of the group box.
Scroll bars
Two scroll bar controls can be added to a dialog box: a horizontal scroll bar and a vertical scroll bar. Scroll bars let you scroll through a list of data to make a data selection.
List boxes
You can add a list box to a dialog box to list items which you can choose. The item that you choose becomes the value of the list box.
Radio buttons
Grouped radio buttons present a list of mutually exclusive choices. Only one radio button can be selected. When radio buttons are on a dialog box, the radio buttons are still mutually exclusive. The dialog box acts as a container for the radio button controls. When you want to use more than one set of radio buttons and have each set provide mutually exclusive choices on the same dialog box, place each set within a group box or rectangle.
Rectangle controls
A rectangle control performs the same function as a group box control. You can add a rectangle control to organize controls in a dialog box. Like group boxes, controls added to a rectangle become child controls.
Spin controls
Adding a spin control lets you enter numeric data by clicking arrows to increase or decrease the value of the spin control, or by typing the value.
Tab controls
You can add a tab control to organize settings in a notebook of controls. Clicking a tab displays controls associated with that tab.
Timer controls
You can use a timer control to run link commands at regular intervals or at a specified time. This is useful for creating toolbar controls that periodically retrieve current values from the active window.
To add a bitmap button to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Bitmap button.
4 In the dialog box, drag diagonally to create the control.
5 Right-click the control, and click Properties Bitmap.
6 Choose a file.
Tips
You can add a custom bitmap image by copying a graphic to the clipboard, right-clicking the bitmap button, and selecting Paste.
You can select a button type for the bitmap image to imitate by right-clicking the bitmap button, and clicking Properties Button type.
To add a push button to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Push button.
4 In the dialog box, drag diagonally to create the control.
Note
You can make a push button close the dialog box by selecting OK exit button or Cancel exit button from the Button type choices in the Properties menu.
To add a check box to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Check box.
4 In the dialog box, drag diagonally to create the control.
5 Right-click the control, and click Properties Label text.
6 In the Enter text box, type the label to display.
If you want to display the label to the left of the check box, right-click the check box, and click Properties Draw to right No.
Note
The value of a check box is Yes when it is enabled and No when it is disabled.
To add a color control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Color box.
4 In the dialog box, drag diagonally to create the control.
To add a combo box to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Combo box.
4 In the dialog box, drag diagonally to create the control.
If you want to specify a system list for the combo box, right-click the combo box, click Properties List, and click a list.
You can also
Include cell contents in a combo box Right-click the combo box, click Properties List, double-click the edit box, and select a cell block on the spreadsheet
Paste a block of data into a combo box Select the data from a spreadsheet, click the combo box, and click Edit Paste
To add a label control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Label text.
4 In the dialog box, drag diagonally to create the control.
5 Right-click the control, and click Properties Label text.
6 In the Enter text box, type the label to display.
To add an edit box to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Edit box.
4 In the dialog box, drag diagonally to create the control.
Note
Special characters (such as \n, \t, or \\) can only be allowed in an edit box if the Convert text option is set to Yes.
Tip
If you want to remove the surrounding box, right-click the edit box, and click Properties Show frame No.
To add a file control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert File control.
4 In the dialog box, drag diagonally to create the control.
Note
The value of a file control determines the drive letter, folder, and filename that display. Whenever you view a different folder or use a different filename, the change is reflected in the value of the file control.
To add a group box to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Group box.
4 In the dialog box, drag diagonally to create the control.
5 Click Insert, and click a control to add to the group box.
6 In the group box, drag diagonally to create the control.
Note
When you add a group box, the Process value of a group box is set to yes. The Process value of radio buttons in the group box are set to no.
Tip
You can also add options to a group box by copying a block from the clipboard to the group box. Each row of the block becomes a radio button.
To add a scroll bar to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Scroll bar.
4 In the dialog box, drag diagonally to create the control.
Note
The value of a scroll bar is an integer from a fixed range of integers.
To add a list box to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert List box.
4 In the dialog box, drag diagonally to create the control.
If you want to specify a system list for the list box, right-click the list box, click Properties List, and click a list.
Note
By default, list box entries are sorted alphanumerically in ascending order.
To add a radio button to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Radio button.
4 In the dialog box, drag diagonally to create the control.
If you want to display the label to the left of the radio button, right-click the radio button, and click Properties Draw to right No.
Note
By default, a radio button's Process value property is set to no, and the group box containing it has its Process value property set to yes. When the Process value property of a radio button is set to yes, a radio button has a value of yes when enabled and no when disabled.
Tip
You can also add radio buttons to a dialog box by copying a block of data from the clipboard so that each row of the block becomes a radio button.
To add a rectangle control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Rectangle.
4 In the dialog box, drag diagonally to create the control.
5 Click Insert, and click a control to add to the rectangle control.
6 In the rectangle control, drag diagonally to create the control.
To add a spin control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Spin control.
4 In the dialog box, drag diagonally to create the control.
Note
The value of a spin control is always an integer.
To add a tab control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Tab.
4 In the dialog box, drag diagonally to create the control.
If you want to add another control to the tab control, click Insert, and click a control.
Note
You can rename a tab by double-clicking on its name and typing a new one.
To add a timer control to a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click Insert Timer.
4 In the dialog box, drag diagonally to create the control.
Tip
The timer control can be turned into a clock by right-clicking the control, and clicking Properties Show time Yes.
Assigning properties to dialog box controls
You can identify the Name property of a control. The Name property of a dialog box control is usually the way you reference that object in a macro, link command, or spreadsheet function. This property is accessed for graphic objects, clipart, maps, charts, and OLE objects.
The Selected property indicates numerically which radio button in a group box is chosen, or which item in a list box or combo box is selected. Numbers are sequential (beginning at zero). If the first item is chosen or selected, the Selected property is set to 0. Choosing or selecting the second item sets the Selected property to 1, and so on.
Along with setting the Selected property, you can set the Selection text property. With this property, you can specify the selected text to display in a list box. You see this text selected when the control is activated or when you open the dialog box.
Every dialog box has a default button that closes the dialog box. By default, the OK button in a dialog box performs this function. You can assign another control the same function.
You can assign shortcut keys to both labeled and unlabelled controls. Assigning a shortcut key to a control allows you to run a macro when the control is selected or activated. For more information about using these events, see "Understanding link events."
You can specify areas of a dialog box or control where access is not available.
For more information about specific controls, see "Adding dialog box controls" and "Outline of control-specific properties." For more information about specific properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
To identify the Name property of a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Name.
You can also
Identify the object ID property of a dialog box control Right-click the control, and click Properties Object ID.
Note
For information about changing the name of a dialog box control, see "To rename a control in a dialog box."
To set the Selected property for a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Selected.
4 Type a number in the Enter number box.
This will indicate which item is selected.
To set the Selection text property for a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Selection text.
4 Type text in the Enter text box.
Note
For more information about creating the list used in a list box, see "To add a list box to a dialog box", "To add a spin control to a dialog box", or "To add a file control to a dialog box."
To make a dialog box control the default button
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Default button Yes.
To assign a shortcut key to a labeled dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Double-click a label.
4 Click just before the letter to use.
5 Type &.
6 Press ENTER.
Note
When a control or label control has an attached shortcut, a letter of the label is underlined.
To assign a shortcut key to an unlabelled dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control without a label, and click Properties Name.
4 Click just before the letter to use.
5 Type &.
6 Press ENTER.
Note
If you use more than one ampersand, the first is recognized as a shortcut key designation, and the remaining ones display as text.
To limit access to a dialog box control or dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Depend on.
4 Disable any check boxes corresponding to areas in which you do not want the control available.
Notes
If all options in the Depend on property are checked, the control is always available.
You can also limit access to dialog boxes and controls by using password protection. For information about assigning password protection, see "Using password protection."
Attaching actions to dialog box controls
After you add a control to a dialog box, you must specify what happens when a control executes an action or result. A control can execute when triggered by an action or when triggered by another control's actions. There are two ways to activate a control: by connecting it or by linking it.
You would connect a control to create a static or dynamic connection to a spreadsheet. For example, if you want the list in a list box to display a list of current customers, then a dynamic connection is appropriate, as it reflects the most recent data in the connected column on the spreadsheet. You should link a control to create a more complicated link. For example, you can create a compound link (a link containing several link actions for a control) or a conditional link (a link using an IF condition).
You can connect a control to another control or to a notebook cell. This creates a link command for the selected object.
You can specify actions for a control to perform in the Object link dialog box. You can assign a single link or consecutive links to a control. The links execute in the order they display.
The list types in the Object link dialog box from which to select are:
List Description
Link events Displays the specific event that triggers the link command
Link commands Displays the command (action) that sends a value to another control or notebook cell, runs a macro, or runs another event in response to a triggering event
Link control properties Displays available properties for the control
Object selector list Allows you to specify a control or cell on which to act
Selected object properties Displays properties for the item selected in the Object selector list
You can create conditional links by using the IF-THEN-ELSE link command. An IF-THEN-ELSE link command compares a minimum of two conditions and tests if the results are true. If the conditions are true, the THEN part of the link command occurs. The ELSE portion of the link command occurs if the result is false, so that the second IF link command occurs. For example, you can create a group box with three radio buttons, and link the radio buttons to two edit boxes that display different results depending on which radio button is selected.
You can delete a connected link command.
For examples of how to link dialog box controls, see Examples of linking controls in the reference information section of the Quattro Pro online Help.
For information about the kinds of link events and link commands available, see "Understanding link events" and "Understanding link commands."
To connect a dialog box control to cells or other controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Right-click the control, and click Connect.
5 Type the cell reference in the Target field.
If you want to immediately send control value changes to a cell or another control, enable the Dynamic connection check box.
Notes
The Dynamic connection check box is enabled by default; disable this box if you want to display control value changes to a cell or another control only when you close the dialog box.
You can access the Connect command through the Object link dialog box when you are in Developer mode. For more information about Developer mode, see "Working in Developer mode."
To specify the action performed by a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Right-click the control, and click Links.
5 Click one of the following buttons:
Add-creates a link below the active link
Insert-creates a link above the active link
6 From the Link event list, choose the event that initiates the action.
7 From the Link command list, choose the action to perform.
8 Choose an option from any of the available lists.
Tip
You can assign consecutive link commands for the control by repeating steps 3 through 6 of the above procedure.
To create a conditional object link
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Right-click the control, and click Links.
5 Click Add.
6 From the Link event list, choose the event that initiates the action.
7 Choose If from the Link commands list.
8 Choose an option from any of the available lists.
To delete a connected link command
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Right-click the control, and click Links.
5 Click one of the following:
Delete-deletes the selected link in the Object link dialog box
Delete all-deletes all links displayed in the Object link dialog box
Editing and positioning dialog box controls
Quattro Pro lets you customize the position and appearance of dialog box controls.
Dialog box controls are created with a default object name (for example, Dialog 1). Macros, link commands, and formulas use this name when referring to a specific control. You can rename these controls.
You can move dialog box controls in the same way as you move other floating objects. You can also specify the exact position of controls on a dialog box.
Controls can be copied in the same way as you copy other objects. Each instance of a control has a different object name (Button1, Button2, and so on), to avoid confusion when referring to the control in macros, link commands, and spreadsheet functions.
You can edit the controls in a dialog box. As well, you can align, center, and space multiple controls. For example, when you space controls horizontally, the first control you select displays at the left after repositioning, the next control displays to the right of the first, and so on. When you space controls vertically, the first control you select displays at the top, and so on.
You can change the size of a control in the same way as you resize other objects.
By default, when you press TAB, you can cycle through the controls in the order they were added to the dialog box. However, you can change this tabbing order.
To rename a control in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Name.
4 Type a new name in the Enter text box.
To move a control in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Drag the control to a new location.
Tips
If two or more controls are covering all or part of another control, you can adjust the overlap options so that the controls position separately by right-clicking one of the controls, clicking Object order, and clicking the appropriate selection.
If you want to use a grid to help you position the control, right-click the dialog box title, click Dialog properties Grid options, and enable the Show grid check box.
To specify an exact position for a control in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click the control, and click Properties Dimension.
4 Type a value in the following boxes:
X pos-lets you specify the distance in pixels between the left edge of the control and the left side of the dialog box
Y pos-lets you specify the distance in pixels between the top edge of the control and the bottom edge of the dialog box's title bar
To copy a control in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Click Edit Copy.
5 Click where you want to copy the control.
6 Click Edit Paste.
Note
Copying a parent control copies any child controls attached to it as well.
Tip
You can also copy a control by using the Copy and Paste buttons on the toolbar.
To edit multiple dialog box controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Drag a frame around the controls you want to edit.
4 Edit the selected controls.
Tips
You can also select multiple controls by holding down SHIFT and clicking the controls you want to edit.
You can edit all controls in a dialog box by clicking a control and clicking Edit Select all.
To align multiple dialog box controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click a control, hold down SHIFT, and click additional controls.
4 Right-click one of the controls, click Align, and click one of the following:
Align left-lines up the left sides of the selected controls
Align right-lines up the right sides of the selected controls
Align top-lines up the top edges of the selected controls
Align bottom-lines up the bottom edges of the selected controls
To center multiple dialog box controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click a control, hold down SHIFT, and click additional controls.
4 Right-click one of the controls, click Position, and click one of the following:
Center horizontally-centers controls between the left and right edges of the dialog box
Center vertically-centers controls between the top and bottom edges of the dialog box
To space multiple dialog box controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click a control, hold down SHIFT, and click additional controls.
4 Right-click one of the controls, click Space, and click one of the following:
Horizontal space
Vertical space
5 Type a number in the Space between objects box.
This indicates the pixel distance to space the selected controls.
To resize multiple dialog box controls
1 Click the control whose size you want to apply to other controls.
2 Hold down SHIFT, and click additional controls.
3 Click Format Same size.
To change the tab order for dialog box controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Hold down SHIFT, and select each control in the order you want to move through the controls.
4 Click Format Tab order Set new.
Note
You can also change the order for settings initial values of a control and the order in which they activate. For more information about changing the initial values and order of controls, see "To change the order for setting initial values in a dialog box."
Working with child controls in dialog boxes
When you drag a control on top of another control, they become attached. The top control is the child; the bottom control is its parent. You can attach controls to both group boxes and rectangle controls. When you move a parent control on top of another control, the controls attached to the original parent stay associated with the original parent. For example, you can place a group box of radio buttons on top of a rectangle control and the radio buttons remain children of the group box, not of the rectangle.
You can also add an unattached control to a parent control. This means that the unattached control is not controlled by the parent control. For example, resizing the parent does not affect the unattached control. A control can be unattached from its parent. This allows the control to work independently from the other child controls in the parent control (like a rectangle control or group box).
You can move a child control when the dialog box is resized. When you move a group box, any child controls (for example, radio buttons) move with it. By selecting a relative position for a control, the unlocked edges of a child control move relative to its position in the parent control.
If you change settings, however, you can move a child control with the parent as shown by the arrows below.
For more information about creating group boxes and rectangle controls, see "To add a group box to a dialog box" and "To add a rectangle control to a dialog box." For more information about linking group boxes and rectangle controls, see Examples of linking controls in the reference information section of the Quattro Pro online Help.
To attach a control to group boxes and rectangle controls
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Drag a control onto a rectangle control or group box.
4 Right-click the parent control, and click Properties Attach child Yes.
Notes
For information about adding buttons, radio buttons, or check boxes to group boxes and rectangle controls, see "To add a group box to a dialog box" and "To add a rectangle control to a dialog box."
Child controls must cover only the parent control. Controls partially covering one another will not attach.
To add an unattached control to a parent control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Select a control.
4 Right-click the parent control, and click Properties Attach child No.
5 Click Insert, and click a control.
6 Drag the new control onto the parent control.
7 Right-click the parent control, and click Properties Attach child Yes.
To separate a control from a parent control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Drag the child control onto the dialog box outside of the parent control.
4 Select the parent control.
5 Right-click the parent control, and click Properties Attach child No.
6 Drag the control back onto the parent control.
To move a child control when the dialog box is resized
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Position adjust.
4 In the Position adjust area, enable any of the following options:
Depend on parent-locks each edge of the child control in place so that the child resizes in proportion to the proportions of the resized parent control
Center horizontally-centers the control between the left and right sides of the resized parent control
Center vertically-centers the control between the top and bottom sides of the resized parent control
5 In the Position relative to area, enable any of the following check boxes:
Top-unlocks the top edge of the control
Bottom-unlocks the bottom edge of the control
Left-unlocks the left edge of the control
Right-unlocks the right edge of the control
6 Drag the lower-right corner of the dialog box window to resize the parent control.
Creating Help and tips for controls
You can create your own Help (.hlp) files and use them for custom applications you build with Quattro Pro. This allows you to enter tips and Help files for the controls and the dialog boxes you create.
Application bar hints can be created for a control. For dialog box controls, this property displays the text at the bottom right of the application bar when the cursor hovers over the control.
You can link a Help file to a control. As well, you can link a Help button to a Help file.
To create Help for a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Object Help.
4 In the Object Help title box, type the title to display.
5 In the Object Help text box, type the text to display when you right-click the object in a dialog box.
Notes
For more information about using the Object Help property, see Properties of form controls in the reference information section of the Quattro Pro online Help.
The combined total of all characters in the three Object Help fields cannot exceed 194 characters.
To create an application bar hint for a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Help line.
4 Type the hint in the Enter text box.
To link a Help file to a dialog box control
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Properties Object Help.
4 Type the context string, an @ symbol, and the Help filename in the WinHelp context box.
Note
For the Help to launch the Object Help title and Object Help text boxes must both be empty.
To link a dialog box to a Help file
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click a control, and click Links.
4 Click Add and make the following list selections:
On-On
Link event-Init
Link command-Set
Help topic and filename-HelpContext@HelpFile To
Selected object-Help
Selected object properties-Context
Tip
When creating the link command, if you do not see Help on the object pick list next to where you type in the Help file, click Enter and type Help.
To link a Help button to a Help file
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Right-click the title of the dialog box, and click Links.
4 Click Add and make the following list selections:
On-On
Link event-Init
Link command-Set
Blank-HelpContext@HelpFile To
Object selector-Help
Selected object properties-Context
On-On
Link event-Clicked
Link command-EXECUTE
Object selector-Help
Selected object properties-Context
Tip
When creating the link command, if you do not see Help on the object pick list next to where you type in the Help file, click Enter and type Help.
Using macros to display a dialog box
You can create a macro to display a custom dialog box and set its initial values, using the {DODIALOG} macro command. The most important argument in {DODIALOG} is the third argument, which outlines cells that contain the initial settings of the dialog box controls. Each cell in the block (starting at the upper-left cell and proceeding row by row to the lower-right cell) sets the initial value of one control. If you cancel the dialog box, the values in this block remain unchanged.
Each control stores one setting. You manipulate the control (by clicking a scroll arrow, typing text, and so on) to change that setting. There are several ways to set a control's value:
through initial settings you send (or pass) using a {DODIALOG} command
by changing a setting in the dialog box
using the {SETOBJECTPROPERTY} command.
with link commands from any dialog box control
For example, the following macro command uses the Value property to enter Spanish in an edit box: {SETOBJECTPROPERTY "Dialog1:EditField3.Value","Spanish"}
You can change the order for setting initial values. As well, you can reorder controls.
For additional information, see the reference section "Example of using macros to display a dialog box."
To display a dialog box and set initial values
1 Set up an area in a notebook that will send default settings to the dialog box.
2 Type a {DODIALOG} macro command that displays the dialog box and sends the choices back to the notebook. The {DODIALOG} macro must contain the following arguments:
Argument 1-specifies the name of the notebook that contains the dialog box you want to display and the name of the dialog box. The name of the notebook is optional if the dialog box is stored in the active notebook.
Argument 2-specifies a cell that stores a value indicating how you closed the dialog box. If the dialog box was canceled, 0 is stored in the cell. If the dialog box was closed by pressing ENTER or clicking OK, 1 is stored.
Argument 3-specifies a block that contains initial values for the dialog box controls, and receives final values from the dialog box controls when the dialog box is closed
Argument 4-specifies whether you should manipulate the dialog box (1) or if the macro should manipulate it (0). The default is 1.
Notes
If a control's Process value property is set to No, the control will not receive an initial value. Controls that do not have a Process value property have no initial value.
If you want to make a dialog box dynamic so that changes are immediately reflected in the notebook, add link commands to each control. For information about using link commands, see "Attaching actions to dialog box controls."
To change the order for setting initial values in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click the dialog box background.
None of the controls should be selected.
4 Hold down SHIFT, and click each control in the order in which you want to send initial value settings.
5 Click Format Value order Set new.
To reorder controls in a dialog box
1 Click the Quick tab button at the bottom of the application window to display the Objects sheet.
2 Double-click a dialog box.
3 Click the dialog box background.
None of the controls should be selected.
4 Click Format Value order Reorder from first.
5 Hold down SHIFT, and click each control in the order in which you want to send values.
Reference: Working with custom dialog boxes and controls
Once you have named a dialog box and given it a title, you can add controls to it. Each control is best suited for presenting or receiving a certain type of information. Most controls display a setting and allow you to change the setting.
Link commands perform dynamic actions in response to events. A link command can make a control do different things. For example, it can send a value to a cell in the notebook, send a value to another control, run a macro, close the dialog box, or change the zoom factor in the notebook. One control can have several link commands listed in the Object link dialog box.
The first list in the Object link dialog box (the Link event list) shows the event that you want to trigger the link command. More than one link command in a control can respond to the same event. The order in which the link commands display in the Object link dialog box is the order in which they run.
Understanding dialog box controls
The following table describes the most common controls.
Control Description
Button Performs a specific action when clicked
Check box Provides two choices: Yes when enabled and No when disabled
Radio button Typically used in a mutually exclusive list where only one radio button can be enabled at a time
Group box Contains other controls, such as radio buttons or check boxes
List box Lets you choose data from a list
Combo box Lets you add items to a list box
Label Lets you display text next to a control
Spin control Lets you choose a value by typing or by clicking arrows and selecting a value
Edit box Lets you type text
Vertical scroll bar Lets you select a value from a range of values
Horizontal scroll bar Lets you select a value from a range of values
Bitmap button Lets you display a bitmap image instead of a label on a button, and then imitates the behavior of a check box, radio button, or push button
Rectangle control Embellishes a dialog box, or groups two or more controls
File control Lets you choose a filename and a browse button with access to all available files
Color control Lets you change a color setting
Tab Lets you create tabs on a dialog box
Timer control Lets you add a timer, clock, or alarm to a dialog box
For more information about the functions of controls, see Properties of dialog box controls in the reference information section of the Quattro Pro online Help.
Understanding link commands
The following table shows you the link commands available from the Link command list:
Choose Result
SEND Sends a value or property to a cell in the notebook; another control; or a property in a selection; sheet; notebook; or the Quattro Pro application
RECEIVE Receives a value or property from a cell in the notebook, another control, or a property in a selection, sheet, notebook, or the Quattro Pro application
DOMACRO Plays the macro you specify
EXECUTE Executes another control or another dialog box
SET Sets properties in the dialog box, another dialog box, a cell, a sheet, a notebook, or the Quattro Pro application
TRIGGER Executes or "fires" an action or piece of code when certain events or conditions are met. For example, you might use a trigger event for a button that updates values.
IF Creates conditional statements
The {DODIALOG} macro command brings changed values to the notebook when you close the dialog box. However, if you set up a dynamic link, you do not have to close the dialog box to see the changed values. For more information about using {DODIALOG}, see "Using macros to display a dialog box."
Understanding link events
The following table describes the link events common to all dialog box controls.
Link event Triggers the link command when
Init The dialog box is about to display. Use Init to set initial settings.
Init_Complete You add a link command to the dialog box itself. This event occurs immediately after all controls have run all link commands that respond to Init.
OKExit The dialog box has been closed. The link command runs before the dialog box closes.
CancelExit The dialog box has been canceled. The link command runs before the dialog box closes.
Clicked The control has been clicked..
Right_bdown The control has been right-clicked.
Left_bdown You've pointed to the control and held down the left mouse button. Releasing the button generates a Clicked event.
Doubleclick The control has been double-clicked.
Valuechanged The value of the control has been changed. This event occurs any time the value is changed.
key:keystroke The key keystroke has been pressed. When you choose key from the Link event list, it flashes to indicate that you must press a key. Press the key you want to generate the event. For example, key:Ctrl + F5 indicates that the link command is triggered by pressing CTRL + F5.
Activate The control for manipulation has been chosen. For example, clicking an edit box generates this event so that Valuechanged traps the final result entered in the edit box.
Deactivate Another control has been chosen, leaving this control inactive.
Trigger This event cannot be generated by any action. Use it to connect link commands that are triggered (or executed) by link commands. Use the link command TRIGGER to generate this event.
Some link events that trigger link commands are available only for specific controls. The following table describes link events for edit boxes, scroll bars, combo boxes, and timer controls.
Control Link event and purpose
Edit box Enter-executes when ENTER is pressed.
Scroll bars Lineup-permits you to increase the value of the scroll bar by clicking a scroll arrow
Linedown-permits you to decrease the value of the scroll bar by clicking a scroll arrow
Pageup-permits you to increase the scroll bar's value by clicking between a scroll arrow and the scroll box
Pagedown-permits you to decrease the scroll bar's value by clicking it between a scroll arrow and the scroll box
Thumb-lets you click or drag the scroll bar's scroll box
Combo box Editdynamic-lets you insert or delete characters in the combo box's edit box
Timer control Alarm-executes when the specified time has been reached
Timer-executes when the specified amount of time has elapsed
Outline of control-specific properties
You can assign properties to a control by right-clicking it, and clicking Properties. The commands on the Properties menu listed before Dimension are specific to that control. All the properties from Dimension to the end of the menu are properties you can set for all controls. The procedure for assigning these properties differs from control to control. The following list identifies control-specific properties.
For more information about specific controls, see "Adding dialog box controls."
Bitmap button properties
You can select a bitmap image from the systems list or display a bitmap image you have available from another source by using the Bitmap properties dialog box. You can also assign a bitmap button a behavioral identity from the Button type properties.
Push button properties
A push button can also imitate the behavior of an OK button or a Cancel button, allowing the button to close the dialog box.
Check box properties
You have the option of displaying a check box label to the left of a check box in addition to the default display (which displays the label on the right side.)
Combo box properties
One of the variations possible is to configure the combo box to prevent you from entering a value into the list. By default, combo box entries are sorted alphanumerically in ascending order. A combo box can also be set to display a history as the list of the combo box.
Label control properties
You can use the default font in a label control, or you can change the label font through the Label font properties. You can also change the word wrap features of the label and position of the text on the label.
Edit box properties
The input data can be characters, numbers, cell addresses, or you can make the typed data hidden. When you specify Integer as the field type, the control is renamed to Edit Integer. Default values for Edit Integer are 0 as the minimum value, 32,676 as the maximum value, and 0 as the initial (default) value in the edit box. You can configure the edit box to accept special characters, using the following chart for characters available:
Special character Result
\n Displays the following text on a new line
\t Inserts a tab
\\ Inserts a backslash (\) into the text
You can set an edit box so that you can double-click the edit box, and point to a cell or cell block on a spreadsheet to add the cell references to the edit box.
File control properties
You can display a predefined list in the File list control. When you click the Browse button, the Quattro Pro open file dialog box displays. If the Dialog type property is set to Save, the Quattro Pro save file dialog displays. You can also prevent users from typing in the box.
Group box properties
When a group box contains radio buttons, its value is the title of the radio button chosen. By default, an empty group box does not have a value. A group box has a Value property and a Selected property. The Selected property indicates numerically which of its radio buttons is enabled, starting from the top-left radio button (zero) and proceeding to the bottom-right button.
When you create a group box, the Process value of a group box is set to Yes. The Process value of radio buttons in the group box are set to No.
Scroll bar properties
You can configure a scroll bar by setting parameters and changing the settings.
List box properties
You can use a predefined list or assign data in a cell block as the list in a list box. By default, the list displays with one column, but you can add more columns to a list box. By default, lists display in alphanumeric order.
Radio button properties
You can change the label of a radio button, as well as display the label on either the right (default) or left sides of the radio button.
Rectangle control properties
You can customize the appearance of the rectangle through the Rectangle control properties. The Transparent rectangle style is useful for grouping controls together without displaying the rectangle to which they are attached. The background color and the border color around the rectangle can also be customized.
Spin control properties
You can assign a range of values to a spin control through the spin control properties. You can also change the number of digits allowed to display by adjusting the integer length (the default length is 6).
Tab control properties
Once you add a tab control to a dialog box, you can then create multiple tabs (or pages) to help organize the dialog box controls. The Active page property indicates which tab is active. The Page list property displays commands for creating, removing, and reordering tabs.
Timer control properties
There are two ways to configure a timer control for generating regular events: as a timer or as an alarm.
A timer generates the timer event at regular intervals (for example, every two seconds). A timer control shows the current time. You can also use a timer control to run link commands at regular intervals or at a certain time. You can use timer controls to display the current time in a dialog box or on a toolbar. Timer controls do not have a value.
Two properties of the timer control are used to specify the number of milliseconds to wait between timer events, as shown in the following formula: Wait = Units in Milliseconds X Interval in Units
Units in Milliseconds is set to 1000 by default, so you can use the Interval in units property to specify how many seconds to wait between timer events.
As an alarm, the timer control generates the alarm event at a certain time. The toolbar must be open; for example, an alarm set for 3:00 will not generate an alarm event if the toolbar is not on screen at 3:00.
Example of using macros to display a dialog box
First, set up an area in the notebook that will send default settings to the dialog box. For example, in the following table for a loan payment dialog box, B1..B5 is a block that defines the initial dialog box settings:
A B
1. Pay_Every Month
2. Loan_Amount 100000
3. Int_Rate 12.5
4. Term 30
5. End_Of_Period No
This sets the default payment period to monthly, the default loan amount at 100,000, the default interest rate at 12.5%, the default term at 30 years, and the payment date at the start of the month.
After the initial dialog box settings have been entered in the notebook, you can enter a macro command that will display the dialog box and send the choices back to the notebook. Use the {DODIALOG} command to do this.
Each cell in the block (starting at the upper-left cell and proceeding row by row to the lower-right cell) sets the initial value of one control. If the dialog box is cancelled, the values in this block remain unchanged.
Here is an example of a {DODIALOG} macro command used to display a loan payment dialog box using the initial settings in B1..B5: {DODIALOG LoanData,B6,B1..B5,1}
This command displays the dialog box and sends (or passes) the initial values in cells B1 through B5 to the dialog box controls. If the dialog box is cancelled, it also sends a value of 0 to cell B6 ; otherwise, the value is 1. The final argument of the command specifies that you can manipulate the dialog box.
For example, if a dialog box has six controls, but you have set the Process value property of the third control to No, the setting block should be only five cells long. The values in the first two cells will be passed to the first two controls. However, the value in the third cell will go to the fourth control, and the values in the fourth and fifth cells will go to the fifth and sixth controls, respectively.
Setting the Process value property to Yes lets the {DODIALOG} macro command access the control's value. The Process value property is available for many dialog box controls.
By default, the order in which you created controls is the order that the {DODIALOG} command sets initial values in a dialog box. The first control you created is sent the first value from the {DODIALOG} command, regardless of its position in the dialog box.
You can make this dialog box dynamic by adding link commands to each control so that the changes are immediately reflected in the notebook. For more information about using link commands, see "Attaching actions to dialog box controls."