Mattias Gaertner wrote:
On Fri, 02 Dec 2005 13:03:07 +0100
Vincent Snijders <[EMAIL PROTECTED]> wrote:
Mattias Gaertner wrote:
When implementing the Mouse events for the TGraphicControl descendents I
came across a problem that I would really like to know the answer to.
When the parent of my GraphicControl is TForm or TPanel the MouseDown
event fires as expected - both left and right buttons produce an event.
However, when the GraphicControl's parent is a simple TCustomControl
only the _right_ button works. This seems to apply with all
TGraphicControl descendents, eg TLabel, but TCustomControl descendents
work normally, eg TButton. But ... if I add the line
p.FCompStyle:= csPanel; to the basic TCustomControl, then it works as
expected.
Can anyone say why this default behaviour occurs and whether it is
intentional or an undiscovered bug?
undiscovered bug
Fixed.
I think I am working on a similar issue. What did you do to fix it? I
couldn't find it in the SVN diffs.
The commit took some time.
The problem in the gtk intf is, that for various reasons it must capture on
MouseDown. But the gtk intf captured for the TWinControl.Handle and did not
set the lcl internal CaptureControl variable.
Now it uses a LCL function for capturing and this sets the internal
CaptureControl variable.
On windows it is not working yet. I cannot figure out how to make the
LCL and windows itself work together in managing the capturing.
How are they supposed to work together?
Let me explain a bit more of my dilemma.
Windows sets the Capture in its default handling of wm_lbuttondown and
releases it wm_lbuttonup.
The LCL is doing the same, if a Control has the csMouseCapture Control
Style, which most controls actually have, because it is set in
TControl's default.
Now, if I let the LCL handle the messages first, the capture is lost
when windows handles wm_lbuttonup, which results in some events not
firing (e.g. TButton Click, which is triggered by a WM_COMMAND,
BN_CLICKED combination).
If I let windows handle the message first, the LCL doesn't pass the
message to the TCustomControl in IsControlMouseMsg, because the LCL asks
the interface if any control as the capture and it turns out the
(wincontrol) parent of the TCustomControl has the capture.
Vincent.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives