To create a master form, execute the following operations:
Create a form with the PluginMasterForm identifier. This form should inherit 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 at the upper part of the form. Select this component and in the object inspector on the Properties tab set the Title value for the Text property.
Add the EditBox component with the EditBox_Caption identifier on 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 should look as follows:
Add links to the Adhoc and PluginViewForm system assemblies in the current repository.
Set form code:
Class PluginMasterFormForm: AdhocUserMasterForm
Label_Caption: Label;
EditBox_Caption: EditBox;
ViewForm: PluginViewFormForm;
// Handle event: change text in EditBox_Caption
Sub EditBox_CaptionOnChange(Sender: Object; Args: IEventArgs);
Begin
ViewForm.SetLabelText(EditBox_Caption.Text);
End Sub EditBox_CaptionOnChange;
// Function of getting visualizer form
Function GetViewForm: PluginViewFormForm;
Begin
Return ViewForm;
End Function GetViewForm;
{ Procedure of setting visualizer form and
initial value EditBox_Caption.
Implementation 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: