mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 09:49:22 +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 GetCapture: HWND;
|
||||||
function GetCursorPos: TPoint;
|
function GetCursorPos: TPoint;
|
||||||
function GetIsDragging: Boolean;
|
function GetIsDragging: Boolean;
|
||||||
procedure SetCursorPos(AValue : TPoint);
|
procedure SetCursorPos(AValue: TPoint);
|
||||||
function GetWheelScrollLines: Integer;
|
function GetWheelScrollLines: Integer;
|
||||||
function GetDragImmediate: Boolean;
|
function GetDragImmediate: Boolean;
|
||||||
procedure SetDragImmediate(const AValue: Boolean);
|
procedure SetDragImmediate(const AValue: Boolean);
|
||||||
|
@ -34,28 +34,26 @@ begin
|
|||||||
Result := FCapture;
|
Result := FCapture;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMouse.SetCapture(const Value: HWND);
|
||||||
procedure TMouse.SetCapture(const Value : HWND);
|
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseMouseCapture}
|
{$IFDEF VerboseMouseCapture}
|
||||||
DebugLn('TMouse.SetCapture ');
|
DebugLn('TMouse.SetCapture ');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FCapture := Value;
|
FCapture := Value;
|
||||||
if Value = 0 then ReleaseCapture else LCLIntf.SetCapture(Value);
|
if Value = 0 then
|
||||||
|
ReleaseCapture
|
||||||
|
else
|
||||||
|
LCLIntf.SetCapture(Value);
|
||||||
FCapture := GetCapture;
|
FCapture := GetCapture;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMouse.GetCursorPos : TPoint;
|
function TMouse.GetCursorPos: TPoint;
|
||||||
var
|
|
||||||
p : TPoint;
|
|
||||||
begin
|
begin
|
||||||
if WidgetSet.GetCursorPos(p) then
|
if not WidgetSet.GetCursorPos(Result) then
|
||||||
Result := P
|
Result := Point(0,0);
|
||||||
else
|
|
||||||
Result:=Point(0,0);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMouse.SetCursorPos(AValue : TPoint);
|
procedure TMouse.SetCursorPos(AValue: TPoint);
|
||||||
begin
|
begin
|
||||||
WidgetSet.SetCursorPos(AValue.X, AValue.Y);
|
WidgetSet.SetCursorPos(AValue.X, AValue.Y);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user