When I click in a button I activate a dialog with NoWait clause. Is possible close this dialog if I click out of his area?
For example:
Dialog1 call Dialog2 (dialog2 is nowait), if I click in Dialog1 ou other screen area I want to close Dialog2.
Regards,
Maurilio
Exiting when click out of a dialog
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Exiting when click out of a dialog
This is a working sample:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
@ 1, 1 BUTTON "Dialog2" ACTION DIALOG2( oDlg )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
STATIC FUNCTION DIALOG2( oMainDlg )
LOCAL oDlg
LOCAL oGet, cVar := SPACE( 30 )
LOCAL oBut
DEFINE DIALOG oDlg
oDlg:bLostFocus = { || oBut:Click() }
@ 1, 1 GET oGet VAR cVar OF oDlg
@ 3, 1 BUTTON oBut PROMPT "&Close" ACTION oDlg:End()
ACTIVATE DIALOG oDlg;
CENTER NOMODAL
RETURN NIL
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
Re: Exiting when click out of a dialog
Thanks a lot, Enrico!
Regards,
Maurilio
Regards,
Maurilio