mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 00:58:04 +02:00
lcl: fixed TToolButton.MouseUp checking if cursor is still in boundsrect
git-svn-id: trunk@36713 -
This commit is contained in:
parent
0b5e5f6a0c
commit
9bfaf73b2d
@ -67,6 +67,7 @@ procedure TToolButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
var
|
||||
NewFlags: TToolButtonFlags;
|
||||
begin
|
||||
debugln(['TToolButton.MouseDown ',DbgSName(Self)]);
|
||||
NewFlags := FToolButtonFlags - [tbfPressed, tbfArrowPressed];
|
||||
if (Button = mbLeft) then
|
||||
begin
|
||||
@ -99,7 +100,7 @@ var
|
||||
DropDownMenuDropped: Boolean;
|
||||
Pt: TPoint;
|
||||
begin
|
||||
//DebugLn('TToolButton.MouseUp ',Name,':',ClassName,' ',dbgs(ord(Button)),' ',dbgs(X),',',dbgs(Y));
|
||||
//DebugLn(['TToolButton.MouseUp ',Name,':',ClassName,' ',dbgs(ord(Button)),' ',X,',',Y]);
|
||||
if (Button = mbLeft) and ([tbfArrowPressed, tbfPressed] * FToolButtonFlags <> []) then
|
||||
begin
|
||||
Exclude(FToolButtonFlags, tbfPressed);
|
||||
@ -108,14 +109,12 @@ begin
|
||||
end;
|
||||
|
||||
inherited MouseUp(Button, Shift, X, Y);
|
||||
|
||||
|
||||
if (Button = mbLeft) then
|
||||
begin
|
||||
if FMouseInControl then
|
||||
begin
|
||||
Pt := Point(X, Y);
|
||||
LCLIntf.GetCursorPos(Pt);
|
||||
LCLIntf.ScreenToClient(Parent.Handle, Pt);
|
||||
if not PtInRect(BoundsRect, Pt) then
|
||||
SetMouseInControl(false);
|
||||
end;
|
||||
@ -129,6 +128,7 @@ begin
|
||||
Down := False;
|
||||
end;
|
||||
|
||||
//debugln(['TToolButton.MouseUp ',DbgSName(Self),' FMouseInControl=',FMouseInControl,' DropDownMenuDropped=',DropDownMenuDropped]);
|
||||
if FMouseInControl and not DropDownMenuDropped then
|
||||
begin
|
||||
if (Style = tbsCheck) then
|
||||
|
Loading…
Reference in New Issue
Block a user