Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execute codes in classes inherited area
Message
From
01/11/2002 09:51:24
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00717587
Message ID:
00717793
Views:
12
That make sense Nadya. I don't know how I forgot about that (oh yeah it's Friday, isn't it? :O) Thanks for posting this!


>I had to put CLEAR MACROS in the form's Activate and RESTORE MACROS in form's Deactivate and Destroy to be able to use F keys correctly in Data Entry application.
>
>BTW, here is my reply to him in private, see, if you have any objections to my suggestion (since I didn't try it) :)
>
>Hi,
>
>You can do something like:
>
>textbox class keypress method add at the bottom:
>
>if pemstatus(thisform, "CustomKeyPress",5) && Method exists
>    thisform.CustomKeyPress(m.nKeyCode,this.parent)
>endif
>
>In the form class you can add CustomKeyPress method
>
>lparameters nKeyCode, toObject
>* nKeyCode - code of the key pressed
>* toObject - column object reference
>
>** Now you may do your procedures
>
>
>>I just tested your code and it works fine opening another form when the user presses F12. Do you by any chance have any key assignments for F12 in your code using ON KEY LABEL or perhaps an F12 Shortcut on your menu that may be overriding it? I also tested it with a F12 hotkey assignment in my menu and the menu's key assignment ran instead of the code in the keypress event of the textbox in the grid.
>>
>>Tracy
>>
>>>Hi All,
>>>i have a grid class and "GrdAddnew textbox class KeyPressEvent Code" removing standart textbox and adding own at runtime. But after this for eg. i wantto use this code at the new textbox keypressevent
>>>
>>>
>>>  if Nkeycode=134
>>>do form forms\custlist
>>>  endif
>>>
>>>
>>>I've tried but there is no action. why ? what should i do ?
>>>
>>>TIA
>>>
>>>my class codes show below...
>>>
>>>
>>>* Grid InitEvent Code
>>>FOR EACH oColumn IN this.Columns
>>>   WITH oColumn
>>>      .RemoveObject('Text1')
>>>      .NewObject('text1','GrdAddNew','sdbgrid.vcx')
>>>     .CurrentControl='Text1'
>>>     .text1.visible=.t.
>>>     ENDWITH
>>>ENDFOR
>>>
>>>
>>>
>>>* GrdAddnew textbox class KeyPressEvent Code
>>>LOCAL lcAlias
>>>		lcAlias = THIS.PARENT.PARENT.RECORDSOURCE
>>>		DO CASE
>>>			CASE nKeyCode = 24 && '{DNARROW}'
>>>				* 3 Field in an appended record has not been
>>>				* edited or deletion status has not changed for
>>>				* the appended record.
>>>				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
>>>					NODEFAULT
>>>				ENDIF
>>>			CASE nKeyCode = 5 && '{UPARROW}'
>>>				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
>>>					TABLEREVERT(.F., lcAlias)
>>>					THIS.PARENT.PARENT.REFRESH
>>>				ENDIF
>>>		ENDCASE
>>>
>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform