SynEdit: Make SharedTextBuffer available (DualView)

git-svn-id: trunk@24491 -
This commit is contained in:
martin 2010-04-07 18:20:21 +00:00
parent 82641decdf
commit 1423431a0e
2 changed files with 2 additions and 19 deletions

View File

@ -376,11 +376,8 @@ type
FTheLinesView: TSynEditStrings;
FLines: TSynEditStrings; // The real (un-mapped) line-buffer
FStrings: TStrings; // External TStrings based interface to the Textbuffer
{$IFDEF SynDualView}
FTopLinesView: TSynEditStrings; // The linesview that holds the real line-buffer/FLines
{$ENDIF}
fExtraCharSpacing: integer;
fLinesInWindow: Integer;// MG: fully visible lines in window
fLeftChar: Integer; // first visible screen column
@ -575,10 +572,8 @@ type
procedure UnlockUndo;
procedure UpdateCaret(IgnorePaintLock: Boolean = False);
procedure UpdateScrollBars;
{$IFDEF SynDualView}
procedure ChangeTextBuffer(NewBuffer: TSynEditStringList);
procedure RemoveHandlers(ALines: TSynEditStrings = nil);
{$ENDIF}
protected
procedure CreateHandle; override;
procedure CreateParams(var Params: TCreateParams); override;
@ -885,10 +880,8 @@ type
procedure Invalidate; override;
property ChangeStamp: int64 read fChangeStamp;
{$ENDIF}
{$IFDEF SynDualView}
procedure ShareTextBufferFrom(AShareEditor: TCustomSynEdit);
procedure UnShareTextBuffer;
{$ENDIF}
public
property OnKeyDown;
property OnKeyPress;
@ -1529,9 +1522,7 @@ begin
// Pointer to the First/Lowest View
// TODO: this should be Folded...
FTheLinesView := FTabbedLinesView;
{$IFDEF SynDualView}
FTopLinesView := FTrimmedLinesView;
{$ENDIF}
// External Accessor
FStrings := TSynEditLines.Create(FLines, {$IFDEF FPC}@{$ENDIF}MarkTextAsSaved);
@ -1797,9 +1788,7 @@ begin
TSynEditPlugin(fPlugins[i]).Editor := nil;
FreeAndNil(fPlugins);
end;
{$IFDEF SynDualView}
RemoveHandlers;
{$ENDIF}
FreeAndNil(FHookedKeyTranslationList);
fHookedCommandHandlers:=nil;
@ -4974,7 +4963,6 @@ begin
FMouseSelActions.Assign(AValue);
end;
{$IFDEF SynDualView}
procedure TCustomSynEdit.ChangeTextBuffer(NewBuffer: TSynEditStringList);
var
OldBuffer: TSynEditStringList;
@ -5083,7 +5071,6 @@ begin
for i := 0 to fMarkupManager.Count - 1 do
TSynEditStringList(ALines).RemoveHanlders(fMarkupManager.Markup[i]);
end;
{$ENDIF}
procedure TCustomSynEdit.SetTextBetweenPoints(aStartPoint, aEndPoint: TPoint;
const AValue: String);

View File

@ -217,16 +217,14 @@ type
AHandler: TMethod); override;
procedure RemoveGenericHandler(AReason: TSynEditNotifyReason;
AHandler: TMethod); override;
{$IFDEF SynDualView}
procedure CopyHanlders(OtherLines: TSynEditStringList; AOwner: TObject = nil);
procedure RemoveHanlders(AOwner: TObject);
{$ENDIF}
function GetPhysicalCharWidths(const Line: String; Index: Integer): TPhysicalCharWidths; override;
// For Textbuffersharing
procedure AttachSynEdit(AEdit: TSynEditBase);
procedure DetachSynEdit(AEdit: TSynEditBase);
function AttachedSynEditCount: Integer;
property AttachedSynEdits[Index: Integer]: TSynEditBase read GetAttachedSynEdits;
procedure CopyHanlders(OtherLines: TSynEditStringList; AOwner: TObject = nil);
procedure RemoveHanlders(AOwner: TObject);
public
property DosFileFormat: boolean read fDosFileFormat write fDosFileFormat;
property LengthOfLongestLine: integer read GetLengthOfLongestLine;
@ -959,7 +957,6 @@ begin
end;
end;
{$IFDEF SynDualView}
procedure TSynEditStringList.CopyHanlders(OtherLines: TSynEditStringList; AOwner: TObject = nil);
begin
FLineRangeNotificationList.AddCopyFrom(OtherLines.FLineRangeNotificationList, AOwner);
@ -983,7 +980,6 @@ begin
FOnChangingList.RemoveAllMethodsOfObject(AOwner);
FOnClearedList.RemoveAllMethodsOfObject(AOwner);
end;
{$ENDIF}
procedure TSynEditStringList.SetCapacity(NewCapacity: integer);
begin