More scripts: Dialog
Syntax Highlighing:
comments, key words, predefined symbols, class members & methods, functions & classes
### gendlg.sml
### Sample script for "Building Dialogs in SML"
# stub script to open demonstration dialogs generated from
# specifications in XML files.
### Global variable declarations
string xmlfile$, id$;
### call popup dialog allowing the user to select the XML
### file with the demonstration dialog; store full path and filename
### as "xmlfile$" and filename alone as "id$"
xmlfile$= GetInputFileName("","Select dialog specification:","xml");
id$ = FileNameGetName(xmlfile$);
class XMLDOC dlgdoc; # class instance for the XML document
dlgdoc.Read(xmlfile$); # read the XML and parse into memory
class XMLNODE dlgnode; # class instance for the dialog element
# in the XML structure
dlgnode = dlgdoc.GetElementByID(id$); # get the dialog element
# from the XML structure
class GUI_DLG dlgwin; # class instance for dialog window
dlgwin.SetXMLNode(dlgnode); # set the XML dialog element as the
# source for the dialog window
dlgwin.DoModal(); # open as a modal dialog