Referencing Dialogs
To reference the properties of dialog and the properties of it controls, an object is defined with the dialog name:
iName = 'Dialog1';
aObject = dictionary.findObject(iName);
With a dialog object, the val method takes either 2 or 3 parameters:
val(<control name>,<property name>[,<value>])
- if <control name> is null then get/set a dialog property
- if <value> is specified then SET the property, otherwise (i.e. <value> is not supplied) this is a GET operation
Examples:
- Set the dialog's caption
- aObject.val(null,'caption','Hello World');
- Get the dialog caption
- var cap = aObject.val(null,'caption');
- Set the caption of an individual label control (control1)
- aObject.val('control1','caption',cap);
- Hide a button (control2) on the dialog
- aObject.val('control2','visible',false);
- Set the text colour of an individual Label control (hexadecimal RRGGBB format)
- aObject.val('control1','textcolor','FF0000');
- Move a control to the right (using a variable control name)
- var cName = 'control1';
- aObject.val(cName,'left',aObject.val(cName,'left') + 100);