Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CREATEOBJECT vs DO FORM.. NAME..
Message
 
 
À
14/04/2007 21:09:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01215967
Message ID:
01216003
Vues:
17
>IIRC, that is more or less the way the Visual Extend framework handles it - an array of forms, in the global applicatoin object. Of course, being a good framework, this is done so far in the background, and so transparently, that I usually don't have to check how it's done.
>
>>You can have an array property in your form manager class and have this array property hold a reference to each open form. When you done with the form, you should set this array element to NULL.
>>
>>That's an idea, I need to check on Monday at work how do I manage this problem in my form's manager class.


Maybe something like this:
PROCEDURE Init
	This.AddToFormsCollection
ENDPROC 
PROCEDURE Destroy
	This.RemoveFromFormsCollection
ENDPROC 
*
** Add to Forms Collection (inorder to stay alive)
*
PROCEDURE AddToFormsCollection
IF TYPE("_screen.FormsCollection") = 'O'
	_screen.FormsCollection.Add(THIS)
ENDIF 
ENDPROC 
*
** Remove from Forms Collection (inorder to be allowed to die)
*
PROCEDURE RemoveFromFormsCollection
LOCAL lIndex
	FOR lIndex = 1 TO _Screen.FormsCollection.Count
		IF _Screen.FormsCollection.Item(lIndex) = THIS
			_Screen.FormsCollection.Remove(lIndex)
			EXIT 
		ENDIF 
	ENDFOR 
ENDPROC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform