Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help about Keypress event please
Message
De
09/02/2004 14:27:53
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:
00875581
Vues:
19
I would leave the code just as it is. In each commandbutton's Click() event, you can check whether necessary conditions are satisfied:
if not thisform.addmode or not editmode
  exit
endif
* continue here with the usual actions
>Hi All,
>i am using my own baseforms,toolbars, and my own textbox,grid etc. classes in my applications. my each form has add,edit,delete,find etc.. methods and addmode,editmode property etc.. i am using this methods from toolbar command buttons like _screen.activeform.cmdAdd() command. for eg. mytextbox class sends .t. value to addmode and editmode property when something on te form controls in this situtations only cmdSave and cmdCancel button enabled (normally :) ) .
>in this case what is my problem. i wantto control this actions with functions keys F2,F3... except toolbar buttons. i've code like below
>
>
>*keypress event
>
>Lparameters nKeyCode, nShiftAltCtrl
>
>Do Case
>Case nKeyCode=18 &&pgup
>oToolbar.cmdonceki.click	&&This.onceki()
>Case nKeyCode=3 &&pgdn
>oToolbar.cmdsonraki.click      &&This.sonraki()
>Case nKeyCode=31 &&ctrl+pgup
>oToolbar.cmdilk.click	       &&This.ilk()
>Case nKeyCode=30 &&ctrl+pgdn
>oToolbar.cmdson.click         &&This.son()
>Case nKeyCode=-1 &&f2
>oToolbar.cmdyeni.click	      &&This.yeni()
>Case nKeyCode=-2 &&f3
>oToolbar.cmdkaydet.click	&&This.kaydet()
>Case nKeyCode=-3 &&f4
>oToolbar.cmdduzelt.click	&&This.duzelt()
>Case nKeyCode=-4 && f5
>oToolbar.cmdvazgec.click     &&	This.vazgec()
>Case nKeyCode=-5 && f6
>oToolbar.cmdsil.click	    &&This.sil()
>Case nKeyCode=-7&& f8
>oToolbar.cmdbul.click	     &&This.bul()
>Case nKeyCode=-8 && f9
>oToolbar.cmdyazdir.click	&&This.yazdir()
>Case nKeyCode=-9 && f10
>oToolbar.cmdcik.click	    &&This.cik()
>Case nKeyCode=27           &&esc
>	Thisform.Release
>Endcase
>
>
>it works fine but i wantto when form editmode=.t. or addmode=.t.
>only should work -2 (F3-cmdSave) and -4 (F5-cmdCancel) others not.
>
>i've tried like below code F3,F5 keys running but i cant edit any controls
>
>
>if thisform.addmode=.t. and editmode=.t.
>ON KEY LABEL F3 otoolbar.cmdkaydet.click &&top
>ON KEY LABEL F5 otoolbar.cmdvazgec.click &&top	
>	NODEFAULT
>else
>do case
>.....
>endcase
>endif
>
>
>So how is your suggestions about it ..
>
>TIA
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