Exiting when click out of a dialog

Exiting when click out of a dialog

Postby Maurilio Viana » Wed Nov 16, 2005 11:43 am

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
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Re: Exiting when click out of a dialog

Postby Enrico Maria Giordano » Wed Nov 16, 2005 1:54 pm

This is a working sample:

Code: Select all  Expand view
#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


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Exiting when click out of a dialog

Postby Maurilio Viana » Thu Nov 17, 2005 12:16 pm

Thanks a lot, Enrico!

Regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests