lcl: formatting

git-svn-id: trunk@19704 -
This commit is contained in:
paul 2009-04-30 08:04:12 +00:00
parent c6c23a10cf
commit 4a1309f268
3 changed files with 34 additions and 25 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;