|
|
|
NOTE: This Design document is subject to change at any time. |
This function allows you to create a new zApp object from within a script. The new object has the class name (tag) of ClassName and object name of ControlName and is created as a child of the Parent object.
For example, if we have a panel called "ButtonPanel" and we want to add a new button to this panel called "Test", we could use the following code:
Code: |
<SCRIPT>
Set Button = core.AddControl("zButton", "Test", "ButtonPanel")
Button.Caption = "Test Button"
</SCRIPT> |
Since AddControl returns an Object, you must use the 'Set' syntax in VBScript. Other scripting languages will vary. The ClassName is the zApp Object class with the 'z' added to the beginning of it. Once AddControl returns the new button object, you can then set it's properties as expected, like the Caption is set in the above example.
The above example would the the same as the following normal zApp code:
Code: |
<PANEL Name="ButtonPanel">
<BUTTON Name="Test" Caption="Test Button"/>
</PANEL> |
which creates the Test button within the ButtonPanel.
Using AddControl you can create a user interface dynamically without having to rely on the ZML user interface file. |
|