>In my master calling program, I activate an OKL with Ctrl+F do smartsrch
>I want it where this can only be called if the user has a grid in the FORM
>e.g
>I have a FORM with a GRID (with clients)
>They may click on Change/View button for the client profile
>When they click this button, Ctrl+F should not be permitted
>i.e. on the profile form, there is no grid
>The solutions offered all bomb out because when the OKL do smartsrch
>activates, there is no FORM, it is PRG
>By the way, this project has 400 scx files

My forms have methods that set up and turn off OKLs by calling an external 
procedure that just sends control right back to the form. It works like this:

Form.Activate()

THISFORM.SetKeys()

Form.SetKeys()

* This turns off whatever OKLs were set up by any other form, so only the 
OKLs associated
* with the currently active form will work.
ON KEY

ON KEY LABEL CTRL+A DO HandleKeys WITH "CTRL+A"

ON KEY LABEL CTRL+Z DO HandleKeys WITH "CTRL+Z"

PROCEDURE HandleKeys
      LPARAMETERS cKey

      LOCAL currentform

      currentform = ""  && Reference name of the Active form

      IF TYPE("oFormMgr") = "O" AND NOT ISNULL(oFormMgr)
           IF TYPE("_SCREEN.ActiveForm") = "O"
                IF PEMSTATUS(_SCREEN.ActiveForm,"HandleHotKeys",5) = .T.
                     currentform = _SCREEN.ActiveForm.ReferenceName

                     oFormMgr.&currentform..HandleHotKeys(cKey)
                ENDIF
           ENDIF
      ENDIF
ENDPROC

Form.HandleHotKeys()

LPARAMETERS cKey

* Do whatever based on contents of cKey

Ken Dibble
www.stic-cil.org


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to