Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CREATEOBJECT vs DO FORM.. NAME..
Message
From
15/04/2007 01:12:18
 
 
To
14/04/2007 21:09:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01215967
Message ID:
01216003
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform