Dialog foi fechada com ESCAPE ou <X> ?

Dialog foi fechada com ESCAPE ou <X> ?

Postby Rossine » Wed Aug 02, 2006 7:58 pm

Olá,

Como faço para saber se a dialog esta sendo encerrada pela tecla ESCAPE ou pelo click no botão <X> da dialog ?

Veja o exemplo abaixo:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg

   ACTIVATE DIALOG oDlg CENTERED VALID SAIDA( oDlg )

return nil

function SAIDA( oDlg )

if getkeystate( VK_ESCAPE )
   msgstop( "Estou encerrando pela tecla ESC !!!" )
endif

if oDlg:isbutonclose()  <<<---- Como testar isto ???
   msgstop( "Estou encerrando pelo click em <X> !!!" )
endif

return .T.

Obrigado,

Rossine.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Antonio Linares » Wed Aug 02, 2006 8:11 pm

Rossine,

Puedes hacerlo así:
Code: Select all  Expand view
function SAIDA( oDlg )

   if getkeystate( VK_ESCAPE )
      msgstop( "Estou encerrando pela tecla ESC !!!" )
   else
      MsgInfo( "cerrado de otra forma" )   
   endif

return .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41940
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests

cron