mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 14:19:11 +02:00
customdrawn-android and x11: Implements proper targeting for MouseUp
git-svn-id: trunk@33883 -
This commit is contained in:
parent
af910e4d3b
commit
7a4de2176d
@ -21,6 +21,8 @@ type
|
||||
Window: X.TWindow;
|
||||
LCLControl: TWinControl;
|
||||
Children: TFPList; // of TCDWinControl;
|
||||
//
|
||||
LastMouseDownControl: TWinControl; // Stores the control which should receive the next MouseUp
|
||||
// Used and valid only during event processing
|
||||
XEvent: PXEvent;
|
||||
// X11 extra objects
|
||||
|
@ -54,9 +54,14 @@ begin
|
||||
lEventPos := FormPosToControlPos(lTarget, Round(X), Round(Y));
|
||||
|
||||
case action of
|
||||
ACTION_DOWN: LCLSendMouseDownMsg(lTarget, lEventPos.X, lEventPos.Y, mbLeft, []);
|
||||
ACTION_DOWN:
|
||||
begin
|
||||
lCurForm.LastMouseDownControl := lTarget;
|
||||
LCLSendMouseDownMsg(lTarget, lEventPos.X, lEventPos.Y, mbLeft, []);
|
||||
end;
|
||||
ACTION_UP:
|
||||
begin
|
||||
if lCurForm.LastMouseDownControl <> nil then lTarget := lCurForm.LastMouseDownControl;
|
||||
LCLSendMouseUpMsg(lTarget, lEventPos.X, lEventPos.Y, mbLeft, []);
|
||||
LCLSendClickedMsg(lTarget);
|
||||
end;
|
||||
|
@ -32,6 +32,8 @@ type
|
||||
public
|
||||
LCLForm: TCustomForm;
|
||||
Children: TFPList; // of TCDWinControl;
|
||||
//
|
||||
LastMouseDownControl: TWinControl; // Stores the control which should receive the next MouseUp
|
||||
// painting objects
|
||||
Image: TLazIntfImage;
|
||||
Canvas: TLazCanvas;
|
||||
|
@ -527,6 +527,7 @@ var
|
||||
lTarget: TWinControl;
|
||||
begin
|
||||
lTarget := FindControlWhichReceivedEvent(TCustomForm(AWinControl), AWindowInfo.Children, Event.x, Event.y);
|
||||
AWindowInfo.LastMouseDownControl := lTarget;
|
||||
|
||||
if XButtonToMouseButton(Event.button, MouseButton) then
|
||||
begin
|
||||
@ -562,6 +563,8 @@ var
|
||||
lTarget: TWinControl;
|
||||
lEventPos: TPoint;
|
||||
begin
|
||||
lTarget := AWindowInfo.LastMouseDownControl;
|
||||
if lTarget = nil then
|
||||
lTarget := FindControlWhichReceivedEvent(TCustomForm(AWinControl), AWindowInfo.Children, Event.x, Event.y);
|
||||
lEventPos := FormPosToControlPos(lTarget, Event.x, Event.y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user