Hi,
Can someone suggest a way to trap F2 or any other character
on option or char events?
Thanks in advance,
Roman
Roman,
You do this by creating a menu on the form and assign the accelerator key as F2. By default the accelerator key is Alt-DownArrow. You can simply change the accelerator key or add a new menu item and copy the QuickEvent logic from the original.
Keep in mind, however, that F2 is the default key for putting edittable cells into editmode. This will prevent your OPTIONS feature from working as expected. You can also change this key stroke but it takes a little programming. If you are interested let me know and I will find a link or copy the code in a response.
Don,
I should`ve been more specific with my original question.
There are four edilines with a DIFFERENT popup for each of them.
There`s also an Option menu with F2 as a hotkey. I need to envoke an appropriate popup with F2. Here is my code in Edit.Option menu:
BEGIN CASE
CASE CtrlEntID=MODIFIER"val=Popup(@WINDOW,'','Popup_CPT_MODS')CASE CtrlEntID=PROC_TYPE"val=Popup(@WINDOW,'','Popup_PROC_TYPES')CASE OTHERWISE$val=MSG(@WINDOW,'There are no option for this field')END CASE
Obviously,CtrlEntID doesn`t return an editline name so I decided to detect F2 character in each editline separately.
Roman,
Well you could always get the FOCUS property of the active window and then apply your case logic. However, the general method for assigning different popups for each control is to associate your popup calls with the OPTIONS event for each control and then have the menu send an OPTIONS event to that control.
Don,
Thank you very much for your help.
Focus property worked fine.
Best regards,
Roman