[Lazarus] Detecting when mouse leaves TPanel

Lee Jenkins lee at datatrakpos.com
Tue Apr 8 00:51:30 CEST 2008


Lee Jenkins wrote:
> Hi all,
> 
> As mentioned in a previous post, I created a simple descendant from TPanel for a 
> special button that I need.  When the mousedown event occurs, I change the 
> background color and then change it back on MouseUp event.
> 
> The problem is that if you mousedown on the control and then move the mouse 
> aware from the control and *then* release the mouse, the control doesn't 
> register the mouse up and thus, the control stays colored the "mouse down" color.
> 
> This is not the case when I use the control in Delphi.
> 
> Can someone offer suggestion to resolve this?
> 
> I'm using lazarus 0.9.24/FPC 2.2.0 on Windows, but will need it to work on linux 
> gtk1/2.
> 
> Thanks a bunch.
> 

I have narrowed it down.  The problem seems to be with TLabel.  My component 
consists of a TShape and TLabel sited on a TPanel, which is why I didn't catch it.

Then I thought maybe it had something to do with having the TLabel on the TPanel 
so I placed a TLabel on a form by itself and the problem was replicated.

So it appears that there is a problem with the TLabel and mouse up when the 
cursor is moved off of the label before releasing the mouse button.

I would log this with mantis, but I can never get it to send me my password. 
Yes I have checked my email filters and junk folder ;)

If you care to have it sent to me manually, please email it to

lee (dot) jenkins (at) datatrakpos (dot) com


Thanks,

-- 
Warm Regards,

Lee

"Everything I needed to learn in life, I learned selling encyclopedias door to 
door."



More information about the Lazarus mailing list