trayicon: show popup on mouseup event from Felipe

git-svn-id: trunk@10538 -
This commit is contained in:
vincents 2007-01-30 12:01:40 +00:00
parent a4579a8ef6
commit b2bceaa57a
2 changed files with 15 additions and 15 deletions

View File

@ -217,8 +217,13 @@ begin
2: if Assigned(vwsTrayIcon.OnMouseUp) then
vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
3: if Assigned(vwsTrayIcon.OnMouseUp) then
vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
3:
begin
if Assigned(vwsTrayIcon.OnMouseUp) then
vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
if Assigned(vwsTrayIcon.PopUpMenu) then
vwsTrayIcon.PopUpMenu.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
end;
end;
@ -246,19 +251,14 @@ begin
else
begin
case event^.button of
1: if Assigned(vwsTrayIcon.OnMouseUp) then
1: if Assigned(vwsTrayIcon.OnMouseDown) then
vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbLeft, [], Round(event^.X), Round(event^.Y));
2: if Assigned(vwsTrayIcon.OnMouseUp) then
vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
2: if Assigned(vwsTrayIcon.OnMouseDown) then
vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
3:
begin
if Assigned(vwsTrayIcon.OnMouseUp) then
vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
if Assigned(vwsTrayIcon.PopUpMenu) then
vwsTrayIcon.PopUpMenu.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;
3: if Assigned(vwsTrayIcon.OnMouseDown) then
vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
end;
end;
end;

View File

@ -356,13 +356,13 @@ begin
begin
BtnPressEv := PXButtonPressedEvent(@ev);
case BtnPressEv^.button of
1: if Assigned(OnMouseUp) then
1: if Assigned(OnMouseDown) then
OnMouseDown(Self, mbLeft, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
2: if Assigned(OnMouseUp) then
2: if Assigned(OnMouseDown) then
OnMouseDown(Self, mbMiddle, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
3: if Assigned(OnMouseUp) then
3: if Assigned(OnMouseDown) then
OnMouseDown(Self, mbRight, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
end;
end;