added completion menu size as persistent option

This commit is contained in:
Basile Burg 2015-11-22 22:19:27 +01:00
parent 1e1f7bf238
commit 7e1118cc24
2 changed files with 18 additions and 11 deletions

View File

@ -50,6 +50,8 @@ type
fOptions2: TSynEditorOptions2;
fMouseOptions: TSynEditorMouseOptions;
fCompletionMenuCaseCare: boolean;
fCompletionMenuWidth: integer;
fCompletionMenuHeight: integer;
//
procedure setFont(aValue: TFont);
procedure setSelCol(aValue: TSynSelectedColor);
@ -63,6 +65,8 @@ type
procedure setAutoDotDelay(aValue: Integer);
published
property completionMenuCaseCare: boolean read fCompletionMenuCaseCare write fCompletionMenuCaseCare;
property completionMenuWidth: integer read fCompletionMenuWidth write fCompletionMenuWidth;
property completionMenuHeight: integer read fCompletionMenuHeight write fCompletionMenuHeight;
property autoDotDelay: integer read fAutoDotDelay write SetautoDotDelay;
property hintDelay: Integer read fDDocDelay write setDDocDelay stored false; deprecated;
property ddocDelay: Integer read fDDocDelay write setDDocDelay;
@ -172,6 +176,9 @@ begin
fBracketMatchColor.Foreground := clRed;
fBracketMatchColor.Background := clNone;
//
fCompletionMenuHeight:= 260;
fCompletionMenuWidth:= 160;
//
rightEdge := 80;
tabulationWidth := 4;
blockIdentation := 4;
@ -222,6 +229,8 @@ begin
begin
srcopt := TCEEditorOptionsBase(src);
//
fCompletionMenuWidth:=srcopt.fCompletionMenuWidth;
fCompletionMenuHeight:=srcopt.fCompletionMenuHeight;
fCompletionMenuCaseCare:=srcopt.fCompletionMenuCaseCare;
fAutoDotDelay:=srcopt.fAutoDotDelay;
fDDocDelay:=srcopt.fDDocDelay;
@ -347,6 +356,8 @@ end;
procedure TCEEditorOptions.docClosing(aDoc: TCESynMemo);
begin
fCompletionMenuHeight:=aDoc.completionMenu.TheForm.Height;
fCompletionMenuWidth:=aDoc.completionMenu.TheForm.Width;
end;
{$ENDREGION}
@ -468,11 +479,16 @@ begin
anEditor.D2Highlighter.Assign(D2Syn);
anEditor.TxtHighlighter.Assign(TxtSyn);
anEditor.completionMenuCaseCare:=fCompletionMenuCaseCare;
anEditor.autoDotDelay:=fAutoDotDelay;
anEditor.ddocDelay:=fDDocDelay;
anEditor.defaultFontSize := font.Size;
anEditor.Font.Assign(font);
anEditor.completionMenu.TheForm.Height := fCompletionMenuHeight;
anEditor.completionMenu.TheForm.Width := fCompletionMenuWidth;
anEditor.completionMenu.CaseSensitive := fCompletionMenuCaseCare;
anEditor.SelectedColor.Assign(fSelCol);
anEditor.FoldedCodeColor.Assign(fFoldedColor);
anEditor.MouseLinkColor.Assign(fMouseLinkColor);

View File

@ -108,7 +108,6 @@ type
fAutoDotTimer: TIdleTimer;
fCanShowHint: boolean;
fCanAutoDot: boolean;
fCompletionCaseSens: boolean;
fOldMousePos: TPoint;
fSyncEdit: TSynPluginSyncroEdit;
fCompletion: TSynCompletion;
@ -129,7 +128,6 @@ type
procedure AutoDotTimerEvent(sender: TObject);
procedure InitHintWins;
function getIfTemp: boolean;
procedure SetcompletionMenuCaseCare(aValue: boolean);
procedure setDDocDelay(aValue: Integer);
procedure setAutoDotDelay(aValue: Integer);
procedure completionExecute(sender: TObject);
@ -157,7 +155,6 @@ type
property defaultFontSize: Integer read fDefaultFontSize write setDefaultFontSize;
property ddocDelay: Integer read fDDocDelay write setDDocDelay;
property autoDotDelay: Integer read fAutoDotDelay write setAutoDotDelay;
property completionMenuCaseCare: boolean read fCompletionCaseSens write SetcompletionMenuCaseCare;
public
constructor Create(aOwner: TComponent); override;
destructor destroy; override;
@ -183,6 +180,7 @@ type
property modified: boolean read fModified;
property tempFilename: string read fTempFileName;
//
property completionMenu: TSynCompletion read fCompletion;
property syncroEdit: TSynPluginSyncroEdit read fSyncEdit;
property isDSource: boolean read fIsDSource;
property isProjectFile: boolean read fIsConfig; // warning: never set !
@ -451,7 +449,6 @@ begin
fSyncEdit.CaseSensitive := true;
AssignPng(fSyncEdit.GutterGlyph, 'link_edit');
//
fCompletionCaseSens:=false;
fCompletion := TSyncompletion.create(nil);
fCompletion.ShowSizeDrag := true;
fCompletion.Editor := Self;
@ -610,12 +607,6 @@ begin
fDDocTimer.Interval:=fDDocDelay;
end;
procedure TCESynMemo.SetcompletionMenuCaseCare(aValue: boolean);
begin
fCompletionCaseSens:=aValue;
fCompletion.CaseSensitive:=aValue;
end;
procedure TCESynMemo.DDocTimerEvent(sender: TObject);
begin
if not Visible then exit;