mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 17:15:58 +02:00
lcl: simplified Mouse.GetCursorPos + formatting
git-svn-id: trunk@22034 -
This commit is contained in:
parent
3b842095b1
commit
a3d64e981d
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user