Question How To Disable Trigger

Greetings Everyone! I have this problem related to my last thread about MENUS, now I have an alternate solution on how to use the F3 on my MENUS by using accelerator, but this leads to another problem. Where I cannot use F3 any more under those MENU:
To be specific and clear this is my sample code:
Code:
DEFINE SUB-Menu maintenance
    MENU-ITEM m_Search        LABEL "Search         " ACCELERATOR "PF3".

DEFINE Menu m_mainMenu MenuBAR DCOLOR 3
    SUB-Menu maintenance  LABEL "  &MAINTENANCE  "
    Menu-ITEM Menu-exit  LABEL "  E&XIT  ".

Menu-ITEM sys_reading:SENSITIVE = YES.
    CURRENT-WINDOW:MenuBAR = Menu m_mainMenu:HANDLE.
    CURRENT-WINDOW:VISIBLE = TRUE.

ON CHOOSE OF MENU-ITEM m_search IN SUB-MENU maintenance DO:
    ASSIGN t_searching = TRUE.
    RUN SearchApps0.

PROCEDURE SearchApps0:
   DEFINE FRAME f_test
   "HELO WORLD!" VIEW-AS TEXT
   BTN_exit WITH CENTERED TITLE "Test".

ON F3,PF3 OF FRAME f_test DO:
      MESSAGE "F3 won't Respond" VIEW-AS ALERT-BOX.
END.

ENABLE ALL WITH FRAME f_test.
WAIT-FOR CHOOSE OF BTN_exit IN FRAME f_test.

END PROCEDURE.

I'm Using Progress 11.3 and running it via PUTTY
My Teacher told me that I must disable the F3 trigger first and enable it to be able to use it, but the problem is, I don't know the syntax, or there are other solution for my problem??
I'm looking forward for your response. Thank you.
 
Last edited:

Osborne

Active Member
I am not sure about the actual request. Is the problem that because you have a menu item accelerator key set to F3 it is only working for the menu and not working anywhere else? If so, then I think this is expected behaviour in that the menu item has priority. To disable/enable at certain times you could try something like this:
Code:
IF vF3Set THEN
   ASSIGN MENU-ITEM m_Search:ACCELERATOR = ""
          vF3Set = NO.
ELSE
   ASSIGN MENU-ITEM m_Search:ACCELERATOR = "F3"
          vF3Set = YES.

ON F3, PF3 OF FRAME f_test ANYWHERE DO:
   IF NOT vF3Set THEN
      APPLY "CHOOSE" TO MENU-ITEM m_Search.
END.
 
I am not sure about the actual request. Is the problem that because you have a menu item accelerator key set to F3 it is only working for the menu and not working anywhere else? If so, then I think this is expected behaviour in that the menu item has priority. To disable/enable at certain times you could try something like this:
Code:
IF vF3Set THEN
   ASSIGN MENU-ITEM m_Search:ACCELERATOR = ""
          vF3Set = NO.
ELSE
   ASSIGN MENU-ITEM m_Search:ACCELERATOR = "F3"
          vF3Set = YES.

ON F3, PF3 OF FRAME f_test ANYWHERE DO:
   IF NOT vF3Set THEN
      APPLY "CHOOSE" TO MENU-ITEM m_Search.
END.

Thank you Master Osborne for your response. I've tried the solution that you gave, but it has an error "m_Search not found. Try IN MENU phrase and check the name. " I use your code on other procedures that I made which where I have to use the F3
function for other purposes.
 

Osborne

Active Member
Just requires the sub-menu reference:
Code:
MENU-ITEM m_Search:ACCELERATOR IN SUB-MENU maintenance = "".

APPLY "CHOOSE" TO MENU-ITEM m_Search IN SUB-MENU maintenance.
 
Top