mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:39:25 +02:00
cocoa: cocoawscustom implemented GetSelStart and GetSelLength methods
git-svn-id: trunk@46882 -
This commit is contained in:
parent
63400d9ec8
commit
7ca99f4bcc
@ -132,6 +132,9 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class function GetStrings(const ACustomMemo: TCustomMemo): TStrings; override;
|
||||
|
||||
class function GetSelStart(const ACustomEdit: TCustomEdit): integer; override;
|
||||
class function GetSelLength(const ACustomEdit: TCustomEdit): integer; override;
|
||||
|
||||
class procedure AppendText(const ACustomMemo: TCustomMemo; const AText: string); override;
|
||||
class procedure SetScrollbars(const ACustomMemo: TCustomMemo; const NewScrollbars: TScrollStyle); override;
|
||||
class procedure SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean); override;
|
||||
@ -772,6 +775,30 @@ begin
|
||||
Result := nil
|
||||
end;
|
||||
|
||||
class function TCocoaWSCustomMemo.GetSelStart(const ACustomEdit: TCustomEdit
|
||||
): integer;
|
||||
var
|
||||
txt: TCocoaTextView;
|
||||
ns: NSArray;
|
||||
begin
|
||||
txt := MemoTextView(ACustomEdit);
|
||||
if not Assigned(txt) then Exit;
|
||||
ns := txt.selectedRanges;
|
||||
Result:=NSValue( ns.objectAtIndex(0) ).rangeValue.location;
|
||||
end;
|
||||
|
||||
class function TCocoaWSCustomMemo.GetSelLength(const ACustomEdit: TCustomEdit
|
||||
): integer;
|
||||
var
|
||||
txt: TCocoaTextView;
|
||||
ns: NSArray;
|
||||
begin
|
||||
txt := MemoTextView(ACustomEdit);
|
||||
if not Assigned(txt) then Exit;
|
||||
ns := txt.selectedRanges;
|
||||
Result:=NSValue( ns.objectAtIndex(0) ).rangeValue.length;
|
||||
end;
|
||||
|
||||
class procedure TCocoaWSCustomMemo.AppendText(const ACustomMemo: TCustomMemo;
|
||||
const AText: string);
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user