Page 1 of 1

Beep exiting dialogs

Posted: Tue Feb 14, 2006 8:35 pm
by Enrico Maria Giordano
Try to close this dialog using ESC and you will hear a beep:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oGet

    LOCAL cVar := SPACE( 30 )

    DEFINE DIALOG oDlg

    @ 1, 1 GET oGet VAR cVar

    @ 3, 1 BUTTON "&Close" ACTION oDlg:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
EMG

Posted: Wed Feb 15, 2006 1:53 am
by James Bott
Enrico,

Is that for the new release? I do not hear a beep using FW2.7, May 2005 build.

James

Posted: Wed Feb 15, 2006 7:49 am
by Enrico Maria Giordano
James Bott wrote:Enrico,

Is that for the new release? I do not hear a beep using FW2.7, May 2005 build.

James
Yes, February build.

EMG

Posted: Wed Feb 15, 2006 12:38 pm
by Antonio Linares
Enrico,

It is something related with the GET because if the button has the focus, then there is no beep. We are searching... :)

Posted: Wed Feb 15, 2006 12:46 pm
by Antonio Linares
Fixed:

Code: Select all

METHOD KeyChar( nKey, nFlags ) CLASS TGet

   local nHi, nLo
   local lAccept
   local bKeyAction := SetKey( nKey )
   local nDefButton

   if nKey == VK_ESCAPE     // new
      return 1                        
   endif                               

   ...

Posted: Wed Feb 15, 2006 12:54 pm
by Enrico Maria Giordano
Thank you!

EMG

Posted: Fri Feb 17, 2006 9:29 pm
by Antonio Linares
Enrico,

This is the right code:

Code: Select all

METHOD KeyChar( nKey, nFlags ) CLASS TGet

   local nHi, nLo
   local lAccept
   local bKeyAction := SetKey( nKey )
   local nDefButton

   if nKey == VK_ESCAPE  // avoids a beep!
      ::oWnd:KeyChar( nKey, nFlags )
      return 1
   endif   

   ...

Posted: Fri Feb 17, 2006 10:34 pm
by Enrico Maria Giordano
Thank you again!

EMG