EditForm
EditForm(iControlsSym)
Edit form
iControlsSym | Integer | Sym of string containing controls to be edited |
---|
Applies to: Form
Introduced in KCML version 5.03
EditForm(iControlsSym, iTableDataSym)
Edit form with tables
iControlsSym | Integer | Sym of string containing controls to be edited |
---|---|---|
iTableDataSym | Integer | Sym of array containing table data |
Applies to: Form
Introduced in KCML version 5.03
To allow end-users to modify forms directly and have the layout persist, KCML5.03 added a new Import() method which can be called only within the Create() event to pass a partial form definition to the client in a string variable allowing it to modify the form by adding new controls from the definition. This definition is similar to the ASCII representation of a form normally hidden inside the DEFFORM statement. The string is passed as a SYM() value.
The definition strings are generated by the EditForm(int) method of the form itself which invokes the forms designer in a restricted mode allowing limited control over the forms contents. The programmer must create a shell form to which this method can be applied. It need not contain any controls but any controls predefined for the shell form by the original programmer are not editable by the user of the EditForm() method. Such fixed controls are marked the same way that inherited controls are marked with a red cross in the top left corner as in the following example:
The string returned by Edit() can be saved to disk and recalled when the dynamic form is redisplayed. To pass a new form pass a blank string. To edit an existing form pass the current definition. KCML will redimension the size of the string to hold the new definition automatically.
You must call EditForm() from within the Create() event of the shell form. As this is also where Import() is called this event will have to work in a bimodal way using some external flag.
EditForm() will perform an implied Terminate() on return so the .Open() will return immediately with a value of TRUE if the form was edited successfully or FALSE if there was some problem starting the Forms Designer.
The EditForm() method has been extended to take a second argument to allow a form with data aware controls to be edited. The second SYM() specifies an (n,2) two dimensional array of pairs of table and column names available to populate the Tables window of the forms designer.
See User Editable Forms for more information.