mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 07:37:02 +02:00
Cocoa: add util NSControlMoveCaretToTheEnd()
This commit is contained in:
parent
b33ed34bed
commit
7010173b69
@ -84,6 +84,7 @@ function GetNSText(text: NSText): string; inline;
|
||||
|
||||
procedure SetNSControlValue(c: NSControl; const S: String); inline;
|
||||
function GetNSControlValue(c: NSControl): String; inline;
|
||||
procedure NSControlMoveCaretToTheEnd(c: NSControl);
|
||||
|
||||
procedure ColorToRGBFloat(cl: TColorRef; var r,g,b: Single); inline;
|
||||
function RGBToColorFloat(r,g,b: Single): TColorRef; inline;
|
||||
@ -1062,6 +1063,17 @@ begin
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
procedure NSControlMoveCaretToTheEnd(c: NSControl);
|
||||
var
|
||||
range: NSRange;
|
||||
begin
|
||||
if c.currentEditor <> nil then begin
|
||||
range.location:= NSUIntegerMax;
|
||||
range.length:= 0;
|
||||
c.currentEditor.setSelectedRange( range );
|
||||
end;
|
||||
end;
|
||||
|
||||
{ NSLCLDebugExtension }
|
||||
|
||||
function NSLCLDebugExtension.lclClassName: shortstring;
|
||||
|
Loading…
Reference in New Issue
Block a user