diff --git a/lcl/controls.pp b/lcl/controls.pp index fef6a0b86c..75ac24b611 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -2220,7 +2220,7 @@ type function GetCapture: HWND; function GetCursorPos: TPoint; function GetIsDragging: Boolean; - procedure SetCursorPos(AValue : TPoint); + procedure SetCursorPos(AValue: TPoint); function GetWheelScrollLines: Integer; function GetDragImmediate: Boolean; procedure SetDragImmediate(const AValue: Boolean); diff --git a/lcl/include/mouse.inc b/lcl/include/mouse.inc index b03748ca7f..540fdec8e8 100644 --- a/lcl/include/mouse.inc +++ b/lcl/include/mouse.inc @@ -34,28 +34,26 @@ begin Result := FCapture; end; - -procedure TMouse.SetCapture(const Value : HWND); +procedure TMouse.SetCapture(const Value: HWND); begin {$IFDEF VerboseMouseCapture} DebugLn('TMouse.SetCapture '); {$ENDIF} FCapture := Value; - if Value = 0 then ReleaseCapture else LCLIntf.SetCapture(Value); + if Value = 0 then + ReleaseCapture + else + LCLIntf.SetCapture(Value); FCapture := GetCapture; end; -function TMouse.GetCursorPos : TPoint; -var - p : TPoint; +function TMouse.GetCursorPos: TPoint; begin - if WidgetSet.GetCursorPos(p) then - Result := P - else - Result:=Point(0,0); + if not WidgetSet.GetCursorPos(Result) then + Result := Point(0,0); end; -procedure TMouse.SetCursorPos(AValue : TPoint); +procedure TMouse.SetCursorPos(AValue: TPoint); begin WidgetSet.SetCursorPos(AValue.X, AValue.Y); end;