first run, changed default option + add a runnable

This commit is contained in:
Basile Burg 2016-02-08 18:35:56 +01:00
parent 1ff8b9e878
commit 36f199f828
3 changed files with 22 additions and 5 deletions

View File

@ -165,10 +165,15 @@ begin
inherited;
//
fFont := TFont.Create;
{$IFDEF WINDOWS}
fFont.Name := 'Courier New';
{$ELSE}
fFont.Name := 'DejaVu Sans Mono';
{$ENDIF}
fFont.Quality := fqProof;
fFont.Pitch := fpFixed;
fFont.Size := 10;
fResetFontSize:=true;
//
fD2Syn := TSynD2Syn.Create(self);
fD2Syn.Assign(D2Syn);

View File

@ -202,6 +202,7 @@ type
fCovModUt: boolean;
fDoc: TCESynMemo;
fFirstTimeCoedit: boolean;
fActionHandler: TCEActionProviderSubject;
fMultidoc: ICEMultiDocHandler;
fScCollectCount: Integer;
@ -996,7 +997,8 @@ begin
begin
fAppliOpts.loadFromFile(fname);
fAppliOpts.assignTo(self);
end;
end
else fFirstTimeCoedit := true;
end;
procedure TCEMainForm.SaveSettings;
@ -1175,6 +1177,9 @@ begin
// TODO-cgonnawork: when Laz 1.6 is rlzd, remove etc/anchordocking and use Laz package
DockMaster.ResetSplitters;
if fFirstTimeCoedit then
actFileNewRun.Execute;
fFirstShown := true;
end;
end;
@ -1609,6 +1614,14 @@ begin
end;
procedure TCEMainForm.actFileNewRunExecute(Sender: TObject);
const
body: array[boolean] of string =
(
LineEnding,
' // this file can be directly executed using menu file/compile & run' + LineEnding +
' // phobos and libman imports are allowed' + LineEnding +
' writeln("hello runnable module");' + LineEnding
);
begin
newFile;
fDoc.Text :=
@ -1618,9 +1631,7 @@ begin
LineEnding +
'void main(string[] args)' + LineEnding +
'{' + LineEnding +
' // this file can be directly executed using menu file/compile & run' + LineEnding +
' // phobos and libman imports are allowed' + LineEnding +
' writeln("hello runnable module");' + LineEnding +
body[fFirstTimeCoedit] +
'}';
fDoc.setFocus;
end;

View File

@ -258,9 +258,10 @@ begin
fRefreshOnFocus := true;
fShowChildCategories := true;
fAutoExpandErrors := true;
fAutoRefresh := true;
fSmartFilter := true;
fSortSymbols := false;
fAutoRefreshDelay := 1500;
fAutoRefreshDelay := 750;
end;
procedure TCESymbolListOptions.Assign(Source: TPersistent);