Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ON KEYLABEL DEL DO CLASS??
Message
From
21/10/1997 20:22:00
 
 
To
21/10/1997 20:06:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00055377
Message ID:
00055921
Views:
31
>>>To create an object from a class definition: Look in the Help at
>>CreateObject() and AddObject().
>>>
>>>SET CLASSLIB only tells VFP where to look for class definitions. It
>>doesn't create any object.
>>>
>>>Vlad
>
>In my form class I emulate the behavior of what I've had in FPD, which
>reacted on F3 and F4. In the form class init, I have
>
>on key label f3 _screen.activeform.f3f4(3)
>on key label f4 _screen.activeform.f3f4(4)
>
This works only if you have a form on screen and if that form has an F3F4 method.

In my opinion this shouldn't be in the form's Init, but in the main program/app class Init.

I would do it like that:

PROCEDURE F3F4
PARAMETER lnKeyIndex
IF TYPE("_SCREEN.ActiveForm.Name") = "C" and ;
PEMSTATUS("_SCREEN.ActiveForm", "f3f4", 5)
_SCREEN.ActiveForm.f3f4(lnKeyIndex)
ENDIF
RETURN

And change your ON KEY to:

ON KEY LABEL F3 DO F3F4(3)
ON KEY LABEL F4 DO F3F4(4)

Of course, the F3F4 proc may be a method in your app class.

>Maybe I should move it to form's Activate, and also dismiss in any
>proper place (it gets dismissed in Unload now)... which event fires if
>the form's window is not the active window anymore?

If you do it as I stated above, you don't need to worry about the dismiss of those settings anymore.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform