Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PUBLIC SUB ControlCopy(hControl AS OBJECT, Parent AS Container) AS OBJECT
- DIM hNewMe AS OBJECT = Object.New(Object.Type(hControl), [Parent]) 'on génère un objet de la même classe
- DIM s AS STRING
- DIM hclass AS Class = Object.Class(hControl)
- DIM hChild AS OBJECT
- 'On copie les propriétés
- FOR EACH s IN hclass.Symbols
- IF s = "Chlidren" THEN CONTINUE
- IF NOT hclass[s].ReadOnly THEN Object.SetProperty(hNewMe, s, Object.GetProperty(hControl, s))
- NEXT
- 'Bon la en vrai Basic j'aurais du passé par un goto :/
- 'en gros si ce n'est pas un conteneur on quitte et on retourne le nouvel objet
- IF NOT hclass.Symbols.Exist("Children") THEN RETURN hNewMe
- 'On copie les enfants
- FOR EACH hChild IN hControl.Children
- ControlCopy(hChild, hNewMe)
- NEXT
- 'On retourne l'enfant
- RETURN hNewMe
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement