|
Title: | How does the .do attribute work? |
Document: | 915643030 |
Author: | Roland Genske <rhg@marxmeier.com> |
Keywords: | windows,dlg,set,do,gui |
I just had a look at the CANCEL.PROG example program.
With the GUI dlgsrv, it makes use of the .do attribute.
What exactly does this attribute cause?
The GUI dlgsrv uses a message filter in order to eliminate
unwanted events while a dialog is inactive. If this would not
happen, any edittext rule could be triggered unexpectedly,
e.g. if you minimize a dialog to an icon.
Any dialog is considered to be active while a DLG DO statement
is executed. However, e.g. for 'Cancel Dialog' functionality,
this behavior is not wanted. Instead, the dialog should be
activated while the program continues execution.
The .do attributes is very similar to the .visible attribute,
but additionally activates the dialog if it is made visible.
This way, it can process its internal rules.
Please have a look inside the cancel.idm example dialog file:
on CancelDlgBtn select
{
CancelDlg.visible := false;
}
If the button is clicked (selected), the dialog is made
invisible. If the dialog were inactive, this rule would
never be triggered, so CANCEL.PROG uses the .do attribute
in order to activate it. Next, it queries the .visible
attribute during any lengthy operation in order to find out
if the 'Cancel' button has been clicked.
|
|