Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Design Question
Message
From
07/12/2006 04:40:03
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
06/12/2006 09:45:44
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01174970
Message ID:
01175519
Views:
7
Olaf,

Yes, I was just refering to the use of that operator.

Anyway I do not recommend your way.
The first I still stuck with the event-calls-method idea.
The second is that there is no need for this container in container
The third is that Kevin has code caring about the same thing on to many places.

I would define a special method at container level and make this availble to the develpoer using the class.
Then I would hide the Events.
Something like (Just from the scratch, no syntax check)
DEFINE class mycontainer as container
add object MyText as textbox
HIDDEN PROCEDURE Mytext.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.Parent.MyMouseEnter(nButton, nShift, nXCoord, nYCoord,this)
endproc

*do so with additional objects

HIDDEN PROCEDURE MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.MyMouseEnter(nButton, nShift, nXCoord, nYCoord,this)
endproc

PROCEDURE MyMouseEnter
LPARA nButton, nShift, nXCoord, nYCoord,toObject

*here you can do what you like with your object as long as you might access the object from the container
*should be no problem since the object is not hidden or protected itself and all props are available.
endproc
enddefine
So now there is no need to rewrite the MouseEnter Event on any inherited level, anything can be done in Method MyMouseEnter. At least using vcx's the MouseEnters are now hidden to any developer.

Agnes
>>One can always avoid it. I, personaly, think that if it comes to the point to think on :: the base method is overloaded.
>
>Isn't that the problem Kevin has.
>
>He has defined a container with code in MouseEnter event. He binds to that event but needs to run the code as is. If a developer overloads the Container.MouseEnter the Textbox.Mouseenter of the textbox in his container is overloaded too, although that may not be wanted. But not unless he can bind to / call the code on his class level.
>
>Besides that, I'd recommend the control with an inner container and the textbox inside that. Makes one onion skin more, but keeps the developer away from overloading, what shouldn't be overloadable. The programmer using that class can write code to control.mouseenter still the container and textbox.mouseenter run independantly of that.
>
>Bye, Olaf.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform