Creating a Master Form

To create a master form, execute the following operations:

  1. 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.

  2. 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.

  3. 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:

  1. Add a link to the Adhoc system assembly and to the PluginViewForm assembly in the current repository.

  2. 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:

Creating a Plugin | AdhocUserMasterForm