Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Set class's Name change the object's Class property
Message
De
06/12/2007 07:14:33
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
06/12/2007 06:47:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01273530
Message ID:
01273531
Vues:
18
Fabio,

Please this is a feature.
I use this one down the days where we start with the memberclass* stuff. (There must be an old thread of this)

This one allows you to subclass a member like optionbutton but keep the names like Option1, Option2 .. instead of something strange like myopt1 or so.

See example
CLEAR

=CREATEOBJECT("mygroup")
=CREATEOBJECT("mygroup2")

DEFINE CLASS MyOpt	AS OPTIONBUTTON
 NAME = 'MyOpt'
ENDDEFINE &&MyOpt	AS OPTIONBUTTON


DEFINE CLASS MyOpt2	AS OPTIONBUTTON
 NAME	= 'Option'
ENDDEFINE &&MyOpt2	AS OPTIONBUTTON

DEFINE CLASS mygroup AS OPTIONGROUP
 MEMBERCLASS = 'MyOpt'
 MEMBERCLASSLIBRARY = THIS.CLASSLIBRARY

 BUTTONCOUNT = 0

 PROCEDURE INIT
  THIS.BUTTONCOUNT = 2
  ?THIS.CLASS,THIS.OBJECTS(1).NAME
 ENDPROC &&mygroup.init
ENDDEFINE &&mygroup as optiongroup

DEFINE CLASS mygroup2 AS OPTIONGROUP
 MEMBERCLASS = 'MyOpt2'
 MEMBERCLASSLIBRARY = THIS.CLASSLIBRARY

 BUTTONCOUNT = 0

 PROCEDURE INIT
  THIS.BUTTONCOUNT = 2
  ?THIS.CLASS,THIS.OBJECTS(1).NAME
 ENDPROC &&mygroup2.init
ENDDEFINE &&mygroup as optiongroup
Sp you can mimic your member* stuff in existing classes. O.K.?

HTH
Agnes
>Set the Name property into a class definition change it's Class property to the name value.
>
>
>CLEAR
>
>=CREATEOBJECT("ClassName")
>
>DEFINE CLASS ClassName	AS Custom
>	Name	= 'ObjectName'
>
>   PROCEDURE Init
>	? "Class expected <ClassName>, Observed :"	,this.Class
>        * this not set Class
>	this.Name = "AnotherName"
>	? "Class expected <ClassName>, Observed :"	,this.Class
>ENDDEFINE
>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform