mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 04:42:11 +02:00
Fixes focusing into intf controls
git-svn-id: trunk@34364 -
This commit is contained in:
parent
ded92535b3
commit
cbb0725222
@ -121,6 +121,7 @@ begin
|
||||
lTarget := FindControlWhichReceivedEvent(AWindowHandle.LCLForm, AWindowHandle.Children, x, y);
|
||||
AWindowHandle.LastMouseDownControl := lTarget;
|
||||
AWindowHandle.FocusedControl := lTarget;
|
||||
AWindowHandle.FocusedIntfControl := nil;
|
||||
lEventPos := FormPosToControlPos(lTarget, x, y);
|
||||
|
||||
LCLSendMouseDownMsg(lTarget, lEventPos.x, lEventPos.y, Button, ShiftState);
|
||||
@ -129,6 +130,7 @@ begin
|
||||
if IsIntfControl(lTarget) then
|
||||
begin
|
||||
lIntfTarget := lTarget;
|
||||
AWindowHandle.FocusedIntfControl := lTarget;
|
||||
lTarget := lTarget.Parent;
|
||||
|
||||
LCLSendMouseDownMsg(lTarget, lEventPos.x, lEventPos.y, Button, ShiftState);
|
||||
|
@ -51,6 +51,7 @@ type
|
||||
//
|
||||
LastMouseDownControl: TWinControl; // Stores the control which should receive the next MouseUp
|
||||
FocusedControl: TWinControl; // The control focused in the form
|
||||
FocusedIntfControl: TWinControl; // The intf control focused in the form
|
||||
LayoutAutoAdjusted: Boolean; // Indicates if the form layout was already auto-adjusted once
|
||||
// Counter to keep track of when we requested Invalidate
|
||||
// Some systems like X11 and Win32 will keep sending unnecessary paint messages
|
||||
@ -717,7 +718,8 @@ end;
|
||||
|
||||
function TCDForm.GetFocusedControl: TWinControl;
|
||||
begin
|
||||
if FocusedControl <> nil then Result := FocusedControl
|
||||
if FocusedIntfControl <> nil then Result := FocusedIntfControl
|
||||
else if FocusedControl <> nil then Result := FocusedControl
|
||||
else Result := LCLForm;
|
||||
end;
|
||||
|
||||
|
@ -737,29 +737,6 @@ begin
|
||||
CallbackMouseMove(WindowInfo, XPos, YPos, WParamShiftState);
|
||||
Result := 1;
|
||||
Exit;
|
||||
{NotifyUserInput := True;
|
||||
PLMsg:=@LMMouseMove;
|
||||
with LMMouseMove Do
|
||||
begin
|
||||
Msg := LM_MOUSEMOVE;
|
||||
XPos := SmallInt(Lo(LParam));
|
||||
YPos := SmallInt(Hi(LParam));
|
||||
Keys := WParam;
|
||||
// check if this is a spurious WM_MOUSEMOVE message, pos not actually changed
|
||||
if (XPos = WindowInfo.MouseX) and (YPos = WindowInfo.MouseY) then
|
||||
begin
|
||||
// do not fire message after all (position not changed)
|
||||
Msg := LM_NULL;
|
||||
NotifyUserInput := false;
|
||||
end else
|
||||
if (WindowInfo.MouseX <> DefaultWindowInfo.MouseX) or
|
||||
(WindowInfo.MouseY <> DefaultWindowInfo.MouseY) then
|
||||
begin
|
||||
// position changed, update window info
|
||||
WindowInfo.MouseX := XPos;
|
||||
WindowInfo.MouseY := YPos;
|
||||
end;
|
||||
end;}
|
||||
end;
|
||||
WM_MOUSEWHEEL:
|
||||
begin
|
||||
@ -827,9 +804,6 @@ begin
|
||||
end;
|
||||
WM_PAINT:
|
||||
begin
|
||||
{$IFDEF DEBUG_WINCE_LABELS}
|
||||
DebugLn('[WM_PAINT]');
|
||||
{$ENDIF}
|
||||
SendPaintMessage(HDC(WParam));
|
||||
// SendPaintMessage sets winprocess to false
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user