Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 Tags
Subject: RE: Egg or bird: what's first?
Thread ID: 143433 Message ID: 143439 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Tuesday, August 28, 2007 8:36:23 PM         
   


> >
> > Ilya,
> >
> > Barring any DODEFAULT() the code that you apply in the instance on your form will be performed but your base code will not. Try this.
> >
> > Make a base command button class and add the following to your base command button's .Click()
> >
> > WAIT WINDOW [BaseButton.Click()]
> > 

> > Now, drop an instance of that base button on a new form and run it. It will properly display the message. Now, on the form, go into the ThisForm.BaseButton1.Click() and add the following:
> >
> > WAIT WINDOW [ThisForm.BaseButton1.Click()]
> > 

> > run the form again and you will only get one message - the second one.
> >
> > Add a DODEFAULT() to ThisForm.BaseButton1.Click() before the WAIT WINDOW command and you will get two messages - the base class message first and the form's instance next. Move the DODEFAULT to after the WAIT WINDOW and the order of appearance will be reversed.
> >
> > Ken
> > You shall know the truth - and the truth shall set you free. (John 8:33)
>
> WAW, base class' event procedure is being executed only if the object of subclassed class has no any code in this event procedure?
>
> Got it!
>
> Thanks!
>
> Regards,
>
> Ilya

Correct - and if you add a DODEFAULT() your baseclass code will run, but only when/where you tell it to.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Egg or bird: what's first? Posted by Ilya Rabyy @ 8/28/2007 7:50:35 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 8:22:20 PM
RE: Egg or bird: what's first? Posted by Ilya Rabyy @ 8/28/2007 8:32:37 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 8:36:23 PM
RE: Egg or bird: what's first? Posted by Borislav Borissov @ 8/28/2007 11:42:40 PM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/28/2007 11:46:26 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 11:56:24 PM
RE: Egg or bird: what's first? Posted by Borislav Borissov @ 8/28/2007 11:56:41 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/29/2007 12:03:44 AM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/29/2007 12:07:00 AM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/28/2007 11:31:35 PM