mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:49:30 +02:00
IDEIntf: started copy-paste event
git-svn-id: trunk@30932 -
This commit is contained in:
parent
b7e29033dd
commit
512b557964
@ -31,7 +31,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Controls,
|
Classes, SysUtils, LResources, Controls,
|
||||||
IDECommands, MenuIntf, IDEWindowIntf,
|
IDECommands, MenuIntf, IDEWindowIntf, SrcEditorIntf,
|
||||||
CodyStrConsts, CodyCtrls, PPUListDlg, AddAssignMethodDlg,
|
CodyStrConsts, CodyCtrls, PPUListDlg, AddAssignMethodDlg,
|
||||||
CodyUtils, CodyNodeInfoDlg, CodyFrm, DeclareVarDlg;
|
CodyUtils, CodyNodeInfoDlg, CodyFrm, DeclareVarDlg;
|
||||||
|
|
||||||
@ -148,6 +148,8 @@ begin
|
|||||||
CodyWindowCreator:=IDEWindowCreators.Add(CodyWindowName,@CreateCodyWindow,nil,
|
CodyWindowCreator:=IDEWindowCreators.Add(CodyWindowName,@CreateCodyWindow,nil,
|
||||||
'80%','50%','+18%','+25%','CodeExplorer',alBottom);
|
'80%','50%','+18%','+25%','CodeExplorer',alBottom);
|
||||||
|
|
||||||
|
// Global handlers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
SourceEditorManagerIntf.RegisterCopyPasteEvent(@Cody.SrcEditCopyPaste);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -30,7 +30,7 @@ unit CodyUtils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Dialogs, Controls, LCLIntf, Clipbrd, LCLType,
|
Classes, SysUtils, Dialogs, Controls, LCLIntf, Clipbrd, LCLType, LResources,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
IDEDialogs, LazIDEIntf, SrcEditorIntf, IDEHelpIntf,
|
IDEDialogs, LazIDEIntf, SrcEditorIntf, IDEHelpIntf,
|
||||||
// codetools
|
// codetools
|
||||||
@ -50,7 +50,7 @@ type
|
|||||||
function ReadString(MemStream: TMemoryStream): string;
|
function ReadString(MemStream: TMemoryStream): string;
|
||||||
procedure WriteToStream(MemStream: TMemoryStream); virtual; abstract;
|
procedure WriteToStream(MemStream: TMemoryStream); virtual; abstract;
|
||||||
procedure ReadFromStream(MemStream: TMemoryStream); virtual; abstract;
|
procedure ReadFromStream(MemStream: TMemoryStream); virtual; abstract;
|
||||||
procedure Execute; virtual;
|
procedure Execute({%H-}SrcEdit: TSourceEditorInterface; {%H-}LogXY: TPoint); virtual;
|
||||||
end;
|
end;
|
||||||
TCodyClipboardFormat = class of TCodyClipboardData;
|
TCodyClipboardFormat = class of TCodyClipboardData;
|
||||||
|
|
||||||
@ -82,7 +82,8 @@ type
|
|||||||
// clipboard
|
// clipboard
|
||||||
class function ClipboardFormatId: TClipboardFormat;
|
class function ClipboardFormatId: TClipboardFormat;
|
||||||
function CanReadFromClipboard(AClipboard: TClipboard): Boolean;
|
function CanReadFromClipboard(AClipboard: TClipboard): Boolean;
|
||||||
function ReadFromClipboard(AClipboard: TClipboard): boolean;
|
function ReadFromClipboard(AClipboard: TClipboard;
|
||||||
|
SrcEdit: TSourceEditorInterface; LogXY: TPoint; AText: string): boolean;
|
||||||
function WriteToClipboard(Data: TCodyClipboardData;
|
function WriteToClipboard(Data: TCodyClipboardData;
|
||||||
AClipboard: TClipboard = nil): Boolean;
|
AClipboard: TClipboard = nil): Boolean;
|
||||||
procedure RegisterClipboardFormat(ccFormat: TCodyClipboardFormat);
|
procedure RegisterClipboardFormat(ccFormat: TCodyClipboardFormat);
|
||||||
@ -90,6 +91,9 @@ type
|
|||||||
function ClipboardFormatCount: integer;
|
function ClipboardFormatCount: integer;
|
||||||
property ClipboardFormats[Index: integer]: TCodyClipboardFormat
|
property ClipboardFormats[Index: integer]: TCodyClipboardFormat
|
||||||
read GetClipboardFormats;
|
read GetClipboardFormats;
|
||||||
|
procedure SrcEditCopyPaste(SrcEdit: TSourceEditorInterface;
|
||||||
|
var AText: String; var {%H-}AMode: TSemSelectionMode; ALogStartPos: TPoint;
|
||||||
|
var AnAction: TSemCopyPasteAction);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -358,15 +362,15 @@ end;
|
|||||||
procedure TCodyClipboardSrcData.WriteToStream(MemStream: TMemoryStream);
|
procedure TCodyClipboardSrcData.WriteToStream(MemStream: TMemoryStream);
|
||||||
begin
|
begin
|
||||||
WriteString(MemStream,SourceFilename);
|
WriteString(MemStream,SourceFilename);
|
||||||
MemStream.Write(SourceX,4);
|
WriteLRSInteger(MemStream,SourceY);
|
||||||
MemStream.Write(SourceY,4);
|
WriteLRSInteger(MemStream,SourceX);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyClipboardSrcData.ReadFromStream(MemStream: TMemoryStream);
|
procedure TCodyClipboardSrcData.ReadFromStream(MemStream: TMemoryStream);
|
||||||
begin
|
begin
|
||||||
SourceFilename:=ReadString(MemStream);
|
SourceFilename:=ReadString(MemStream);
|
||||||
MemStream.Read(SourceX,4);
|
SourceY:=ReadLRSInteger(MemStream);
|
||||||
MemStream.Read(SourceY,4);
|
SourceX:=ReadLRSInteger(MemStream);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCodyClipboardData }
|
{ TCodyClipboardData }
|
||||||
@ -386,7 +390,7 @@ begin
|
|||||||
b:=255;
|
b:=255;
|
||||||
MemStream.Write(b,1);
|
MemStream.Write(b,1);
|
||||||
l:=length(s);
|
l:=length(s);
|
||||||
MemStream.Write(l,4);
|
WriteLRSInteger(MemStream,l);
|
||||||
MemStream.Write(s[1],l);
|
MemStream.Write(s[1],l);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -404,15 +408,16 @@ begin
|
|||||||
if Result<>'' then
|
if Result<>'' then
|
||||||
MemStream.Read(Result[1],b);
|
MemStream.Read(Result[1],b);
|
||||||
end else begin
|
end else begin
|
||||||
l:=0;
|
l:=ReadLRSInteger(MemStream);
|
||||||
MemStream.Read(l,4);
|
|
||||||
if l<=0 then exit;
|
if l<=0 then exit;
|
||||||
SetLength(Result,l);
|
SetLength(Result,l);
|
||||||
MemStream.Read(Result[1],l);
|
MemStream.Read(Result[1],l);
|
||||||
end;
|
end;
|
||||||
|
debugln(['TCodyClipboardData.ReadString Result="',Result,'"']);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyClipboardData.Execute;
|
procedure TCodyClipboardData.Execute(SrcEdit: TSourceEditorInterface;
|
||||||
|
LogXY: TPoint);
|
||||||
begin
|
begin
|
||||||
raise Exception.Create('not implemented yet: '+ClassName+'.Execute');
|
raise Exception.Create('not implemented yet: '+ClassName+'.Execute');
|
||||||
end;
|
end;
|
||||||
@ -461,7 +466,8 @@ begin
|
|||||||
Result := AClipboard.HasFormat(ClipboardFormatId);
|
Result := AClipboard.HasFormat(ClipboardFormatId);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCody.ReadFromClipboard(AClipboard: TClipboard): boolean;
|
function TCody.ReadFromClipboard(AClipboard: TClipboard;
|
||||||
|
SrcEdit: TSourceEditorInterface; LogXY: TPoint; AText: string): boolean;
|
||||||
|
|
||||||
procedure InvalidStream;
|
procedure InvalidStream;
|
||||||
begin
|
begin
|
||||||
@ -482,6 +488,7 @@ begin
|
|||||||
try
|
try
|
||||||
Result:=AClipboard.GetFormat(ClipboardFormatId,MemStream);
|
Result:=AClipboard.GetFormat(ClipboardFormatId,MemStream);
|
||||||
ID:='';
|
ID:='';
|
||||||
|
MemStream.Position:=0;
|
||||||
if MemStream.Read(ID[0],1)<>1 then
|
if MemStream.Read(ID[0],1)<>1 then
|
||||||
InvalidStream;
|
InvalidStream;
|
||||||
if MemStream.Read(ID[1],ord(ID[0]))<>ord(ID[0]) then
|
if MemStream.Read(ID[1],ord(ID[0]))<>ord(ID[0]) then
|
||||||
@ -490,8 +497,9 @@ begin
|
|||||||
if aFormat=nil then
|
if aFormat=nil then
|
||||||
InvalidStream;
|
InvalidStream;
|
||||||
Data:=aFormat.Create;
|
Data:=aFormat.Create;
|
||||||
|
Data.AsText:=AText;
|
||||||
Data.ReadFromStream(MemStream);
|
Data.ReadFromStream(MemStream);
|
||||||
Data.Execute;
|
Data.Execute(SrcEdit,LogXY);
|
||||||
finally
|
finally
|
||||||
Data.Free;
|
Data.Free;
|
||||||
MemStream.Free;
|
MemStream.Free;
|
||||||
@ -503,6 +511,7 @@ function TCody.WriteToClipboard(Data: TCodyClipboardData; AClipboard: TClipboard
|
|||||||
var
|
var
|
||||||
MemStream: TMemoryStream;
|
MemStream: TMemoryStream;
|
||||||
ID: ShortString;
|
ID: ShortString;
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
if AClipboard=nil then AClipboard:=Clipboard;
|
if AClipboard=nil then AClipboard:=Clipboard;
|
||||||
AClipboard.AsText:=Data.AsText;
|
AClipboard.AsText:=Data.AsText;
|
||||||
@ -510,9 +519,14 @@ begin
|
|||||||
raise Exception.Create('Write to clipboard failed');
|
raise Exception.Create('Write to clipboard failed');
|
||||||
MemStream:=TMemoryStream.Create;
|
MemStream:=TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
ID:=AClipboard.ClassName;
|
ID:=Data.ClassName;
|
||||||
MemStream.Write(ID[0],length(ID)+1);
|
MemStream.Write(ID[0],length(ID)+1);
|
||||||
Data.WriteToStream(MemStream);
|
Data.WriteToStream(MemStream);
|
||||||
|
MemStream.Position:=0;
|
||||||
|
SetLength(s,MemStream.Size);
|
||||||
|
MemStream.Read(s[1],length(s));
|
||||||
|
debugln(['TCody.WriteToClipboard Stream=',dbgstr(s)]);
|
||||||
|
MemStream.Position:=0;
|
||||||
Result:=AClipboard.AddFormat(ClipboardFormatId,MemStream);
|
Result:=AClipboard.AddFormat(ClipboardFormatId,MemStream);
|
||||||
finally
|
finally
|
||||||
MemStream.Free;
|
MemStream.Free;
|
||||||
@ -542,6 +556,25 @@ begin
|
|||||||
Result:=FClipboardFormats.Count;
|
Result:=FClipboardFormats.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCody.SrcEditCopyPaste(SrcEdit: TSourceEditorInterface;
|
||||||
|
var AText: String; var AMode: TSemSelectionMode; ALogStartPos: TPoint;
|
||||||
|
var AnAction: TSemCopyPasteAction);
|
||||||
|
var
|
||||||
|
AClipBoard: TClipboard;
|
||||||
|
begin
|
||||||
|
// ToDo: use the right clipboard
|
||||||
|
AClipBoard:=Clipboard;
|
||||||
|
try
|
||||||
|
if not ReadFromClipboard(AClipBoard,SrcEdit,ALogStartPos,AText) then exit;
|
||||||
|
except
|
||||||
|
on E: Exception do begin
|
||||||
|
IDEMessageDialog('Error','Unable to paste Cody data.'#13+E.Message,
|
||||||
|
mtError,[mbCancel]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
AnAction:=semcaAbort;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
Cody:=TCody.Create;
|
Cody:=TCody.Create;
|
||||||
finalization
|
finalization
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
- guess parameter
|
- guess parameter
|
||||||
- guess j:=<i>
|
- guess j:=<i>
|
||||||
- Extend uses section when adding to a class
|
- Extend uses section when adding to a class
|
||||||
- copy to clipboard
|
|
||||||
- paste from clipboard
|
- paste from clipboard
|
||||||
}
|
}
|
||||||
unit DeclareVarDlg;
|
unit DeclareVarDlg;
|
||||||
@ -69,7 +68,7 @@ type
|
|||||||
TheUnitName: string;
|
TheUnitName: string;
|
||||||
procedure WriteToStream(MemStream: TMemoryStream); override;
|
procedure WriteToStream(MemStream: TMemoryStream); override;
|
||||||
procedure ReadFromStream(MemStream: TMemoryStream); override;
|
procedure ReadFromStream(MemStream: TMemoryStream); override;
|
||||||
procedure Execute; override;
|
procedure Execute(SrcEdit: TSourceEditorInterface; {%H-}LogXY: TPoint); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCodyDeclareVarDialog }
|
{ TCodyDeclareVarDialog }
|
||||||
@ -214,9 +213,12 @@ begin
|
|||||||
TheUnitName:=ReadString(MemStream);
|
TheUnitName:=ReadString(MemStream);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyClipboardDeclareVar.Execute;
|
procedure TCodyClipboardDeclareVar.Execute(SrcEdit: TSourceEditorInterface;
|
||||||
|
LogXY: TPoint);
|
||||||
begin
|
begin
|
||||||
inherited Execute;
|
debugln(['TCodyClipboardDeclareVar.Execute ']);
|
||||||
|
|
||||||
|
SrcEdit.Selection:=AsText;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCodyDeclareVarTarget }
|
{ TCodyDeclareVarTarget }
|
||||||
|
@ -808,6 +808,10 @@ type
|
|||||||
property NotebookPages: TStrings read GetNotebookPages;
|
property NotebookPages: TStrings read GetNotebookPages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TSrcEditMangerHandlerType = (
|
||||||
|
semhtCopyPaste
|
||||||
|
);
|
||||||
|
|
||||||
{ TSourceEditorManagerBase }
|
{ TSourceEditorManagerBase }
|
||||||
(* Implement all Methods with the Interface types *)
|
(* Implement all Methods with the Interface types *)
|
||||||
|
|
||||||
@ -826,6 +830,7 @@ type
|
|||||||
protected
|
protected
|
||||||
fProducers: TFPList; // list of TSourceMarklingProducer
|
fProducers: TFPList; // list of TSourceMarklingProducer
|
||||||
FChangeNotifyLists: Array [TsemChangeReason] of TMethodList;
|
FChangeNotifyLists: Array [TsemChangeReason] of TMethodList;
|
||||||
|
FHandlers: array[TSrcEditMangerHandlerType] of TMethodList;
|
||||||
function GetActiveSourceWindow: TSourceEditorWindowInterface; override;
|
function GetActiveSourceWindow: TSourceEditorWindowInterface; override;
|
||||||
procedure SetActiveSourceWindow(const AValue: TSourceEditorWindowInterface); override;
|
procedure SetActiveSourceWindow(const AValue: TSourceEditorWindowInterface); override;
|
||||||
function GetSourceWindows(Index: integer): TSourceEditorWindowInterface; override;
|
function GetSourceWindows(Index: integer): TSourceEditorWindowInterface; override;
|
||||||
@ -888,6 +893,8 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure RegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); override;
|
procedure RegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); override;
|
||||||
procedure UnRegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); override;
|
procedure UnRegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); override;
|
||||||
|
procedure RegisterCopyPasteEvent(AHandler: TSemCopyPasteEvent); override;
|
||||||
|
procedure UnRegisterCopyPasteEvent(AHandler: TSemCopyPasteEvent); override;
|
||||||
// producers
|
// producers
|
||||||
function MarklingProducerCount: integer; override;
|
function MarklingProducerCount: integer; override;
|
||||||
procedure RegisterMarklingProducer(aProducer: TSourceMarklingProducer); override;
|
procedure RegisterMarklingProducer(aProducer: TSourceMarklingProducer); override;
|
||||||
@ -4333,7 +4340,24 @@ var
|
|||||||
NewIndent: TFABIndentationPolicy;
|
NewIndent: TFABIndentationPolicy;
|
||||||
Indent: LongInt;
|
Indent: LongInt;
|
||||||
NewSrc: string;
|
NewSrc: string;
|
||||||
|
i: Integer;
|
||||||
|
SemMode: TSemSelectionMode;
|
||||||
|
SemAction: TSemCopyPasteAction;
|
||||||
begin
|
begin
|
||||||
|
if Assigned(Manager) then begin
|
||||||
|
// call handlers
|
||||||
|
i:=Manager.FHandlers[semhtCopyPaste].Count;
|
||||||
|
while Manager.FHandlers[semhtCopyPaste].NextDownIndex(i) do begin
|
||||||
|
SemMode:=TSemSelectionMode(AMode);
|
||||||
|
SemAction:=TSemCopyPasteAction(AnAction);
|
||||||
|
TSemCopyPasteEvent(Manager.FHandlers[semhtCopyPaste][i])(Self,AText,
|
||||||
|
SemMode,ALogStartPos,SemAction);
|
||||||
|
AMode:=TSynSelectionMode(SemMode);
|
||||||
|
AnAction:=TSynCopyPasteAction(SemAction);
|
||||||
|
if AnAction=scaAbort then exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if AMode<>smNormal then exit;
|
if AMode<>smNormal then exit;
|
||||||
if SyncroLockCount > 0 then exit;
|
if SyncroLockCount > 0 then exit;
|
||||||
if not CodeToolsOpts.IndentOnPaste then exit;
|
if not CodeToolsOpts.IndentOnPaste then exit;
|
||||||
@ -7920,10 +7944,13 @@ end;
|
|||||||
constructor TSourceEditorManagerBase.Create(AOwner: TComponent);
|
constructor TSourceEditorManagerBase.Create(AOwner: TComponent);
|
||||||
var
|
var
|
||||||
i: TsemChangeReason;
|
i: TsemChangeReason;
|
||||||
|
h: TSrcEditMangerHandlerType;
|
||||||
begin
|
begin
|
||||||
FUpdateFlags := [];
|
FUpdateFlags := [];
|
||||||
for i := low(TsemChangeReason) to high(TsemChangeReason) do
|
for i := low(TsemChangeReason) to high(TsemChangeReason) do
|
||||||
FChangeNotifyLists[i] := TMethodList.Create;
|
FChangeNotifyLists[i] := TMethodList.Create;
|
||||||
|
for h:=low(FHandlers) to high(FHandlers) do
|
||||||
|
FHandlers[h] := TMethodList.Create;
|
||||||
SrcEditorIntf.SourceEditorManagerIntf := Self;
|
SrcEditorIntf.SourceEditorManagerIntf := Self;
|
||||||
FSourceWindowList := TFPList.Create;
|
FSourceWindowList := TFPList.Create;
|
||||||
FSourceWindowByFocusList := TFPList.Create;
|
FSourceWindowByFocusList := TFPList.Create;
|
||||||
@ -7938,6 +7965,7 @@ destructor TSourceEditorManagerBase.Destroy;
|
|||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
cr: TsemChangeReason;
|
cr: TsemChangeReason;
|
||||||
|
h: TSrcEditMangerHandlerType;
|
||||||
begin
|
begin
|
||||||
for i:=MarklingProducerCount-1 downto 0 do
|
for i:=MarklingProducerCount-1 downto 0 do
|
||||||
MarklingProducers[i].Free;
|
MarklingProducers[i].Free;
|
||||||
@ -7950,7 +7978,9 @@ begin
|
|||||||
FreeAndNil(FSourceWindowList);
|
FreeAndNil(FSourceWindowList);
|
||||||
FreeAndNil(FSourceWindowByFocusList);
|
FreeAndNil(FSourceWindowByFocusList);
|
||||||
for cr := low(TsemChangeReason) to high(TsemChangeReason) do
|
for cr := low(TsemChangeReason) to high(TsemChangeReason) do
|
||||||
FChangeNotifyLists[cr].Free;;
|
FreeAndNil(FChangeNotifyLists[cr]);
|
||||||
|
for h:=low(FHandlers) to high(FHandlers) do
|
||||||
|
FreeAndNil(FHandlers[h]);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -7966,6 +7996,18 @@ begin
|
|||||||
FChangeNotifyLists[AReason].Remove(TMethod(AHandler));
|
FChangeNotifyLists[AReason].Remove(TMethod(AHandler));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSourceEditorManagerBase.RegisterCopyPasteEvent(
|
||||||
|
AHandler: TSemCopyPasteEvent);
|
||||||
|
begin
|
||||||
|
FHandlers[semhtCopyPaste].Add(TMethod(AHandler));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSourceEditorManagerBase.UnRegisterCopyPasteEvent(
|
||||||
|
AHandler: TSemCopyPasteEvent);
|
||||||
|
begin
|
||||||
|
FHandlers[semhtCopyPaste].Remove(TMethod(AHandler));
|
||||||
|
end;
|
||||||
|
|
||||||
function TSourceEditorManagerBase.MarklingProducerCount: integer;
|
function TSourceEditorManagerBase.MarklingProducerCount: integer;
|
||||||
begin
|
begin
|
||||||
Result:=fProducers.Count;
|
Result:=fProducers.Count;
|
||||||
|
@ -253,6 +253,23 @@ type
|
|||||||
semEditorStatus // any status change of the editor (Caret, Selection, topline, ...)
|
semEditorStatus // any status change of the editor (Caret, Selection, topline, ...)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TSemSelectionMode = (
|
||||||
|
semsmNormal,
|
||||||
|
semsmLine,
|
||||||
|
semsmColumn,
|
||||||
|
semsmCurrent);
|
||||||
|
TSemCopyPasteAction = (
|
||||||
|
semcaContinue, // normal paste with specials like folding
|
||||||
|
semcaPlainText, // paste as normal text, ignore folding and other specials
|
||||||
|
semcaAbort // cancel, use this if you handled the paste yourself
|
||||||
|
);
|
||||||
|
// ToDo: use the right clipboard
|
||||||
|
TSemCopyPasteEvent = procedure(Sender: TSourceEditorInterface;
|
||||||
|
var AText: String; var AMode: TSemSelectionMode; ALogStartPos: TPoint;
|
||||||
|
var AnAction: TSemCopyPasteAction) of object;
|
||||||
|
|
||||||
|
{ TSourceEditorManagerInterface }
|
||||||
|
|
||||||
TSourceEditorManagerInterface = class(TComponent)
|
TSourceEditorManagerInterface = class(TComponent)
|
||||||
protected
|
protected
|
||||||
function GetActiveSourceWindow: TSourceEditorWindowInterface; virtual; abstract;
|
function GetActiveSourceWindow: TSourceEditorWindowInterface; virtual; abstract;
|
||||||
@ -312,6 +329,8 @@ type
|
|||||||
public
|
public
|
||||||
procedure RegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); virtual; abstract;
|
procedure RegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); virtual; abstract;
|
||||||
procedure UnRegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); virtual; abstract;
|
procedure UnRegisterChangeEvent(AReason: TsemChangeReason; AHandler: TNotifyEvent); virtual; abstract;
|
||||||
|
procedure RegisterCopyPasteEvent(AHandler: TSemCopyPasteEvent); virtual; abstract;
|
||||||
|
procedure UnRegisterCopyPasteEvent(AHandler: TSemCopyPasteEvent); virtual; abstract;
|
||||||
public
|
public
|
||||||
// source marklings
|
// source marklings
|
||||||
function MarklingProducerCount: integer; virtual; abstract;
|
function MarklingProducerCount: integer; virtual; abstract;
|
||||||
|
Loading…
Reference in New Issue
Block a user