On Fri, 02 Dec 2005 16:10:07 +0100
Micha Nelissen <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > On Fri, 02 Dec 2005 14:42:36 +0100
> > Vincent Snijders <[EMAIL PROTECTED]> wrote:
> > 
> >>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).
> > 
> > So winapi needs to capture itself?
> 
> Apparantly, that would be the best.
> 
> >>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.
> > 
> > 
> > Somehow the CaptureControl variable needs to be set when the winapi
> > captures the mouse.
> 
> Why? Is the CaptureControl variable only an optimization, 

No.

> or does it have different meaning from FindLCLControl(GetCapture) ?

Yes. see below.

 
> Why does the LCL capture the mouse so often ? Capturing should be done 
> by users of the LCL, or by the widgetset IMHO, 

Yes.


> but maybe I'm overlooking something.
> 
> > Does the win32 intf know, when winapi has captured? Then maybe it could
> > adjust the variable.
> 
> No, there is no way to know when capturing starts. There is only 
> GetCapture to request what window has the capture, if any.

A TWinControl has TControl childs, which do not have handles, and therefore
are unknown to the widgetset.
Therefore the LCL has the CaptureControl variable, which holds the current
TControl of the current TWinControl.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to