PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Mike Hatfield on January 29, 2020, 01:39:09 AM

Title: How to exit a panel with an <Enter> key
Post by: Mike Hatfield on January 29, 2020, 01:39:09 AM
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
 
Title: Re: How to exit a panel with an <Enter> key
Post by: koenv on January 29, 2020, 03:44:42 AM
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.
Title: Re: How to exit a panel with an <Enter> key
Post by: Mike Hatfield on January 29, 2020, 04:05:22 AM
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
Title: Re: How to exit a panel with an <Enter> key
Post by: Mike Hatfield on January 29, 2020, 04:09:00 AM
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.
Title: Re: How to exit a panel with an <Enter> key
Post by: Peter.Higgins on January 31, 2020, 12:57:20 PM
Mike,
Or a button the size of the panel, in which case a click on the image would do the same as enter.