PxPlus User Forum

Twitter Twitter Twitter

Author Topic: How to exit a panel with an <Enter> key  (Read 1069 times)

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
How to exit a panel with an <Enter> key
« 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
 
Mike H

koenv

  • Member
  • **
  • Posts: 9
    • View Profile
Re: How to exit a panel with an <Enter> key
« Reply #1 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.

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
Re: How to exit a panel with an <Enter> key
« Reply #2 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
Mike H

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
Re: How to exit a panel with an <Enter> key
« Reply #3 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.
Mike H

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 115
    • View Profile
Re: How to exit a panel with an <Enter> key
« Reply #4 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.