[lazarus] Setting callbacks

Michael A. Hess mhess at miraclec.com
Sun Dec 5 15:18:57 EST 1999


Marc Weustink wrote:
> 
> If this is indeed the point where LCL differs from VCL, I'll introduce
> T(win)Control.AttachEvents and T(win)Control.DetachEvents and that
> would be the place to call SetCallBack

I would like to see them not be called from in the component itself. For
example the TButton.CreateWnd now calls the SetCallBack. I myself don't
like it there because, as you pointed out, it isn't very Delphi like and
some people coming from the Delphi world wouldn't even understand what
it was for. I originally was located in TButton.Create and then moved to
CreateWnd. It was in TButton.Create because it was at that point that
the actual component/widget whatever was created. Things have really
changed since then. We now use the CreateWnd and only create the
component/widget whatever when it is needed. That being the case I would
like to see the SetCallback moved down into the lowerlevel routines that
call the components CreateWnd. As you pointed out they can use the style
setting to determine which events need to have callbacks set. As you
pointed out it doesn't prevent someone from adding a callback that isn't
standard but there isn't any guarentee that it will be honored.

My concern was that your statement was that it should be moved out of
the LCL which I think is a mistake. It should just be at a lower level
in the classes.

I am for this move but think some other things need to be cleaned up
first. Or shall I say get working. I myself haven't been digging around
to much due to lack of time on my part but it has been pointed out to me
that many of the previous controls and components that previous worked
no longer do so. Take TButton for example. This doesn't even show up in
any of the example programs any more. I assume this came about due to
the change to CreateWnd but I hope we can get this working again.

Once we are sure that every thing is working correctly with SetCallBack
were it is then I say move it to a lower control level.

What say thee???

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list