How to oDlg:End() in GET MEMO by press escape?

How to oDlg:End() in GET MEMO by press escape?

Postby dutch » Sat Mar 22, 2008 11:34 pm

Dear All,

I would like to :End() Dialog with Escape Key in GET MEMO. This code doesn't work. How can I do it?

Code: Select all  Expand view  RUN
  DEFINE DIALOG oDlgs FROM  0, 0 TO 24+200, 390 TITLE 'Test' ;
              PIXEL FONT oFnts

              oDlgs:lHelpIcon := .F.
             
          @  0, 0  GET oGet VAR cPosItem SIZE 195, 102 PIXEL ;
      MEMO OF oDlgs
             
     oGet:bGotFocus  := {|| (oGet:SetPos(0))}      
     oGet:bKeyDown := {||nKey| iif(nKey=VK_ESCAPE, oDlgs:End(), ) }
             
       ACTIVATE DIALOG oDlgs ON INIT (oDlgs:Move( 335,  85 )) NOWAIT RESIZE16

Regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby Natter » Sun Mar 23, 2008 7:59 am

oGet:nDlgCode:= DLGC_WANTALLKEYS
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: How to oDlg:End() in GET MEMO by press escape?

Postby Enrico Maria Giordano » Sun Mar 23, 2008 8:58 am

dutch wrote:Dear All,

I would like to :End() Dialog with Escape Key in GET MEMO.


You don't need any additional code as that's the default behavior. Ie: you don't need of

dutch wrote:
Code: Select all  Expand view  RUN
oGet:bKeyDown := {||nKey| iif(nKey=VK_ESCAPE, oDlgs:End(), ) }


By the way, there is a little typo in the above code:

Code: Select all  Expand view  RUN
{||nKey|


shold be

Code: Select all  Expand view  RUN
{|nKey|


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

Postby dutch » Sun Mar 23, 2008 10:42 am

Thanks Enrico,

I saw it. :oops:

Regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests