mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
added some SrcEditorIntf functions
git-svn-id: trunk@7799 -
This commit is contained in:
parent
8cc5cbf6e1
commit
97f7f4e134
@ -228,7 +228,7 @@ type
|
|||||||
// selections
|
// selections
|
||||||
function SelectionAvailable: boolean; override;
|
function SelectionAvailable: boolean; override;
|
||||||
function GetText(OnlySelection: boolean): string; override;
|
function GetText(OnlySelection: boolean): string; override;
|
||||||
Procedure SelectText(LineNum, CharStart, LineNum2, CharEnd: Integer); override;
|
procedure SelectText(const StartPos, EndPos: TPoint); override;
|
||||||
procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string); override;
|
procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string); override;
|
||||||
procedure EncloseSelection;
|
procedure EncloseSelection;
|
||||||
procedure UpperCaseSelection;
|
procedure UpperCaseSelection;
|
||||||
@ -257,6 +257,8 @@ type
|
|||||||
function GetSelStart: Integer; override;
|
function GetSelStart: Integer; override;
|
||||||
procedure SetSelEnd(const AValue: Integer); override;
|
procedure SetSelEnd(const AValue: Integer); override;
|
||||||
procedure SetSelStart(const AValue: Integer); override;
|
procedure SetSelStart(const AValue: Integer); override;
|
||||||
|
function GetSelection: string; override;
|
||||||
|
procedure SetSelection(const AValue: string); override;
|
||||||
procedure CopyToClipboard; override;
|
procedure CopyToClipboard; override;
|
||||||
procedure CutToClipboard; override;
|
procedure CutToClipboard; override;
|
||||||
|
|
||||||
@ -1705,6 +1707,16 @@ begin
|
|||||||
FEditor.SelStart:=AValue;
|
FEditor.SelStart:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSourceEditor.GetSelection: string;
|
||||||
|
begin
|
||||||
|
Result:=FEditor.SelText;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSourceEditor.SetSelection(const AValue: string);
|
||||||
|
begin
|
||||||
|
FEditor.SelText:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSourceEditor.CopyToClipboard;
|
procedure TSourceEditor.CopyToClipboard;
|
||||||
begin
|
begin
|
||||||
FEditor.CopyToClipboard;
|
FEditor.CopyToClipboard;
|
||||||
@ -2102,16 +2114,10 @@ Begin
|
|||||||
FEditor.CaretY := Num;
|
FEditor.CaretY := Num;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TSourceEditor.SelectText(LineNum,CharStart,LineNum2,CharEnd: Integer);
|
Procedure TSourceEditor.SelectText(const StartPos, EndPos: TPoint);
|
||||||
var
|
|
||||||
P: TPoint;
|
|
||||||
Begin
|
Begin
|
||||||
P.X := CharStart;
|
FEditor.BlockBegin := StartPos;
|
||||||
P.Y := LineNum;
|
FEditor.BlockEnd := EndPos;
|
||||||
FEditor.BlockBegin := P;
|
|
||||||
P.X := CharEnd;
|
|
||||||
P.Y := LineNum2;
|
|
||||||
FEditor.BlockEnd := P;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceEditor.ReplaceLines(StartLine, EndLine: integer;
|
procedure TSourceEditor.ReplaceLines(StartLine, EndLine: integer;
|
||||||
|
@ -33,6 +33,8 @@ type
|
|||||||
|
|
||||||
TSourceEditorInterface = class
|
TSourceEditorInterface = class
|
||||||
protected
|
protected
|
||||||
|
function GetSelection: string;
|
||||||
|
procedure SetSelection(const AValue: string);
|
||||||
function GetBlockBegin: TPoint; virtual; abstract;
|
function GetBlockBegin: TPoint; virtual; abstract;
|
||||||
function GetBlockEnd: TPoint; virtual; abstract;
|
function GetBlockEnd: TPoint; virtual; abstract;
|
||||||
function GetCodeToolsBuffer: TObject; virtual; abstract;
|
function GetCodeToolsBuffer: TObject; virtual; abstract;
|
||||||
@ -62,7 +64,8 @@ type
|
|||||||
// selections
|
// selections
|
||||||
function SelectionAvailable: boolean; virtual; abstract;
|
function SelectionAvailable: boolean; virtual; abstract;
|
||||||
function GetText(OnlySelection: boolean): string; virtual; abstract;
|
function GetText(OnlySelection: boolean): string; virtual; abstract;
|
||||||
procedure SelectText(LineNum, CharStart, LineNum2, CharEnd: Integer); virtual; abstract;
|
procedure SelectText(LineNum, CharStart, LineNum2, CharEnd: Integer);
|
||||||
|
procedure SelectText(const StartPos, EndPos: TPoint); virtual; abstract;
|
||||||
procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string); virtual; abstract;
|
procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string); virtual; abstract;
|
||||||
procedure CopyToClipboard; virtual; abstract;
|
procedure CopyToClipboard; virtual; abstract;
|
||||||
procedure CutToClipboard; virtual; abstract;
|
procedure CutToClipboard; virtual; abstract;
|
||||||
@ -105,6 +108,7 @@ type
|
|||||||
property SelStart: Integer read GetSelStart write SetSelStart;
|
property SelStart: Integer read GetSelStart write SetSelStart;
|
||||||
property SourceText: string read GetSourceText write SetSourceText;
|
property SourceText: string read GetSourceText write SetSourceText;
|
||||||
property TopLine: Integer read GetTopLine write SetTopLine;
|
property TopLine: Integer read GetTopLine write SetTopLine;
|
||||||
|
property Selection: string read GetSelection write SetSelection;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSourceEditorWindowInterface }
|
{ TSourceEditorWindowInterface }
|
||||||
@ -123,5 +127,13 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{ TSourceEditorInterface }
|
||||||
|
|
||||||
|
procedure TSourceEditorInterface.SelectText(LineNum, CharStart, LineNum2,
|
||||||
|
CharEnd: Integer);
|
||||||
|
begin
|
||||||
|
SelectText(Point(CharStart,LineNum),Point(CharEnd,LineNum2));
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user