mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 13:19:18 +02:00
Carbon: implemented Cut,Copy,Paste and Undo for TWSCustomEdit. issue #9715
git-svn-id: trunk@36083 -
This commit is contained in:
parent
cada92bd6a
commit
45244751f4
@ -112,6 +112,10 @@ type
|
||||
|
||||
TCarbonCustomEdit = class(TCarbonControlWithEdit)
|
||||
public
|
||||
procedure CopyToClip; virtual;
|
||||
procedure CutToClip; virtual;
|
||||
procedure PasteFromClip; virtual;
|
||||
procedure UndoClip; virtual;
|
||||
procedure SetPasswordChar(AChar: Char); virtual; abstract;
|
||||
function FilterKeyPress(SysKey: Boolean; const Char: TUTF8Char): Boolean; override;
|
||||
function GetCaretPos: TPoint; virtual;
|
||||
@ -1026,6 +1030,26 @@ end;
|
||||
|
||||
{ TCarbonCustomEdit }
|
||||
|
||||
procedure TCarbonCustomEdit.CopyToClip;
|
||||
begin
|
||||
TXNCopy(HITextViewGetTXNObject(ControlRef(Widget)));
|
||||
end;
|
||||
|
||||
procedure TCarbonCustomEdit.CutToClip;
|
||||
begin
|
||||
TXNCut(HITextViewGetTXNObject(ControlRef(Widget)));
|
||||
end;
|
||||
|
||||
procedure TCarbonCustomEdit.PasteFromClip;
|
||||
begin
|
||||
TXNPaste(HITextViewGetTXNObject(ControlRef(Widget)));
|
||||
end;
|
||||
|
||||
procedure TCarbonCustomEdit.UndoClip;
|
||||
begin
|
||||
TXNUndo(HITextViewGetTXNObject(ControlRef(Widget)));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonCustomEdit.FilterKeyPress
|
||||
|
||||
|
@ -918,21 +918,25 @@ end;
|
||||
class procedure TCarbonWSCustomEdit.Cut(const ACustomEdit: TCustomEdit);
|
||||
begin
|
||||
if not CheckHandle(ACustomEdit, Self, 'Cut') then Exit;
|
||||
TCarbonCustomEdit(ACustomEdit.Handle).CutToClip;
|
||||
end;
|
||||
|
||||
class procedure TCarbonWSCustomEdit.Copy(const ACustomEdit: TCustomEdit);
|
||||
begin
|
||||
if not CheckHandle(ACustomEdit, Self, 'Copy') then Exit;
|
||||
TCarbonCustomEdit(ACustomEdit.Handle).CopyToClip;
|
||||
end;
|
||||
|
||||
class procedure TCarbonWSCustomEdit.Paste(const ACustomEdit: TCustomEdit);
|
||||
begin
|
||||
if not CheckHandle(ACustomEdit, Self, 'Paste') then Exit;
|
||||
TCarbonCustomEdit(ACustomEdit.Handle).PasteFromClip;
|
||||
end;
|
||||
|
||||
class procedure TCarbonWSCustomEdit.Undo(const ACustomEdit: TCustomEdit);
|
||||
begin
|
||||
if not CheckHandle(ACustomEdit, Self, 'Undo') then Exit;
|
||||
TCarbonCustomEdit(ACustomEdit.Handle).UndoClip;
|
||||
end;
|
||||
|
||||
{ TCarbonWSCustomMemo }
|
||||
|
Loading…
Reference in New Issue
Block a user