mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:59:17 +02:00
lcl: TSpeedButton should generate a click event if it changes Down state in spite of csClicked state (fixes issue #0018010)
git-svn-id: trunk@28394 -
This commit is contained in:
parent
a2e75a4b8d
commit
ec1fc668c9
@ -753,6 +753,7 @@ end;
|
||||
procedure TCustomSpeedButton.WMLButtonUp(var Message: TLMLButtonUp);
|
||||
var
|
||||
OldState: TButtonState;
|
||||
NeedClick: Boolean;
|
||||
begin
|
||||
//DebugLn('TCustomSpeedButton.WMLButtonUp A ',DbgSName(Self),' csCaptureMouse=',DbgS(csCaptureMouse in ControlStyle),' csClicked=',DbgS(csClicked in ControlState));
|
||||
if (csCaptureMouse in ControlStyle) and (mbLeft in CaptureMouseButtons) then
|
||||
@ -763,6 +764,8 @@ begin
|
||||
MouseCapture := False;
|
||||
end;
|
||||
|
||||
NeedClick := False;
|
||||
|
||||
if not (csDesigning in ComponentState) and FDragging then
|
||||
begin
|
||||
OldState := FState;
|
||||
@ -778,6 +781,7 @@ begin
|
||||
if (Message.XPos >= 0) and (Message.XPos < Width) and (Message.YPos >= 0) and (Message.YPos < Height) then
|
||||
begin
|
||||
SetDown(not FDown);
|
||||
NeedClick := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -791,10 +795,13 @@ begin
|
||||
begin
|
||||
//DebugLn('TCustomSpeedButton.WMLButtonUp C');
|
||||
// Important: Calling Click can invoke modal dialogs, so call this as last
|
||||
NeedClick := False;
|
||||
Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
if NeedClick then
|
||||
Click;
|
||||
//DebugLn('TCustomSpeedButton.WMLButtonUp END');
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user