How to exit a panel with an <Enter> key

Started by Mike Hatfield, January 29, 2020, 01:39:09 AM

Previous topic - Next topic

Mike Hatfield

hi Folks,

A really, really dumb question.....
I have a really simple panel. All it does is display an image in the Pre-Display logic
All I want to do is have the panel close when I press the <ENTER> key.
Currently it only closes on <F4>
Normally I'd have an Exit or Close button or <F4> to close the panel.
Never wanted to do this before.

00110 PREDISPLAY_ICNQ_PICTURE:
00120 LET S$=ARG_1$
00130 LET IC_PHOTO=HFN
00140 LET STK_PHOTO$=%PATH_DATA$+"ic_images/"+CVS(S$(1,25),3)+".png"
00150 OPEN (IC_PHOTO,ERR=*NEXT)STK_PHOTO$; GOTO 0170
00160 LET STK_PHOTO$=%PATH_DATA$+"ic_images/noimage.png"
00170 CLOSE (IC_PHOTO)
00180 RETURN

Thanks
Mike H

koenv

Add a 0x0 size button and enable "Default Push Button" on the Attributes tab.

Default Push Button
Defines button as default. Pressing the Enter key will execute the On Change logic for this button. There can only be one default push button per panel.

Mike Hatfield

Thank you.
I added the button and set the default property.
The tab stop shows the button to be the first control so I assume that control is active when I press the <ENTER> key.
I must be still missing something.
How/where do I set the on-change logic?
Thanks
Mike H

Mike Hatfield

I got it.
I had previously added post display logic to close the panel after 10 seconds. I've removed that and the <ENTER> works as expected now.
Thanks again.
Mike H

Peter.Higgins

Mike,
Or a button the size of the panel, in which case a click on the image would do the same as enter.