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:
tombo 2007-10-23 15:34:01 +00:00
parent 5fe8eaf76b
commit 7ac17a32e0
4 changed files with 31 additions and 3 deletions

View File

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

View File

@ -43,9 +43,9 @@ uses
// interfacebase
InterfaceBase,
// widgetset
CarbonGDIObjects,
CarbonGDIObjects,
{$ifdef DebugBitmaps}
CarbonDebug,
CarbonDebug,
{$endif}
// LCL
LCLStrConsts, LMessages, LCLMessageGlue, LCLProc, LCLIntf, LCLType,

View File

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

View File

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