Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can code be inherited?
Message
De
25/04/2002 15:16:49
 
 
À
25/04/2002 15:11:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00649179
Message ID:
00649274
Vues:
9
>It would be nice to drag/drop an instance of the control on a form and now modify the behavior using the above 'empty' template.

In my opinion, you should try for something like this:
*** ActiveX Control Event ***
DO CASE
* Handle each event or error.
	* Events
	Case THIS.CommEvent = 1
		* SThreshold # of Characters to Transmit.
		this.OnNumberOfCharactersToTransmit()
	Case THIS.CommEvent = 2
		* RThreshold # of characters Received.
		this.OnCharactersRecieved()
	Case THIS.CommEvent = 3
		* Change in the CTS line.
		this.OnChangeCTS()

	*** ECT ECT

ENDCASE
Everyone of your case statements is handled by a method call which hides the actual implemenation of the ActiveX control. Now, you can add an instance of that class to your form, and isntead of worrying about the CommEvent property or case statements, you can just override the method(s) you want.

Does that make sense?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform