DataForm

 

DataForm is simple fixed form dialog to display complex RPG data. (Fore more complex forms you can create an instance of Internet Explorer and use HTML forms). 

You create DataForm object with Overseer.CreateDataForm() call. DataForm has the following properties:

  • title - dialog title

  • header - header field (4 lines)

  • data1 - 2 line field

  • data2 - 2 line field

  • data3 - 2 line field

  • data4 - 2 line field

  • data5 - 3 line field

  • data6 - 3 line field

  • data7 - 3 line field

The bottom area of dialog is an instance of WebBrowser control. You can get interface to instance of this control by using GetHTMLTextDispatch() call. After this call you can use WebBrowser control just like regular instance of Internet Explorer.
For example, if you want to fill the bottom part with HTML text you can use embedded Document object writeln() function.
var dataForm=Overseer.CreateDataForm();
dataForm.GetHTMLTextDispatch().Document.writeln("<br><b>Spell description<b><br>");

Alternatively, instead of writing your own content into the WebBrowser control,  you can can navigate control to open internet URL or file location:
dataForm=Overseer.CreateDataForm();
var dataForm.GetHTMLTextDispatch().Navigate2("http://www.overseer3d.com/");

Display() method displays DataForm object as modeless dialog box. Dialog content is determinated by previously set properties and operations with WebBrowser control. 

Note: You can have as many open DataForms as you want, but any data which is not assigned to global variable will be considered unassigned and will be deleted during next JScript garbage collection sweep. You can use this to your advantage to close DataForm objects from script:

spellForm=Overseer.CreateDataForm(); // Dataform must be assigned to global variable to remain into JScript memory
CollectGarbage(); // Does nothing - dataform is assigned
.... // Some dataform fields init
spellForm.Display(); // Dialog is shown to user
spellForm=null; // Dataform is no longer assigned, but still exist as unassigned object
CollectGarbage(); // Dataform object is deleted and dialog window will be closed



Copyright© 2001 Thought Guild Inc.