Page 1 of 1

Beep exiting dialogs

PostPosted: 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  Expand view
#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

PostPosted: 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

PostPosted: 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

PostPosted: 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... :)

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

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

   ...

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

EMG

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

This is the right code:
Code: Select all  Expand view
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   

   ...

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

EMG