To create a master form, execute the following operations:
Create a form with the PluginMasterForm identifier. This form must be inherited from the AdhocUserMasterForm class. Select the form and in the object inspector on the Properties tab set the Parameters: value for the Text property.
Place the Label component with the Label_Caption identifier in the top part of the form. Select this component and in the object inspector on the Properties tab set the Caption value for the Text property.
Add the EditBox component with the EditBox_Caption identifier to the form. Select this component and in the object inspector on the Events tab set the OnChange event. The event handler code is given below. The form must look as follows:
Add a link to the Adhoc system assembly and to the PluginViewForm assembly in the current repository.
Set form code:
Class PluginMasterFormForm: AdhocUserMasterForm
Label_Caption: Label;
EditBox_Caption: EditBox;
ViewForm: PluginViewFormForm;
// Event handling: changing text in EditBox_Caption
Sub EditBox_CaptionOnChange(Sender: Object; Args: IEventArgs);
Begin
ViewForm.SetLabelText(EditBox_Caption.Text);
End Sub EditBox_CaptionOnChange;
// Function of getting a visualizer form
Function GetViewForm: PluginViewFormForm;
Begin
Return ViewForm;
End Function GetViewForm;
{ Procedure of setting visualizer form and
initial value of EditBox_Caption.
Implementation of AdhocUserMasterForm.View}
Protected Sub set_View(Val: Object);
Begin
ViewForm := Val As PluginViewFormForm;
EditBox_Caption.text := GetViewForm.GetLabelText;
End Sub set_View;
End Class PluginMasterFormForm;
See also: