Hello!
I am thinking to develope an application as follows:
The forms would be defined in some .xml files using this protocol:
<FORM Name = "MyForm">
<PROPERTY Name="Caption" Value="My application"/>
<PROPERTY Name="../>
...
<EVENT Name="Load">
MsgBox "Hello!"
</EVENT>
<CONTROL License="MSFlexGridLib.MSFlexGrid" ProgId = "MSFlexGridLib.MSFlexGrid" Name="grd1">
<PROPERTY Name="Cols" Value="3"/>
...
<EVENT Name="RowColChange">
...
</EVENT>
</CONTROL>
...
</FORM>
I have a component who reads the .xml file and builds the form using a Visual Basic form, changing the properties of the form using something like the "CallByName" function, and adding the controls defined in the .xml file, using the "Add" method. This component has a "CControl" class that use a VBControlExtender to contain each ActiveX controls of the form.
When an event is raised, the component "looks" if the control who raises the event has some "actions" to do. As you can see in the definition of the form, for each event of each "OBJECT", you can define "what to do" using VBScript code. But I have some questions about this design:
1) How can I parse this VBScript code? I think that it could be better if I write all the VBScript in an independent file, and all the services inside a class / some classes. So, how can I do it?
2) How can I catch the objects of my form from the VBScript code? For exemple, I would like to use the MSFlexGrid control to change then number of Rows when the "RowColChange" event is raised.
3) I make this desing because I want to automate the creation of the interface. My goal is not to compile any code when I change the interface. Does exist another better way to do it?
I hope somebody could help me. Thanks in advance!
I am thinking to develope an application as follows:
The forms would be defined in some .xml files using this protocol:
<FORM Name = "MyForm">
<PROPERTY Name="Caption" Value="My application"/>
<PROPERTY Name="../>
...
<EVENT Name="Load">
MsgBox "Hello!"
</EVENT>
<CONTROL License="MSFlexGridLib.MSFlexGrid" ProgId = "MSFlexGridLib.MSFlexGrid" Name="grd1">
<PROPERTY Name="Cols" Value="3"/>
...
<EVENT Name="RowColChange">
...
</EVENT>
</CONTROL>
...
</FORM>
I have a component who reads the .xml file and builds the form using a Visual Basic form, changing the properties of the form using something like the "CallByName" function, and adding the controls defined in the .xml file, using the "Add" method. This component has a "CControl" class that use a VBControlExtender to contain each ActiveX controls of the form.
When an event is raised, the component "looks" if the control who raises the event has some "actions" to do. As you can see in the definition of the form, for each event of each "OBJECT", you can define "what to do" using VBScript code. But I have some questions about this design:
1) How can I parse this VBScript code? I think that it could be better if I write all the VBScript in an independent file, and all the services inside a class / some classes. So, how can I do it?
2) How can I catch the objects of my form from the VBScript code? For exemple, I would like to use the MSFlexGrid control to change then number of Rows when the "RowColChange" event is raised.
3) I make this desing because I want to automate the creation of the interface. My goal is not to compile any code when I change the interface. Does exist another better way to do it?
I hope somebody could help me. Thanks in advance!