[lazarus] Speedbutton questions

Marc Weustink Marc.Weustink at cuperus.nl
Mon Mar 13 04:22:50 EST 2000


+ From: Shane Miller [mailto:SMiller1 at stvgb.org]
+ TSpeedbutton is a TGraphicControl and therefore not a
+ TWinControl.

I thought that TGraphicsControl was derived from TWinControl, I just checked
and it is derived form TCOntrol.

+ If there isn't a gtk widget (or somoething) that is receiving
+ signals how does this control get them?

As far as I can see, at this moment it isn't receiving signals.

+ I see the CM_MOUSEENTER and CM_MOUSELEAVE are "perform"ed
+ via the function UpdateTracking whcih gets called from
+ MOUSEMOVE procedure.  But the MouseMove function will never
+ get called if there isn't a control that can attach a signal
+ to the mousemove signal.  Should we create an eventbox for
+ this widget?  I would prefer not to because then we would
+ have to add a "handle" property or something to TSpeedbutton
+ for storing the widget.
+ I was thinking that the form would get the mousemove and
+ check to see if the mouse was over another control otherthan
+ itself and pass the mousemove to it, but that seems to be a
+ bad way of doing it.

There is some kind of mechanism in TWinControl to handle mouseevents. It
tries to find the control under the mouse.
Look at TWinControl.IsControlMouseMsg and TWinControl.WndProc.

+ For example, I add a Speedbutton to the notebook page[0].
+ When the page gets a signal for mousemove, the mouse could be
+ over the speedbutton because it doesn't get it's own messages
+ so they are being passed to the parent.  The parent would
+ have to check to see if the mouse X,Y coords were over anoth
+ control and call that control's mousemove procedure.
+ To handle the paint would be similiar except the parent would
+ tell all children to repaint.  This is currently handled
+ within gtk but if they don't have a gtkwidget associated with
+ them, then they don't get paint messages either....

Look at the TWinControl.PaintHandler.


More information about the Lazarus mailing list