Chapter 11
Corel® PerfectScript Programming Commands
Corel® PerfectScript Programming Commands
Three new macro commands have been added: MacroCompile, MacroIsCompiled, and MacroPlay. See online Help for information about these commands. Also, the following commands have been changed: DialogAddControl, DialogDelete, FileFind, FileNameDialog, GetFileAttributes, MacroInfo, OLEAutomation, and SetFileAttributes. See online Help for information about these commands.
|
DialogAddBitmap |
| Purpose | Add a bitmap control to a dialog box. After DialogLoad or DialogShow, bitmap controls can be added to a dialog created with the Dialog Editor. | ||||||||||||||||||||||||||||||||||||
| Examples |
|
||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. This same value is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddCheckBox |
| Purpose | Add a check box control to a dialog box. After DialogLoad or DialogShow, a check box can be added to a dialog created with the Dialog Editor. | ||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8041 | ||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddColorWheel |
| Purpose |
Add a color wheel control to a dialog box, and return a number that represents the selected color when the dialog is dismissed. After DialogShow or DialogLoad, a color wheel can be added to a dialog created with the Dialog Editor. The color selection consists of three color elements (red, green, and blue), separated into color values by the formula given below (see the MacroVar parameter below). These values are used in Windows programming to specify the color of a pen or brush. |
|||||||||||||||||||||
| Examples | Appendix A: 8043 | |||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. This same value is placed into the MacroDialogResult variable. | |||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||
| Parameters |
|
|
DialogAddComboBox |
| Purpose |
Add a combo box control to a dialog box. After DialogShow or DialogLoad, a combo box can be added to a dialog created with the Dialog Editor. The combo box displays an edit box and a list box. You enter text in the edit box, or double-click a list item to insert it. Use DialogAddListItem to create list box items. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8043 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the item added to the combo box control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddControl |
| Purpose |
Add a custom control to a dialog box. After DialogShow or DialogLoad, a custom control can be added to a dialog created with the Dialog Editor. The macro system knows nothing about custom controls. The user is responsible for all control message processing and queries. |
|||||||||||||||||||||||||||||||||
| Return Value | Name of the control added to the dialog box if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddCounter |
| Purpose |
Add a counter control to a dialog box. After DialogShow or DialogLoad, a counter can be added to a dialog created with the Dialog Editor. Click the counter button to insert a number in the edit box that is within a specified range (see the CountMin and CountMax parameters below). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8043 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. This same value is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddDate |
| Purpose | Add a date to a dialog box. After DialogShow or DialogLoad, a date can be added to a dialog created with the Dialog Editor. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8097 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Date added to the dialog box if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddEditBox |
| Purpose |
Add an edit control to a dialog box. After DialogShow, an edit box can be added to a dialog created with the Dialog Editor. The text entered in the edit box is returned in MacroVar when the dialog is dismissed (see MacroVar parameter). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8046 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddFileNameBox |
| Purpose |
Add a filename edit control to a dialog box. After DialogShow or DialogLoad, a filename box can be added to a dialog created with the Dialog Editor. The filename edit control consists of an edit control and a button control. Clicking the button displays the Select Directory or Select File dialog box depending on the control style (see the Style parameter). |
||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8046 | ||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddFrame |
| Purpose |
Add a frame to a dialog box. After DialogShow or DialogLoad, a frame can be added to a dialog created with the Dialog Editor. You can combine frame styles by creating two frames the same size and at the same position. For example, you can create a black frame and a white-filled frame (see the Control and Style parameters). You can also create custom controls by combining frames and QuickSpots (see DialogAddHotSpot and DialogShow). |
||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8047 | ||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddGroupBox |
| Purpose |
Draw a rectangle around related dialog controls such as buttons. After DialogShow or DialogLoad, a group box can be added to a dialog created with the Dialog Editor. Grouping related controls helps narrow user options. |
|||||||||||||||||||||
| Examples | Appendix A: 8048 | |||||||||||||||||||||
| Return Value |
Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. |
|||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||
| Parameters |
|
|
DialogAddHLine |
| Purpose |
Add a horizontal line to a dialog box. After DialogShow or DialogLoad, a horizontal line can be added to a dialog created with the Dialog Editor. |
|||||||||||||||
| Examples | Appendix A: 8048 | |||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||
| Syntax |
|
|||||||||||||||
| Parameters |
|
|
DialogAddHotSpot |
| Purpose |
Create an invisible area (QuickSpot) in a dialog box that closes the dialog box when clicked. After DialogShow or DialogLoad, a QuickSpot can be added to a dialog created with the Dialog Editor. Other responses are possible when you use DialogAddHotSpot with a callback function (see DialogShow). To create a QuickSpot within a frame (see DialogAddFrame), overlap size and position parameters. |
|||||||||||||||||||||||||||
| Examples | Appendix A: 8045 | |||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddIcon |
| Purpose | Add an icon to a dialog box. After DialogShow or DialogLoad, an icon can be added to a dialog created with the Dialog Editor. | ||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||
| Parameters |
|
|
DialogAddListBox |
| Purpose |
Add a list box control to a dialog box. After DialogShow or DialogLoad, a list box can be added to a dialog created with the Dialog Editor. The item you choose is returned in MacroVar (see the MacroVar parameter). Use DialogAddListItem to create list box items. |
||||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddListItem |
| Purpose | Creates a list item(s) for DialogAddComboBox and DialogAddListBox. After DialogShow, a list item(s) can be added to a list box in a dialog created with the Dialog Editor. | |||||||||
| Examples | Appendix A: 8049 | |||||||||
| Return Value | Index (position) where the item was added to the list if successful, or -1 if not. The same result is placed into the MacroDialogResult variable. | |||||||||
| Syntax |
|
|||||||||
| Parameters |
|
|
DialogAddProgress |
| Purpose | Add a progress indicator to a dialog box. After DialogShow or DialogLoad, a progress indicator control can be added to a dialog created with the Dialog Editor. See RegionSetProgressPercent. | ||||||||||||||||||
| Examples | Appendix A: 8098 | ||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||
| Syntax |
|
||||||||||||||||||
| Parameters |
|
|
DialogAddPushButton |
| Purpose |
Add a push button to a dialog box. After DialogShow or DialogLoad, a push button can be added to a dialog created with the Dialog Editor. When you choose a user-defined push button or QuickSpot, the Control parameter value of the button or QuickSpot is returned in the implicit variable MacroDialogResult (see DialogDefine). Other controls return the following Control parameter values: 1 for OK, 2 for Cancel, 2 for Close (system menu box), 2 if you double-click the system menu box, 2 if you press Alt+F4 or Esc. |
|||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8048 | |||||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddRadioButton |
| Purpose |
Add a radio button to a dialog box. After DialogShow or DialogLoad, a radio button can be added to a dialog created with the Dialog Editor. Radio buttons represent mutually exclusive choices. Selecting one radio button deselects another. Group them together by a control such as a group box or horizontal or vertical line. For multiple selections, see DialogAddCheckBox. |
||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8048 | ||||||||||||||||||||||||||||||||||||
| Return Value | Name of the control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | ||||||||||||||||||||||||||||||||||||
| Syntax |
|
||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddScrollBar |
| Purpose |
Adds a horizontal or vertical scroll bar to a dialog box. After DialogShow or DialogLoad, a scroll bar can be added to a dialog created with the Dialog Editor. A callback function (see DialogShow) can receive Windows WM_HSCROLL and WM_VSCROLL messages from DialogAddScrollBar. For more information, refer to your Windows documentation. |
|||||||||||||||||||||||||||||||||||||||||||||||
| Examples | Appendix A: 8050 | |||||||||||||||||||||||||||||||||||||||||||||||
| Return Value | Name that identifies the scroll bar control if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DialogAddText |
| Purpose | Display a line of text in a dialog box. After DialogShow or DialogLoad, text can be added to a dialog created with the Dialog Editor. | |
| Examples | Appendix A: 8041 | |
| Return Value | Text added to the dialog box if successful, an empty string ("") if not. The same result is placed into the MacroDialogResult variable. | |
| Syntax |
|