Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding code to method at runtime
Message
De
12/01/2005 17:21:13
 
 
À
12/01/2005 14:45:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00976183
Message ID:
00976593
Vues:
10
>The code will be in the click method of a header object. The code is hardcoded it doesn't come from anywhere in particular. The adding of this code will be done probably when initializing the form.
>
>thanks

Not clean.

If you want add code ( codeToAdd ) to a method ( codeWhereAdd ):
codeWhereAdd = Header.Click
codetoAdd = ????

However, the generic solution is this:
Add a CodeHook property to the Header class.
within the Click write:
* Header Click
*** pre code
....
....
this.ClickHook = .T.
*** post code
....
....
on the program use this:
BINDEVENT(headerRef,"ClickHook",codeToAddObject,"codeToAddMethod")
If this.ClickHook = .T. is at begginnig or at the end of Header.Click
you can skip it and to use:
BINDEVENT(headerRef,"Click",codeToAddObject,"codeToAddMethod")   && execute codeToAddMethod before to header.click
BINDEVENT(headerRef,"Click",codeToAddObject,"codeToAddMethod",1) && execute header.click before to codeToAddMethod 
Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform