Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help about Keypress event please
Message
De
10/02/2004 16:30:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00875574
Message ID:
00876036
Vues:
13
>:(
>i am explain from the start,
>
>i have a toolbar which is containing first-prior-next-last-new-save-revert-edit-delete-find-print-quit buttons each buttons click events runs _screen.activeform.new() and so on..
>
>i've form which is containing first-prior-next-last-new-save-revert-edit-delete-find-print-quit methods
>also changed_assign method
>*inside code
>LPARAMETERS vNewVal
>otoolbar.cmdsave.enabled = m.vNewVal
>otoolbar.cmdrevert.enabled = m.vNewVal
>otoolbar.cmdnew.enabled = !m.vNewVal
>otoolbar.cmdfirst.enabled = !m.vNewVal
>otoolbar.cmdlast.enabled = !m.vNewVal
>otoolbar.cmdnext.enabled = !m.vNewVal
>otoolbar.cmdprior.enabled = !m.vNewVal
>otoolbar.cmdedit.enabled = !m.vNewVal
>otoolbar.cmddelete.enabled = !m.vNewVal
>otoolbar.cmdfind.enabled = !m.vNewVal
>otoolbar.cmdprint.enabled = !m.vNewVal
>otoolbar.cmdquit.enabled = !m.vNewVal
>
>i've form which is containing addmode,editmode,changed,lcalias
>
>all of controls (textbox,combobox etc.. my own class) interactivechangeevets sends
>_vfp.ActiveForm.changed = .t.
>_vfp.ActiveForm.addmode = .t.
>_vfp.ActiveForm.editmode = .t.
>
>
>save-revert method sends
>thisform.addmode = .f.
>thisform.editmode = .f.
>
>by this way toolbar buttons behaviour as situation
>
>until here all of actions OK
>
>i wantto add keypress actions now ?
>when addmode=.t. or editmode=.t. only should execute save-revert (as my example F3-F5) otherwise
>the others can execute
>
>ohh at end of hope to explain this time :)
>
>how?

That looks like a good design, except for one problem: how is the user supposed to know what F3 does? I mean, without opening the manual.

I suggest you forget about KeyPress. Instead, duplicate the code in the menu, and, for example, assign the shortcut key F3 to "Edit | Revert".
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform