|
TNTmips Downloads Menu

|
radiogroup.sml
See other examples
and scripts with XML...
# radiogroup.sml
# creates sample dialog with radiogroup of three buttons
# using an XML dialog specification. The radiogroup value
# is printed to the console as an example of how to get
# control settings from the dialog.
# Declarations
string xml$;
numeric err, ret;
clear();
# XML string containing the dialog specification
xml$='
';
### parse XML text into memory; returns an error code (number < 0 ) if there are syntax errors
class XMLDOC dlgdoc;
err = dlgdoc.Parse(xml$);
if (err < 0) {
PopupError(err); # Popup an error dialog. "Details" button shows syntax errors.
Exit();
}
# get the dialog element from the parsed XML document and
# show error message if the dialog element can't be found
class XMLNODE dlgnode;
dlgnode = dlgdoc.GetElementByID("select");
if (dlgnode == 0) {
PopupMessage("Could not find dialog node in XML document");
Exit();
}
# Set the XML dialog element as the source for the GUI_DLG class instance
# we are using for the dialog window.
class GUI_DLG dlgwin;
dlgwin.SetXMLNode(dlgnode);
ret = dlgwin.DoModal();
proc OnOK () {
class GUI_FORM_RADIOGROUP radio;
local string value$;
radio = dlgwin.GetCtrlByID("processgp");
value$ = radio.GetSelected();
if ( value$ == "entire" ) then PopupMessage("You selected 'Entire Scene'");
else if ( value$ == "polygon" ) then PopupMessage("You selected 'AOI Polygon'");
else if ( value$ == "manual" ) then PopupMessage("You selected 'Manual Selection'");
printf("\nRadio Value = %s", value$);
}
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
| |