Scripting Resources for DigitalMicrograph™ |
Example: Create an Interactive Sub-Dialog | |
Function |
Shows how to create a sub-dialog from within a dialog. The sub-dialog is interactive in that button pushes and field changes can cause response to class methods defined for the sub-dialog |
Version |
version: 150304, v1.0 |
Author |
D. R. G. Mitchell |
Acknowledgements |
Based on some nice demonstration code by Shixin Wang on the DMSUG archive |
Comments |
The critical part of getting this to work is to allocate the sub-dialog from within the main dialog class. In other words, the sub-dialog is created before it is needed. In response to a button push in the main dialog, the sub-dialog is then displayed. Button pushes and field changes within the sub-dialog can then illicit responses from methods defined within the sub-dialog's class. There is another example on this site which shows how to create a sub-dialog using the Pose() method. This works fine provided you only wish to capture the settings displayed within the sub-dialog. The method shown here is much more versatile, since it allows the full range of interactions between the user and both dialog and sub-dialog. |
System Requirements |
Should be compatible with all recent versions of DigitalMicrograph. Tested on GMS 2.3 running on XP. |
Known Issues |
- |
Supported |
Yes |
Included Files |
Main script file. |
Source Code |
see attached script file |