mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 02:00:16 +02:00
Carbon intf: Patch #0009952: Patch to add SetCursorPos function to LCL CarbonWidgetSet from James Chandler Jr.
git-svn-id: trunk@12568 -
This commit is contained in:
parent
5fe8eaf76b
commit
7ac17a32e0
@ -646,7 +646,6 @@ begin
|
||||
Self, SName, 'ATSUSetLayoutControls', 'LineRotation') then Exit;
|
||||
|
||||
// disable fractional positions of glyphs in layout
|
||||
// TODO: restrict to monspaced fonts only
|
||||
Tag := kATSULineLayoutOptionsTag;
|
||||
DataSize := SizeOf(ATSLineLayoutOptions);
|
||||
|
||||
|
@ -43,9 +43,9 @@ uses
|
||||
// interfacebase
|
||||
InterfaceBase,
|
||||
// widgetset
|
||||
CarbonGDIObjects,
|
||||
CarbonGDIObjects,
|
||||
{$ifdef DebugBitmaps}
|
||||
CarbonDebug,
|
||||
CarbonDebug,
|
||||
{$endif}
|
||||
// LCL
|
||||
LCLStrConsts, LMessages, LCLMessageGlue, LCLProc, LCLIntf, LCLType,
|
||||
|
@ -2675,6 +2675,32 @@ begin
|
||||
FCurrentCursor := ACursor;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: SetCursorPos
|
||||
Params: X - global screen horizontal coordinate
|
||||
Y - global screen vertical coordinate
|
||||
Returns: If the function succeeds.
|
||||
|
||||
Sets the position of the cursor on the screen.
|
||||
NOTE: does not generate events!
|
||||
------------------------------------------------------------------------------}
|
||||
function TCarbonWidgetSet.SetCursorPos(X, Y: Integer): Boolean;
|
||||
var
|
||||
CursorPos: CGPoint;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
{$IFDEF VerboseWinAPI}
|
||||
DebugLn('TCarbonWidgetSet.SetCursorPos X: ' + DbgS(X) + ' Y: ' + DbgS(Y));
|
||||
{$ENDIF}
|
||||
|
||||
CursorPos.X := X;
|
||||
CursorPos.Y := Y;
|
||||
if OSError(CGWarpMouseCursorPosition(CursorPos), Self, 'SetCursorPos',
|
||||
'CGWarpMouseCursorPosition') then Exit;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: SetFocus
|
||||
Params: HWnd - Handle of new focus window
|
||||
@ -3079,3 +3105,4 @@ end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -183,6 +183,7 @@ function SetCaretPos(X, Y: Integer): Boolean; override;
|
||||
function SetCaretPosEx(Handle: HWnd; X, Y: Integer): Boolean; override;
|
||||
function SetCaretRespondToFocus(handle: HWND; ShowHideOnFocus: boolean): Boolean; override;
|
||||
function SetCursor(ACursor: HCURSOR): HCURSOR; override;
|
||||
function SetCursorPos(X, Y: Integer): Boolean; override;
|
||||
function SetFocus(HWnd: HWND): HWND; override;
|
||||
function SetForegroundWindow(HWnd: HWND): boolean; override;
|
||||
function SetProp(Handle: hwnd; Str : PChar; Data : Pointer) : Boolean; override;
|
||||
@ -207,3 +208,4 @@ function WindowFromPoint(Point : TPoint) : HWND; override;
|
||||
|
||||
//##apiwiz##eps## // Do not remove, no wizard declaration after this line
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user