Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to define a key label per form ?
Message
From
29/06/1999 18:31:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00235469
Message ID:
00235579
Views:
18
>Eric,
>
>Use the form's keypress event to trap your key.


Jim, I'm using the KeyPress event for most of my hot key assignments. I do use an OKL for the F10 key as a global save key. It calls a method in goApp which verifies that the active form has a save method.

I also assign some alt-key values which I don't know how to do in KeyPress.

I don't like menu short-cuts so much because the menu (in VFE) is greyed-out on modal forms.

Do you have a feeling about what I'm doing here? I haven't noticed any problems in practice.

Peter Robinson


Sample code:


** Set ON KEY LABEL actions:
on key label alt+F12 Debug_RS()
on key label F10 goApp.DoSave()
** NOTE: must refer to "goApp" here, not "this"!

on key label alt+leftarrow goApp.GoBack() && Navigator
on key label alt+O goApp.GoHome() && Cockney

on key label alt+Q goApp.QuickPrint()
on key label alt+X goApp.Cancel()



***********************************************************************
* METHOD MassOne.DoSave
***********************************************************************
* Parent(base): VFEapplication (container)
* Purpose.....: Execute the Save button on the active form.
* Created.....: 1999.04.28
* History.....:
**********************************************************************

local llSaveMethod

llSaveMethod = .f.

if type("_Screen.ActiveForm") = "O"
llSaveMethod= pemstatus(_Screen.ActiveForm,"Save",5)
endif

if llSaveMethod
_Screen.ActiveForm.Save()
else
Msg_RS(".")
endif

return .t.
Peter Robinson ** Rodes Design ** Virginia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform