Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding to a Form's Destroy Event
Message
From
05/01/2005 14:37:25
 
 
To
05/01/2005 13:19:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00973290
Message ID:
00974493
Views:
35
This message has been marked as a message which has helped to the initial question of the thread.
>Right, I could do that, and I just may have to. Of course I could bypass BindEvent completely and accomplish my purpose, but then I have to write specific code in each of my classes, or have those classes subclass a class that does. This isn't so much of an issue with my forms, but if I use other peoples form or classes it is more difficult. I guess my question at this point is if binding to a form's destroy event is either A) impossible, or B) impractical.

You can bind to the Destroy event, but the method have to be executed explicitly.
Then, add a comment to the method:
PUBLIC oform1

ACTIVATE WINDOW "debug output"
oform1=NEWOBJECT("baseForm")
oform1.Show(1)

oform1=NEWOBJECT("subclassBaseForm")
oform1.Show(1)

RELEASE oform1
RELEASE WINDOW "debug output"

DEFINE CLASS subclassBaseForm AS baseForm
  
ENDDEFINE

DEFINE CLASS baseForm AS form

	PROCEDURE _destroydelegate
		DEBUGOUT PROGRAM()
	ENDPROC

	PROCEDURE Destroy
		* this comment is just for allow BindEvents to this Event
	ENDPROC

	PROCEDURE Init
		=BINDEVENT(m.this,"Destroy",m.this,"_destroydelegate",1)
	ENDPROC

ENDDEFINE
Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform