mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 15:00:26 +02:00
lcl: formatting
git-svn-id: trunk@19704 -
This commit is contained in:
parent
c6c23a10cf
commit
4a1309f268
@ -2651,44 +2651,52 @@ var
|
||||
begin
|
||||
//DebugLn('SetCaptureControl Old=',DbgSName(CaptureControl),' New=',DbgSName(Control));
|
||||
if (CaptureControl=Control) then exit;
|
||||
if Control=nil then begin
|
||||
|
||||
if Control = nil then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('SetCaptureControl Only ReleaseCapture');
|
||||
{$ENDIF}
|
||||
// just unset the capturing, intf call not needed
|
||||
CaptureControl:=nil;
|
||||
CaptureControl := nil;
|
||||
ReleaseCapture;
|
||||
exit;
|
||||
Exit;
|
||||
end;
|
||||
OldCaptureWinControl:=FindOwnerControl(GetCapture);
|
||||
|
||||
OldCaptureWinControl := FindOwnerControl(GetCapture);
|
||||
if Control is TWinControl then
|
||||
NewCaptureWinControl:=TWinControl(Control)
|
||||
NewCaptureWinControl := TWinControl(Control)
|
||||
else
|
||||
NewCaptureWinControl:=Control.Parent;
|
||||
if NewCaptureWinControl=nil then begin
|
||||
NewCaptureWinControl := Control.Parent;
|
||||
|
||||
if NewCaptureWinControl = nil then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLN('SetCaptureControl Only ReleaseCapture');
|
||||
{$ENDIF}
|
||||
// just unset the capturing, intf call not needed
|
||||
CaptureControl:=nil;
|
||||
ReleaseCapture;
|
||||
exit;
|
||||
Exit;
|
||||
end;
|
||||
if NewCaptureWinControl=OldCaptureWinControl then begin
|
||||
|
||||
if NewCaptureWinControl = OldCaptureWinControl then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLN('SetCaptureControl Keep WinControl ',DbgSName(NewCaptureWinControl),
|
||||
' switch Control ',DbgSName(Control));
|
||||
{$ENDIF}
|
||||
// just change the CaptureControl, intf call not needed
|
||||
CaptureControl:=Control;
|
||||
exit;
|
||||
CaptureControl := Control;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// switch capture control
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLN('SetCaptureControl Switch to WinControl=',DbgSName(NewCaptureWinControl),
|
||||
' and Control=',DbgSName(Control));
|
||||
{$ENDIF}
|
||||
CaptureControl:=Control;
|
||||
CaptureControl := Control;
|
||||
ReleaseCapture;
|
||||
SetCapture(TWinControl(NewCaptureWinControl).Handle);
|
||||
end;
|
||||
|
@ -48,11 +48,11 @@ begin
|
||||
SetInitialBounds(0,0,GetControlClassDefaultSize.X,GetControlClassDefaultSize.Y);
|
||||
ControlStyle := ControlStyle + [csCaptureMouse]-[csSetCaption, csClickEvents, csOpaque];
|
||||
|
||||
FLayout:= blGlyphLeft;
|
||||
FAllowAllUp:= false;
|
||||
FLayout := blGlyphLeft;
|
||||
FAllowAllUp := False;
|
||||
FMouseInControl := False;
|
||||
FDragging := False;
|
||||
FShowAccelChar:=true;
|
||||
FShowAccelChar := True;
|
||||
FSpacing := 4;
|
||||
FMargin := -1;
|
||||
Color := clBtnFace;
|
||||
|
@ -4148,29 +4148,30 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TWinControl.IsControlMouseMsg(var TheMessage: TLMMouse) : Boolean;
|
||||
var
|
||||
Control : TControl;
|
||||
ScrolledOffset,
|
||||
P : TPoint;
|
||||
Control: TControl;
|
||||
ScrolledOffset, P: TPoint;
|
||||
ClientBounds: TRect;
|
||||
begin
|
||||
{ CaptureControl = nil means that widgetset has captured input, but it does
|
||||
not know anything about TControl controls }
|
||||
if (FindOwnerControl(GetCapture) = Self) and (CaptureControl <> nil)
|
||||
then begin
|
||||
if (FindOwnerControl(GetCapture) = Self) and (CaptureControl <> nil) then
|
||||
begin
|
||||
Control := nil;
|
||||
//DebugLn(['TWinControl.IsControlMouseMsg A ', DbgSName(CaptureControl), ', ',DbgSName(CaptureControl.Parent),', Self: ', DbgSName(Self)]);
|
||||
if (CaptureControl.Parent = Self)
|
||||
then Control := CaptureControl;
|
||||
if (CaptureControl.Parent = Self) then
|
||||
Control := CaptureControl;
|
||||
end
|
||||
else begin
|
||||
else
|
||||
begin
|
||||
// do query wincontrol childs, in case they overlap
|
||||
Control := ControlAtPos(SmallPointToPoint(TheMessage.Pos),
|
||||
[capfAllowWinControls]);
|
||||
if Control is TWinControl then begin
|
||||
if Control is TWinControl then
|
||||
begin
|
||||
// there is a TWinControl child at this position
|
||||
// TWinControl childs get their own messages
|
||||
// => ignore here
|
||||
Control:=nil;
|
||||
Control := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user