Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread how to fire onmouseenter in tpanel
Sun, May 5 2013 6:31 PMPermanent Link

Stephen Barker

Hi,

I can't get the mouse events onMouseEnter and OnMouseLeave to fire on a TPanel, whereas MouseDown and Up work ok.

Create a new project. Drop a TPanel. Add the following events:

procedure TForm1.Panel1MouseEnter(Sender: TObject);
begin
 Panel1.Height := Panel1.Height + 100;
 Panel1.Width := Panel1.Width + 50;
end;

procedure TForm1.Panel1MouseLeave(Sender: TObject);
begin
 Panel1.Height := Panel1.Height - 100;
 Panel1.Width := Panel1.Width - 50;
end;

procedure TForm1.Panel1MouseDown(Sender: TObject; Button: Integer; ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer);
begin
 Panel1.Height := Panel1.Height + 100;
 Panel1.Width := Panel1.Width + 50;
end;

procedure TForm1.Panel1MouseUp(Sender: TObject; Button: Integer; ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer);
begin
 Panel1.Height := Panel1.Height - 100;
 Panel1.Width := Panel1.Width - 50;
end;


I'm using ver 1.01 B5.
Tue, May 7 2013 4:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stephen,

<< I can't get the mouse events onMouseEnter and OnMouseLeave to fire on a
TPanel, whereas MouseDown and Up work ok. >>

If you've got controls on the panel and the mouse is entering/leaving them
in conjunction with entering/leaving the panel, then you're going to see
issues with the latest 1.01 build.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, May 9 2013 5:37 PMPermanent Link

Stephen Barker

<If you've got controls on the panel and the mouse is entering/leaving them
in conjunction with entering/leaving the panel, then you're going to see
issues with the latest 1.01 build.>

At first I tried a panel that had TLabels on it. I wanted to resize and change color of the panel when the mouse hovers over it. Then I did the stripped-down test case with just a panel on its own, and it still doesn't work.

I'll wait to see what happens in later versions. It's not important - I was just trying to create styles of menus like accordion with some animation. For now, I've just written a simple version of a treeview menu.

Steve
Sun, Jun 9 2013 7:58 PMPermanent Link

Stephen Barker

Just reporting that this issue was resolved when I upgraded to 1.02 - thanks Tim.




Stephen Barker wrote:

<If you've got controls on the panel and the mouse is entering/leaving them
in conjunction with entering/leaving the panel, then you're going to see
issues with the latest 1.01 build.>

At first I tried a panel that had TLabels on it. I wanted to resize and change color of the panel when the mouse hovers over it. Then I did the stripped-down test case with just a panel on its own, and it still doesn't work.

I'll wait to see what happens in later versions. It's not important - I was just trying to create styles of menus like accordion with some animation. For now, I've just written a simple version of a treeview menu.

Steve
Mon, Jun 10 2013 1:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stephen,

<< Just reporting that this issue was resolved when I upgraded to 1.02 -
thanks Tim. >>

Great, thanks for the update. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image