To start calculation algorithms, execute Fore-based units, open repository object, create a custom button.
To use custom buttons:
Create a calculation algorithm, Fore unit or repository object. The following can be selected as repository object to be opened: dictionary, regular report, data entry form.
Create a custom button.
Apply custom button.
To create custom buttons, use the Add Custom Button dialog box:
The dialog box consists of the Custom Operations area and the button settings area.
To create a button:
Click the Add button in the Custom Operations area to create a new button.
Enter the button name in the Button Name box explaining its functionality. The default button name is Custom Button N, where N is a button order number.
Select the object type in the drop-down list: Calculation Algorithm, Fore Unit or Object Opening.
Load button icon. Click the Load button, select the path to the icon file with the *.png, *.jpg, *.jpeg, *.bmp extension in the dialog box that opens. After loading, the Icon box displays the specified icon. If the icon is not loaded, the Custom Functions ribbon tab will display only button name.
NOTE. To provide a correct icon display of custom buttons, use 32-bit images with transparency.
Select the size of icon displayed on the Custom Operations tab by selecting the radio button in the Icon Size area: small or large. When the large icon is selected, button name will be displayed under the button; when the small icon is selected - next to the button. When several buttons with small icons are added, they are placed in several lines on the ribbon, whereas buttons with large icons are placed one after another, taking the entire ribbon height.
Set preprocessor to output text message with user-defined text on clicking the custom button. To do it, select the Preprocessor checkbox. In the Unit list select a Fore unit, the list contains all units in repository and folders containing units. In the Executable Method/Function Name function select the function, the list contains all functions of the selected unit corresponding to signature:
Function <Function name>(<Report>: IPrxReport): String;
Parameter:
Report. Data entry form is sent to the parameter in the IPrxReport format. On working with this object, all properties and methods of the IPrxReport interface will be available.
Set postprocessor to be able to execute the required operations after:
Object closing.
Method processing finish.
Algorithm calculation finish.
To do it, select the Postprocessor checkbox. In the Unit list select a Fore unit, the list contains all units in repository and folders containing units. In the Executable Method/Function list, select method or function, the list contains all methods/functions of selected unit corresponding to signature:
Sub <Method name>(<Report>: IPrxReport);
Function <Function name>(<Report>: IPrxReport): Type;
Parameter:
Report. Data entry form is sent to parameter in the IPrxReport format. On working with this object, all properties and methods of the IPrxReport interface will be available.
Only one postprocessor can be set.
Select the object, which will be executed on clicking the button in the drop-down list. The list is a tree of repository objects where objects of the selected type and folders containing those objects are displayed. Depending on the selected type, the list name and set of settings will be different:
Calculation Algorithm. Select a calculation algorithm in the Executable Object Selection list. If the selected algorithm has parameters, the area of parameters setup will be displayed below the list:
The setup is the same as setup of parameters for calculation algorithms in table area.
Fore Unit. In the Unit list select a Fore unit, the list contains all units in repository and folders containing units. In the Class Name list select a class, if there is any. In the Executable Method/Function Name list select a method or function. The function must have the required signature:
Public Sub <Function name>(<Report>: IPrxReport);
Begin
…
End Sub <Function name>;
Parameter:
Report. Data entry form is sent to the parameter in the IPrxReport format. On working with this object, all properties and methods of the IPrxReport interface will be available.
If the specified unit does not contain any class, the Class Name list will be hidden.
Object Opening. Select the required object in the Open Repository Object list. On selecting multisheet data entry form as an object to be set for opening, make sure that the Load Only Active Sheet checkbox is selected for it to speed up for opening.
Select the Open in Modal Window checkbox to block work with parent data entry form on opening object. It is available if an object that is set for opening is a data entry form.
Select the Refresh After Window Closing checkbox and select sheets to be refreshed after the object is closed. One, several or all sheets can be selected. The checkbox becomes available after the Open in Modal Window checkbox is selected.
Below is the parameters area and area to set up value sending to the selected parameter. If the selected object has parameters, select the parameter and determine the method of value sending in the Value Setting Method drop-down list:
Do Not Send. Default value. On opening the object, nothing is sent to the parameter.
Form Parameter. The Parameter drop-down list where form parameters are available is displayed. The list of form parameters is filtered by object parameter type. Only one parameter can be selected. On opening an object, the form parameter value is sent to the parameter.
Dimension Attribute. The Attribute drop-down list where all attributes of all dimensions of all form table areas are available is displayed. To display only all attributes of all dimensions, without specifying table areas, deselect the Take Into Account Table Area checkbox. The checkbox is selected by default. Only one attribute can be selected. The Selection type drop-down list is displayed where the following items are available: the first element - the selected attribute of the first dimension element from selection is sent to parameter; all elements - the selected attribute values of all dimension elements from selection are sent to parameter. On opening object, attribute value of the first element or of all elements of the selected dimension from selected area in the table is sent to parameter. If nothing is selected, nothing is sent to parameter.
Manually. The editor corresponding to parameter type is displayed in the Value box. Only one element can be selected. On opening the object, the specified value is sent to the parameter.
To change order of buttons on the Custom Functions ribbon tab, use the / buttons.
To delete buttons, use the the Delete button in the custom operations area.
Created custom buttons are displayed on the Custom Functions ribbon tab. The tab becomes available after the custom button is added.
If a button was set up to execute calculation algorithm, then clicking it starts the calculation. If a button was set up to the Fore unit, then clicking it starts the specified unit. If a button was set up to open repository object, then clicking it opens an object.
If preprocessor was set up for the button, then after clicking the button, the text dialog box opens returned by preprocessor function. The OK and Cancel buttons will be available in the dialog box. To execute action of custom button, click the OK button in the dialog box. To undo custom button action, click the Cancel button in the dialog box.
If preprocessor was set for the button, then after the action of custom button is executed, the actions described in unit specified as post processor will be executed.
See also:
Building Data Entry Form | Working with Ready Data Entry Form