# 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$); }