Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Eventbinding to a property
Message
De
04/02/2016 03:05:40
 
 
À
04/02/2016 02:24:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01630781
Message ID:
01630787
Vues:
55
>Hi,
>
>I do not understand how to
BINDEVENT
to a property so that the delegate gets the value I set to the property.
>Any ideas?
>
>Lutz

Hi Lutz,

Use this way:
* Universal Thread ID: 1630781 - to Lutz
ot = CREATEOBJECT("cl_test")
od = CREATEOBJECT("cl_delegate")
BINDEVENT(ot, "somevalue", od, "get_somevalue_changed")
ot.somevalue = 10
RETURN


DEFINE CLASS cl_test AS Custom
	somevalue = 0
ENDDEFINE

DEFINE CLASS cl_delegate AS Custom
	PROCEDURE get_somevalue_changed
		? "The value have changed"
	ENDPROC
ENDDEFINE
In the case that you want to be notified about not just the change, but the value itself, then you need to use the "assign" event and bind to it, so you can get the "value" passed by parameter.



Best Regards! :)
Fernando D. Bozzo
Madrid / Spain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform