vfp9
I have a control that is added to a form , in it's INIT() method it issues
BIND.EVENT(this.parent,"Destroy",this,"OnDestroy")
if there is any code at all ( even a single "*" ) in the forms
form.Destroy() method, the control.OnDestroy() delegate is called as
expected
however if the form.Destroy() method is empty the delegate is never called
why does the source object have to override the event in order for bound
events to fire ?
anyone have a generic work around that would not required dummy Destroy()
code to exist ? If I am going to have to add this dummy code I might as
well just call control.OnDestroy() myself.

Gerry

Re: bindevent() requires source event code ? by Eugene

Eugene
Thu Mar 24 18:10:00 CST 2005

gerry wrote:
> vfp9
> I have a control that is added to a form , in it's INIT() method it issues
> BIND.EVENT(this.parent,"Destroy",this,"OnDestroy")
> if there is any code at all ( even a single "*" ) in the forms
> form.Destroy() method, the control.OnDestroy() delegate is called as
> expected
> however if the form.Destroy() method is empty the delegate is never called
> why does the source object have to override the event in order for bound
> events to fire ?
> anyone have a generic work around that would not required dummy Destroy()
> code to exist ? If I am going to have to add this dummy code I might as
> well just call control.OnDestroy() myself.
>
> Gerry
>


Yes, to work around this put some code or comments in your base class
Destroy() method . This is what is in the Destroy() event of all my base
classes.




*=========================================================================
* Library:
* Class:
* Method: Destroy()
* Dependancies:
* Scope: Public
*=========================================================================
* Description: stadard Destroy()
*=========================================================================
* Parameters: none
* Example:
* Returns:
* Comments: If you use BINBDEVENT() to bind an event to the Destroy()
* method it won't execute if there isn't any code to execute in the
* Destroy() event. It will execute however if there are comments here :)
*=========================================================================





Re: bindevent() requires source event code ? by gerry

gerry
Thu Mar 24 18:32:16 CST 2005

Hi Eugene ,
thanks for the confirmation.

this puts a real crimp in the general usefulness of event binding. I mean
its ok if you have intimate foreknowledge of the internal specifics of the
objects you are binding to but for general distribution this is a garbage -
in order to distribute a control that uses this binding , you have to
include instructions to ensure that event methods x,y&z have some type of
code in them - pretty micky mouse.

is this common to all events or just certain events and do you know which
ones ?
do you know if this FEATURE(!!) is documented anywhere ?

Gerry

"Be Careful With That Axe Eugene"


"Eugene Vital" <dontwantany@news.com> wrote in message
news:uP8u87MMFHA.1096@tk2msftngp13.phx.gbl...
> gerry wrote:
> > vfp9
> > I have a control that is added to a form , in it's INIT() method it
issues
> > BIND.EVENT(this.parent,"Destroy",this,"OnDestroy")
> > if there is any code at all ( even a single "*" ) in the forms
> > form.Destroy() method, the control.OnDestroy() delegate is called as
> > expected
> > however if the form.Destroy() method is empty the delegate is never
called
> > why does the source object have to override the event in order for bound
> > events to fire ?
> > anyone have a generic work around that would not required dummy
Destroy()
> > code to exist ? If I am going to have to add this dummy code I might as
> > well just call control.OnDestroy() myself.
> >
> > Gerry
> >
>
>
> Yes, to work around this put some code or comments in your base class
> Destroy() method . This is what is in the Destroy() event of all my base
> classes.
>
>
>
>
> *=========================================================================
> * Library:
> * Class:
> * Method: Destroy()
> * Dependancies:
> * Scope: Public
> *=========================================================================
> * Description: stadard Destroy()
> *=========================================================================
> * Parameters: none
> * Example:
> * Returns:
> * Comments: If you use BINBDEVENT() to bind an event to the Destroy()
> * method it won't execute if there isn't any code to execute in the
> * Destroy() event. It will execute however if there are comments here :)
> *=========================================================================
>
>
>
>



Re: bindevent() requires source event code ? by Eugene

Eugene
Thu Mar 24 19:40:13 CST 2005

gerry wrote:
> Hi Eugene ,
> thanks for the confirmation.
>
> this puts a real crimp in the general usefulness of event binding. I mean
> its ok if you have intimate foreknowledge of the internal specifics of the
> objects you are binding to but for general distribution this is a garbage -
> in order to distribute a control that uses this binding , you have to
> include instructions to ensure that event methods x,y&z have some type of
> code in them - pretty micky mouse.
>
> is this common to all events or just certain events and do you know which
> ones ?
> do you know if this FEATURE(!!) is documented anywhere ?


You mean somewhere other than in my source code repository ??? :-)
I don't think so.......


>
> Gerry
>
> "Be Careful With That Axe Eugene"
>

hhhmmmmm.. nobody was supposed to see that axe........

> "Eugene Vital" <dontwantany@news.com> wrote in message
> news:uP8u87MMFHA.1096@tk2msftngp13.phx.gbl...
>
>>gerry wrote:
>>
>>>vfp9
>>>I have a control that is added to a form , in it's INIT() method it
>
> issues
>
>>>BIND.EVENT(this.parent,"Destroy",this,"OnDestroy")
>>>if there is any code at all ( even a single "*" ) in the forms
>>>form.Destroy() method, the control.OnDestroy() delegate is called as
>>>expected
>>>however if the form.Destroy() method is empty the delegate is never
>
> called
>
>>>why does the source object have to override the event in order for bound
>>>events to fire ?
>>>anyone have a generic work around that would not required dummy
>
> Destroy()
>
>>>code to exist ? If I am going to have to add this dummy code I might as
>>>well just call control.OnDestroy() myself.
>>>
>>>Gerry
>>>
>>
>>
>>Yes, to work around this put some code or comments in your base class
>>Destroy() method . This is what is in the Destroy() event of all my base
>>classes.
>>
>>
>>
>>
>>*=========================================================================
>>* Library:
>>* Class:
>>* Method: Destroy()
>>* Dependancies:
>>* Scope: Public
>>*=========================================================================
>>* Description: stadard Destroy()
>>*=========================================================================
>>* Parameters: none
>>* Example:
>>* Returns:
>>* Comments: If you use BINBDEVENT() to bind an event to the Destroy()
>>* method it won't execute if there isn't any code to execute in the
>>* Destroy() event. It will execute however if there are comments here :)
>>*=========================================================================