mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:40:56 +02:00
MG: added default pascal file extension option
git-svn-id: trunk@474 -
This commit is contained in:
parent
72ac82e66c
commit
5e7d79f6e4
@ -70,7 +70,7 @@ const
|
|||||||
|
|
||||||
LazSyntaxHighlighterClasses: array[TLazSyntaxHighlighter] of TCustomSynClass =
|
LazSyntaxHighlighterClasses: array[TLazSyntaxHighlighter] of TCustomSynClass =
|
||||||
( nil, nil, TSynPasSyn, TSynPasSyn, nil, nil, TSynHTMLSyn, TSynCPPSyn);
|
( nil, nil, TSynPasSyn, TSynPasSyn, nil, nil, TSynHTMLSyn, TSynCPPSyn);
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TEditOptLanguageInfo stores lazarus IDE additional information
|
{ TEditOptLanguageInfo stores lazarus IDE additional information
|
||||||
of a highlighter, such as samplesource, which sample lines are special
|
of a highlighter, such as samplesource, which sample lines are special
|
||||||
@ -94,6 +94,7 @@ type
|
|||||||
MappedAttributes: TStringList; // map attributes to pascal
|
MappedAttributes: TStringList; // map attributes to pascal
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function GetDefaultFilextension: string;
|
||||||
function SampleLineToAddAttr(Line: integer): TAdditionalHilightAttribute;
|
function SampleLineToAddAttr(Line: integer): TAdditionalHilightAttribute;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ type
|
|||||||
function FindByName(const Name: string): integer;
|
function FindByName(const Name: string): integer;
|
||||||
function FindByClass(CustomSynClass: TCustomSynClass): integer;
|
function FindByClass(CustomSynClass: TCustomSynClass): integer;
|
||||||
function FindByType(AType: TLazSyntaxHighlighter): integer;
|
function FindByType(AType: TLazSyntaxHighlighter): integer;
|
||||||
|
function GetDefaultFilextension(AType: TLazSyntaxHighlighter): string;
|
||||||
property Items[Index: integer]: TEditOptLanguageInfo read GetInfos; default;
|
property Items[Index: integer]: TEditOptLanguageInfo read GetInfos; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -639,6 +641,19 @@ begin
|
|||||||
Result:=ahaNone;
|
Result:=ahaNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TEditOptLanguageInfo.GetDefaultFilextension: string;
|
||||||
|
var p: integer;
|
||||||
|
begin
|
||||||
|
// read the first file extension
|
||||||
|
p:=1;
|
||||||
|
while (p<=length(FileExtensions)) and (FileExtensions[p]<>';') do
|
||||||
|
inc(p);
|
||||||
|
if p>1 then
|
||||||
|
Result:='.'+copy(FileExtensions,1,p-1)
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
|
||||||
{ TEditOptLangList }
|
{ TEditOptLangList }
|
||||||
|
|
||||||
function TEditOptLangList.GetInfos(
|
function TEditOptLangList.GetInfos(
|
||||||
@ -804,6 +819,17 @@ begin
|
|||||||
dec(Result);
|
dec(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TEditOptLangList.GetDefaultFilextension(
|
||||||
|
AType: TLazSyntaxHighlighter): string;
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
i:=FindByType(AType);
|
||||||
|
if i>=0 then
|
||||||
|
Result:=Items[i].GetDefaultFilextension
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
|
||||||
{ TEditorOptions }
|
{ TEditorOptions }
|
||||||
|
|
||||||
constructor TEditorOptions.Create;
|
constructor TEditorOptions.Create;
|
||||||
|
@ -25,7 +25,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, Buttons, XMLCfg, ObjectInspector,
|
Classes, SysUtils, Forms, Controls, Buttons, XMLCfg, ObjectInspector,
|
||||||
ExtCtrls, StdCtrls, EditorOptions, LResources, LazConf, Dialogs, ExtToolDialog;
|
ExtCtrls, StdCtrls, EditorOptions, LResources, LazConf, Dialogs,
|
||||||
|
ExtToolDialog, IDEProcs;
|
||||||
|
|
||||||
const
|
const
|
||||||
EnvOptsVersion: integer = 101;
|
EnvOptsVersion: integer = 101;
|
||||||
@ -49,11 +50,15 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TDebuggerType = (dtNone, dtGnuDebugger);
|
TDebuggerType = (dtNone, dtGnuDebugger);
|
||||||
|
|
||||||
|
TPascalExtType = (petNone, petPAS, petPP);
|
||||||
|
|
||||||
const
|
const
|
||||||
DebuggerName : array[TDebuggerType] of string = (
|
DebuggerName : array[TDebuggerType] of string = (
|
||||||
'(None)','GNU debugger (gdb)'
|
'(None)','GNU debugger (gdb)'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PascalExtension: array[TPascalExtType] of string = ('', '.pas', '.pp');
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -110,6 +115,9 @@ type
|
|||||||
|
|
||||||
// external tools
|
// external tools
|
||||||
fExternalTools: TExternalToolList;
|
fExternalTools: TExternalToolList;
|
||||||
|
|
||||||
|
// naming conventions
|
||||||
|
fPascalFileExtension: TPascalExtType;
|
||||||
|
|
||||||
procedure SetFileName(const NewFilename: string);
|
procedure SetFileName(const NewFilename: string);
|
||||||
procedure AddToRecentList(const AFilename: string; RecentList: TStringList;
|
procedure AddToRecentList(const AFilename: string; RecentList: TStringList;
|
||||||
@ -199,6 +207,9 @@ type
|
|||||||
// external tools
|
// external tools
|
||||||
property ExternalTools: TExternalToolList
|
property ExternalTools: TExternalToolList
|
||||||
read fExternalTools write fExternalTools;
|
read fExternalTools write fExternalTools;
|
||||||
|
|
||||||
|
property PascalFileExtension: TPascalExtType
|
||||||
|
read fPascalFileExtension write fPascalFileExtension;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -216,6 +227,7 @@ type
|
|||||||
procedure SetupDesktopPage;
|
procedure SetupDesktopPage;
|
||||||
procedure SetupBackupPage;
|
procedure SetupBackupPage;
|
||||||
procedure SetupFilesPage;
|
procedure SetupFilesPage;
|
||||||
|
procedure SetupNamingPage;
|
||||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString);
|
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString);
|
||||||
|
|
||||||
published
|
published
|
||||||
@ -290,6 +302,9 @@ type
|
|||||||
BakOtherMaxCounterComboBox: TComboBox;
|
BakOtherMaxCounterComboBox: TComboBox;
|
||||||
BakOtherSubDirLabel: TLabel;
|
BakOtherSubDirLabel: TLabel;
|
||||||
BakOtherSubDirComboBox: TComboBox;
|
BakOtherSubDirComboBox: TComboBox;
|
||||||
|
|
||||||
|
// naming conventions
|
||||||
|
PascalFileExtRadiogroup: TRadioGroup;
|
||||||
|
|
||||||
// buttons at bottom
|
// buttons at bottom
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
@ -317,7 +332,7 @@ var
|
|||||||
EnvironmentOptions: TEnvironmentOptions;
|
EnvironmentOptions: TEnvironmentOptions;
|
||||||
|
|
||||||
function DebuggerNameToType(const s: string): TDebuggerType;
|
function DebuggerNameToType(const s: string): TDebuggerType;
|
||||||
|
function PascalExtToType(const Ext: string): TPascalExtType;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -328,6 +343,13 @@ begin
|
|||||||
Result:=dtNone;
|
Result:=dtNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function PascalExtToType(const Ext: string): TPascalExtType;
|
||||||
|
begin
|
||||||
|
if Ext<>'' then
|
||||||
|
for Result:=Low(TPascalExtType) to High(TPascalExtType) do
|
||||||
|
if CompareFilenames(Ext,PascalExtension[Result])=0 then exit;
|
||||||
|
Result:=petNone;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TEnvironmentOptions }
|
{ TEnvironmentOptions }
|
||||||
|
|
||||||
@ -400,6 +422,8 @@ begin
|
|||||||
|
|
||||||
// external tools
|
// external tools
|
||||||
fExternalTools:=TExternalToolList.Create;
|
fExternalTools:=TExternalToolList.Create;
|
||||||
|
|
||||||
|
fPascalFileExtension:=petPAS;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TEnvironmentOptions.Destroy;
|
destructor TEnvironmentOptions.Destroy;
|
||||||
@ -441,7 +465,7 @@ var XMLConfig: TXMLConfig;
|
|||||||
ARect.Bottom:=XMLConfig.GetValue(AKey+'/Bottom',ARect.Bottom);
|
ARect.Bottom:=XMLConfig.GetValue(AKey+'/Bottom',ARect.Bottom);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LoadBackupInfo(var BackupInfo: TBackupInfo; Path:string);
|
procedure LoadBackupInfo(var BackupInfo: TBackupInfo; const Path:string);
|
||||||
var i:integer;
|
var i:integer;
|
||||||
begin
|
begin
|
||||||
with BackupInfo do begin
|
with BackupInfo do begin
|
||||||
@ -464,7 +488,7 @@ var XMLConfig: TXMLConfig;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LoadRecentList(List: TStringList; Path: string);
|
procedure LoadRecentList(List: TStringList; const Path: string);
|
||||||
var i,Count: integer;
|
var i,Count: integer;
|
||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
@ -476,7 +500,8 @@ var XMLConfig: TXMLConfig;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LoadDebuggerType(var ADebuggerType: TDebuggerType; Path: string);
|
procedure LoadDebuggerType(var ADebuggerType: TDebuggerType;
|
||||||
|
const Path: string);
|
||||||
var i:integer;
|
var i:integer;
|
||||||
begin
|
begin
|
||||||
i:=XMLConfig.GetValue(Path+'DebuggerType/Value',5);
|
i:=XMLConfig.GetValue(Path+'DebuggerType/Value',5);
|
||||||
@ -486,6 +511,14 @@ var XMLConfig: TXMLConfig;
|
|||||||
ADebuggerType:=dtNone;
|
ADebuggerType:=dtNone;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure LoadPascalFileExt(const Path: string);
|
||||||
|
begin
|
||||||
|
fPascalFileExtension:=PascalExtToType(XMLConfig.GetValue(
|
||||||
|
Path+'Naming/PascalFileExtension',PascalExtension[petPAS]));
|
||||||
|
if fPascalFileExtension=petNone then
|
||||||
|
fPascalFileExtension:=petPAS;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
@ -572,6 +605,9 @@ begin
|
|||||||
|
|
||||||
// external tools
|
// external tools
|
||||||
fExternalTools.Load(XMLConfig,'EnvironmentOptions/ExternalTools/');
|
fExternalTools.Load(XMLConfig,'EnvironmentOptions/ExternalTools/');
|
||||||
|
|
||||||
|
// naming
|
||||||
|
LoadPascalFileExt('EnvironmentOptions/');
|
||||||
|
|
||||||
XMLConfig.Free;
|
XMLConfig.Free;
|
||||||
|
|
||||||
@ -713,6 +749,10 @@ begin
|
|||||||
// external tools
|
// external tools
|
||||||
fExternalTools.Save(XMLConfig,'EnvironmentOptions/ExternalTools/');
|
fExternalTools.Save(XMLConfig,'EnvironmentOptions/ExternalTools/');
|
||||||
|
|
||||||
|
// naming
|
||||||
|
XMLConfig.SetValue('EnvironmentOptions/Naming/PascalFileExtension',
|
||||||
|
PascalExtension[fPascalFileExtension]);
|
||||||
|
|
||||||
XMLConfig.Flush;
|
XMLConfig.Flush;
|
||||||
XMLConfig.Free;
|
XMLConfig.Free;
|
||||||
|
|
||||||
@ -772,11 +812,13 @@ begin
|
|||||||
Pages[0]:='Desktop';
|
Pages[0]:='Desktop';
|
||||||
Pages.Add('Files');
|
Pages.Add('Files');
|
||||||
Pages.Add('Backup');
|
Pages.Add('Backup');
|
||||||
|
Pages.Add('Naming');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SetupDesktopPage;
|
SetupDesktopPage;
|
||||||
SetupFilesPage;
|
SetupFilesPage;
|
||||||
SetupBackupPage;
|
SetupBackupPage;
|
||||||
|
SetupNamingPage;
|
||||||
|
|
||||||
NoteBook.Show;
|
NoteBook.Show;
|
||||||
|
|
||||||
@ -790,7 +832,7 @@ begin
|
|||||||
Top:=Self.ClientHeight-Height-15;
|
Top:=Self.ClientHeight-Height-15;
|
||||||
Caption:='Cancel';
|
Caption:='Cancel';
|
||||||
OnClick:=@CancelButtonClick;
|
OnClick:=@CancelButtonClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
OkButton:=TButton.Create(Self);
|
OkButton:=TButton.Create(Self);
|
||||||
@ -803,7 +845,7 @@ begin
|
|||||||
Top:=CancelButton.Top;
|
Top:=CancelButton.Top;
|
||||||
Caption:='Ok';
|
Caption:='Ok';
|
||||||
OnClick:=@OkButtonClick;
|
OnClick:=@OkButtonClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -831,7 +873,7 @@ begin
|
|||||||
Width:=(MaxX div 2) - 15;
|
Width:=(MaxX div 2) - 15;
|
||||||
Height:=108;
|
Height:=108;
|
||||||
Caption:='Auto save';
|
Caption:='Auto save';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AutoSaveEditorFilesCheckBox:=TCheckBox.Create(Self);
|
AutoSaveEditorFilesCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -844,7 +886,7 @@ begin
|
|||||||
Height:=20;
|
Height:=20;
|
||||||
Caption:='Editor files';
|
Caption:='Editor files';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AutoSaveProjectCheckBox:=TCheckBox.Create(Self);
|
AutoSaveProjectCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -857,7 +899,7 @@ begin
|
|||||||
Height:=20;
|
Height:=20;
|
||||||
Caption:='Project';
|
Caption:='Project';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AutoSaveIntervalInSecsLabel:=TLabel.Create(Self);
|
AutoSaveIntervalInSecsLabel:=TLabel.Create(Self);
|
||||||
@ -870,7 +912,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Interval in secs';
|
Caption:='Interval in secs';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AutoSaveIntervalInSecsComboBox:=TComboBox.Create(Self);
|
AutoSaveIntervalInSecsComboBox:=TComboBox.Create(Self);
|
||||||
@ -890,7 +932,7 @@ begin
|
|||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -904,7 +946,7 @@ begin
|
|||||||
Width:=AutoSaveGroupBox.Width;
|
Width:=AutoSaveGroupBox.Width;
|
||||||
Height:=50;
|
Height:=50;
|
||||||
Caption:='Windows';
|
Caption:='Windows';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SaveWindowPositionsCheckBox:=TCheckBox.Create(Self);
|
SaveWindowPositionsCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -916,7 +958,7 @@ begin
|
|||||||
Width:=WindowsGroupBox.ClientWidth-2*Left;
|
Width:=WindowsGroupBox.ClientWidth-2*Left;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Save window positions';
|
Caption:='Save window positions';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// desktop files
|
// desktop files
|
||||||
@ -929,7 +971,7 @@ begin
|
|||||||
Width:=WindowsGroupBox.Width;
|
Width:=WindowsGroupBox.Width;
|
||||||
Height:=90;
|
Height:=90;
|
||||||
Caption:='Desktop files';
|
Caption:='Desktop files';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SaveDesktopSettingsToFileButton:=TButton.Create(Self);
|
SaveDesktopSettingsToFileButton:=TButton.Create(Self);
|
||||||
@ -942,7 +984,7 @@ begin
|
|||||||
Height:=25;
|
Height:=25;
|
||||||
Caption:='Save desktop settings to file';
|
Caption:='Save desktop settings to file';
|
||||||
OnClick:=@SaveDesktopSettingsToFileButtonClick;
|
OnClick:=@SaveDesktopSettingsToFileButtonClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LoadDesktopSettingsFromFileButton:=TButton.Create(Self);
|
LoadDesktopSettingsFromFileButton:=TButton.Create(Self);
|
||||||
@ -955,7 +997,7 @@ begin
|
|||||||
Height:=25;
|
Height:=25;
|
||||||
Caption:='Load desktop settings from file';
|
Caption:='Load desktop settings from file';
|
||||||
OnClick:=@LoadDesktopSettingsFromFileButtonClick;
|
OnClick:=@LoadDesktopSettingsFromFileButtonClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -969,7 +1011,7 @@ begin
|
|||||||
Width:=AutoSaveGroupBox.Width;
|
Width:=AutoSaveGroupBox.Width;
|
||||||
Height:=203;
|
Height:=203;
|
||||||
Caption:='Form editor';
|
Caption:='Form editor';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DisplayGridCheckBox:=TCheckBox.Create(Self);
|
DisplayGridCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -982,7 +1024,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Display grid';
|
Caption:='Display grid';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SnapToGridCheckBox:=TCheckBox.Create(Self);
|
SnapToGridCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -995,7 +1037,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Snap to grid';
|
Caption:='Snap to grid';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ShowComponentCaptionsCheckBox:=TCheckBox.Create(Self);
|
ShowComponentCaptionsCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -1008,7 +1050,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Show component captions';
|
Caption:='Show component captions';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ShowEditorHintsCheckBox:=TCheckBox.Create(Self);
|
ShowEditorHintsCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -1021,7 +1063,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Show editor hints';
|
Caption:='Show editor hints';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AutoCreateFormsCheckBox:=TCheckBox.Create(Self);
|
AutoCreateFormsCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -1034,7 +1076,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Auto create forms';
|
Caption:='Auto create forms';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
GridSizeXLabel:=TLabel.Create(Self);
|
GridSizeXLabel:=TLabel.Create(Self);
|
||||||
@ -1047,7 +1089,7 @@ begin
|
|||||||
Height:=20;
|
Height:=20;
|
||||||
Caption:='Grid size X';
|
Caption:='Grid size X';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
GridSizeXComboBox:=TComboBox.Create(Self);
|
GridSizeXComboBox:=TComboBox.Create(Self);
|
||||||
@ -1067,7 +1109,7 @@ begin
|
|||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
GridSizeYLabel:=TLabel.Create(Self);
|
GridSizeYLabel:=TLabel.Create(Self);
|
||||||
@ -1080,7 +1122,7 @@ begin
|
|||||||
Height:=20;
|
Height:=20;
|
||||||
Caption:='Grid size Y';
|
Caption:='Grid size Y';
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
GridSizeYComboBox:=TComboBox.Create(Self);
|
GridSizeYComboBox:=TComboBox.Create(Self);
|
||||||
@ -1100,7 +1142,7 @@ begin
|
|||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// object inspector
|
// object inspector
|
||||||
@ -1113,7 +1155,7 @@ begin
|
|||||||
Width:=FormEditorGroupBox.Width;
|
Width:=FormEditorGroupBox.Width;
|
||||||
Height:=50;
|
Height:=50;
|
||||||
Caption:='Object inspector';
|
Caption:='Object inspector';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BackgroundColorButton:=TColorButton.Create(Self);
|
BackgroundColorButton:=TColorButton.Create(Self);
|
||||||
@ -1124,7 +1166,7 @@ begin
|
|||||||
Top:=2;
|
Top:=2;
|
||||||
Width:=50;
|
Width:=50;
|
||||||
Height:=25;
|
Height:=25;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BackgroundColorLabel:=TLabel.Create(Self);
|
BackgroundColorLabel:=TLabel.Create(Self);
|
||||||
@ -1136,7 +1178,7 @@ begin
|
|||||||
Width:=ObjectInspectorGroupBox.ClientWidth-Left-5;
|
Width:=ObjectInspectorGroupBox.ClientWidth-Left-5;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Background color';
|
Caption:='Background color';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -1155,7 +1197,7 @@ begin
|
|||||||
Width:=MaxX-Left*2;
|
Width:=MaxX-Left*2;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Notes: ';
|
Caption:='Notes: ';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BackupProjectGroupBox:=TGroupBox.Create(Self);
|
BackupProjectGroupBox:=TGroupBox.Create(Self);
|
||||||
@ -1167,7 +1209,7 @@ begin
|
|||||||
Width:=(MaxX div 2) - 11;
|
Width:=(MaxX div 2) - 11;
|
||||||
Height:=260;
|
Height:=260;
|
||||||
Caption:='Project files';
|
Caption:='Project files';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjTypeRadioGroup:=TRadioGroup.Create(Self);
|
BakProjTypeRadioGroup:=TRadioGroup.Create(Self);
|
||||||
@ -1190,7 +1232,7 @@ begin
|
|||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
OnClick:=@BakTypeRadioGroupClick;
|
OnClick:=@BakTypeRadioGroupClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjAddExtLabel:=TLabel.Create(Self);
|
BakProjAddExtLabel:=TLabel.Create(Self);
|
||||||
@ -1202,7 +1244,7 @@ begin
|
|||||||
Width:=BakProjTypeRadioGroup.Width-62;
|
Width:=BakProjTypeRadioGroup.Width-62;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='User defined extension';
|
Caption:='User defined extension';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjAddExtComboBox:=TComboBox.Create(Self);
|
BakProjAddExtComboBox:=TComboBox.Create(Self);
|
||||||
@ -1219,7 +1261,7 @@ begin
|
|||||||
Add('old');
|
Add('old');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjMaxCounterLabel:=TLabel.Create(Self);
|
BakProjMaxCounterLabel:=TLabel.Create(Self);
|
||||||
@ -1231,7 +1273,7 @@ begin
|
|||||||
Width:=110;
|
Width:=110;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Maximum counter';
|
Caption:='Maximum counter';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjMaxCounterComboBox:=TComboBox.Create(Self);
|
BakProjMaxCounterComboBox:=TComboBox.Create(Self);
|
||||||
@ -1252,7 +1294,7 @@ begin
|
|||||||
Add(BakMaxCounterInfiniteTxt);
|
Add(BakMaxCounterInfiniteTxt);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjSubDirLabel:=TLabel.Create(Self);
|
BakProjSubDirLabel:=TLabel.Create(Self);
|
||||||
@ -1264,7 +1306,7 @@ begin
|
|||||||
Width:=110;
|
Width:=110;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Sub directory';
|
Caption:='Sub directory';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakProjSubDirComboBox:=TComboBox.Create(Self);
|
BakProjSubDirComboBox:=TComboBox.Create(Self);
|
||||||
@ -1281,7 +1323,7 @@ begin
|
|||||||
Add('backup');
|
Add('backup');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BackupOtherGroupBox:=TGroupBox.Create(Self);
|
BackupOtherGroupBox:=TGroupBox.Create(Self);
|
||||||
@ -1293,7 +1335,7 @@ begin
|
|||||||
Width:=(MaxX div 2) - 11;
|
Width:=(MaxX div 2) - 11;
|
||||||
Height:=260;
|
Height:=260;
|
||||||
Caption:='Other files';
|
Caption:='Other files';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherTypeRadioGroup:=TRadioGroup.Create(Self);
|
BakOtherTypeRadioGroup:=TRadioGroup.Create(Self);
|
||||||
@ -1316,7 +1358,7 @@ begin
|
|||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
OnClick:=@BakTypeRadioGroupClick;
|
OnClick:=@BakTypeRadioGroupClick;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherAddExtLabel:=TLabel.Create(Self);
|
BakOtherAddExtLabel:=TLabel.Create(Self);
|
||||||
@ -1328,7 +1370,7 @@ begin
|
|||||||
Width:=BakOtherTypeRadioGroup.Width-62;
|
Width:=BakOtherTypeRadioGroup.Width-62;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='User defined extension';
|
Caption:='User defined extension';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherAddExtComboBox:=TComboBox.Create(Self);
|
BakOtherAddExtComboBox:=TComboBox.Create(Self);
|
||||||
@ -1345,7 +1387,7 @@ begin
|
|||||||
Add('old');
|
Add('old');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherMaxCounterLabel:=TLabel.Create(Self);
|
BakOtherMaxCounterLabel:=TLabel.Create(Self);
|
||||||
@ -1357,7 +1399,7 @@ begin
|
|||||||
Width:=110;
|
Width:=110;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Maximum counter';
|
Caption:='Maximum counter';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherMaxCounterComboBox:=TComboBox.Create(Self);
|
BakOtherMaxCounterComboBox:=TComboBox.Create(Self);
|
||||||
@ -1378,7 +1420,7 @@ begin
|
|||||||
Add(BakMaxCounterInfiniteTxt);
|
Add(BakMaxCounterInfiniteTxt);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherSubDirLabel:=TLabel.Create(Self);
|
BakOtherSubDirLabel:=TLabel.Create(Self);
|
||||||
@ -1390,7 +1432,7 @@ begin
|
|||||||
Width:=110;
|
Width:=110;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Sub directory';
|
Caption:='Sub directory';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BakOtherSubDirComboBox:=TComboBox.Create(Self);
|
BakOtherSubDirComboBox:=TComboBox.Create(Self);
|
||||||
@ -1407,7 +1449,7 @@ begin
|
|||||||
Add('backup');
|
Add('backup');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1426,7 +1468,7 @@ begin
|
|||||||
Width:=150;
|
Width:=150;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Max recent files';
|
Caption:='Max recent files';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
MaxRecentOpenFilesComboBox:=TComboBox.Create(Self);
|
MaxRecentOpenFilesComboBox:=TComboBox.Create(Self);
|
||||||
@ -1447,7 +1489,7 @@ begin
|
|||||||
Add('30');
|
Add('30');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
MaxRecentProjectFilesLabel:=TLabel.Create(Self);
|
MaxRecentProjectFilesLabel:=TLabel.Create(Self);
|
||||||
@ -1459,7 +1501,7 @@ begin
|
|||||||
Width:=MaxRecentOpenFilesLabel.Width;
|
Width:=MaxRecentOpenFilesLabel.Width;
|
||||||
Height:=MaxRecentOpenFilesLabel.Height;
|
Height:=MaxRecentOpenFilesLabel.Height;
|
||||||
Caption:='Max recent project files';
|
Caption:='Max recent project files';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
MaxRecentProjectFilesComboBox:=TComboBox.Create(Self);
|
MaxRecentProjectFilesComboBox:=TComboBox.Create(Self);
|
||||||
@ -1480,7 +1522,7 @@ begin
|
|||||||
Add('30');
|
Add('30');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
OpenLastProjectAtStartCheckBox:=TCheckBox.Create(Self);
|
OpenLastProjectAtStartCheckBox:=TCheckBox.Create(Self);
|
||||||
@ -1492,7 +1534,7 @@ begin
|
|||||||
Width:=MaxX-10;
|
Width:=MaxX-10;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Open last project at start';
|
Caption:='Open last project at start';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LazarusDirLabel:=TLabel.Create(Self);
|
LazarusDirLabel:=TLabel.Create(Self);
|
||||||
@ -1505,7 +1547,7 @@ begin
|
|||||||
Width:=MaxX-10;
|
Width:=MaxX-10;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Lazarus directory (default for all projects)';
|
Caption:='Lazarus directory (default for all projects)';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LazarusDirComboBox:=TComboBox.Create(Self);
|
LazarusDirComboBox:=TComboBox.Create(Self);
|
||||||
@ -1521,7 +1563,7 @@ begin
|
|||||||
Add(ExtractFilePath(ParamStr(0)));
|
Add(ExtractFilePath(ParamStr(0)));
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CompilerPathLabel:=TLabel.Create(Self);
|
CompilerPathLabel:=TLabel.Create(Self);
|
||||||
@ -1533,7 +1575,7 @@ begin
|
|||||||
Width:=LazarusDirLabel.Width;
|
Width:=LazarusDirLabel.Width;
|
||||||
Height:=25;
|
Height:=25;
|
||||||
Caption:='Compiler path (ppc386)';
|
Caption:='Compiler path (ppc386)';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CompilerPathComboBox:=TComboBox.Create(Self);
|
CompilerPathComboBox:=TComboBox.Create(Self);
|
||||||
@ -1550,7 +1592,7 @@ begin
|
|||||||
Add('/opt/fpc/ppc386');
|
Add('/opt/fpc/ppc386');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FPCSourceDirLabel:=TLabel.Create(Self);
|
FPCSourceDirLabel:=TLabel.Create(Self);
|
||||||
@ -1562,7 +1604,7 @@ begin
|
|||||||
Width:=LazarusDirLabel.Width;
|
Width:=LazarusDirLabel.Width;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='FPC source directory';
|
Caption:='FPC source directory';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FPCSourceDirComboBox:=TComboBox.Create(Self);
|
FPCSourceDirComboBox:=TComboBox.Create(Self);
|
||||||
@ -1578,7 +1620,7 @@ begin
|
|||||||
Add('');
|
Add('');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebuggerPathLabel:=TLabel.Create(Self);
|
DebuggerPathLabel:=TLabel.Create(Self);
|
||||||
@ -1590,7 +1632,7 @@ begin
|
|||||||
Width:=FPCSourceDirLabel.Width;
|
Width:=FPCSourceDirLabel.Width;
|
||||||
Height:=25;
|
Height:=25;
|
||||||
Caption:='Debugger type and path';
|
Caption:='Debugger type and path';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebuggerTypeComboBox:=TComboBox.Create(Self);
|
DebuggerTypeComboBox:=TComboBox.Create(Self);
|
||||||
@ -1607,7 +1649,7 @@ begin
|
|||||||
Add(DebuggerName[ADebuggerType]);
|
Add(DebuggerName[ADebuggerType]);
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebuggerPathComboBox:=TComboBox.Create(Self);
|
DebuggerPathComboBox:=TComboBox.Create(Self);
|
||||||
@ -1625,7 +1667,7 @@ begin
|
|||||||
Add('/opt/fpc/gdb');
|
Add('/opt/fpc/gdb');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TestBuildDirLabel:=TLabel.Create(Self);
|
TestBuildDirLabel:=TLabel.Create(Self);
|
||||||
@ -1637,7 +1679,7 @@ begin
|
|||||||
Width:=LazarusDirLabel.Width;
|
Width:=LazarusDirLabel.Width;
|
||||||
Height:=23;
|
Height:=23;
|
||||||
Caption:='Directory for building test projects';
|
Caption:='Directory for building test projects';
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TestBuildDirComboBox:=TComboBox.Create(Self);
|
TestBuildDirComboBox:=TComboBox.Create(Self);
|
||||||
@ -1656,10 +1698,37 @@ begin
|
|||||||
Add('c:/windows/temp');
|
Add('c:/windows/temp');
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
Show;
|
Visible:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TEnvironmentOptionsDialog.SetupNamingPage;
|
||||||
|
var //MaxX:integer;
|
||||||
|
pe: TPascalExtType;
|
||||||
|
begin
|
||||||
|
//MaxX:=ClientWidth-5;
|
||||||
|
|
||||||
|
PascalFileExtRadiogroup:=TRadioGroup.Create(Self);
|
||||||
|
with PascalFileExtRadiogroup do begin
|
||||||
|
Name:='PascalFileExtRadiogroup';
|
||||||
|
Parent:=NoteBook.Page[3];
|
||||||
|
Left:=5;
|
||||||
|
Top:=4;
|
||||||
|
Width:=150;
|
||||||
|
Height:=80;
|
||||||
|
Caption:='Default pascal extension';
|
||||||
|
with Items do begin
|
||||||
|
BeginUpdate;
|
||||||
|
for pe:=Low(TPascalExtType) to High(TPascalExtType) do
|
||||||
|
if pe<>petNone then
|
||||||
|
Add(PascalExtension[pe]);
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TEnvironmentOptionsDialog.BakTypeRadioGroupClick(Sender: TObject);
|
procedure TEnvironmentOptionsDialog.BakTypeRadioGroupClick(Sender: TObject);
|
||||||
var i: integer;
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
@ -1753,6 +1822,7 @@ end;
|
|||||||
|
|
||||||
procedure TEnvironmentOptionsDialog.ReadSettings(
|
procedure TEnvironmentOptionsDialog.ReadSettings(
|
||||||
AnEnvironmentOptions: TEnvironmentOptions);
|
AnEnvironmentOptions: TEnvironmentOptions);
|
||||||
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
with AnEnvironmentOptions do begin
|
with AnEnvironmentOptions do begin
|
||||||
// auto save
|
// auto save
|
||||||
@ -1831,6 +1901,11 @@ begin
|
|||||||
SetComboBoxText(BakOtherSubDirComboBox,BakNoSubDirTxt);
|
SetComboBoxText(BakOtherSubDirComboBox,BakNoSubDirTxt);
|
||||||
end;
|
end;
|
||||||
BakTypeRadioGroupClick(BakOtherTypeRadioGroup);
|
BakTypeRadioGroupClick(BakOtherTypeRadioGroup);
|
||||||
|
|
||||||
|
// naming
|
||||||
|
for i:=0 to PascalFileExtRadiogroup.Items.Count-1 do
|
||||||
|
if PascalFileExtRadiogroup.Items[i]=PascalExtension[PascalFileExtension]
|
||||||
|
then PascalFileExtRadiogroup.ItemIndex:=i;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1914,6 +1989,13 @@ begin
|
|||||||
else
|
else
|
||||||
SubDirectory:=BakOtherSubDirComboBox.Text;
|
SubDirectory:=BakOtherSubDirComboBox.Text;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// naming
|
||||||
|
if PascalFileExtRadiogroup.ItemIndex>=0 then
|
||||||
|
PascalFileExtension:=PascalExtToType(
|
||||||
|
PascalFileExtRadiogroup.Items[PascalFileExtRadiogroup.ItemIndex])
|
||||||
|
else
|
||||||
|
PascalFileExtension:=petPAS;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
81
ide/main.pp
81
ide/main.pp
@ -346,6 +346,7 @@ type
|
|||||||
procedure DoCompleteCodeAtCursor;
|
procedure DoCompleteCodeAtCursor;
|
||||||
function DoInitDebugger: TModalResult;
|
function DoInitDebugger: TModalResult;
|
||||||
function DoCheckSyntax: TModalResult;
|
function DoCheckSyntax: TModalResult;
|
||||||
|
procedure UpdateDefaultPascalFileExtensions;
|
||||||
|
|
||||||
procedure LoadMainMenu;
|
procedure LoadMainMenu;
|
||||||
procedure LoadSpeedbuttons;
|
procedure LoadSpeedbuttons;
|
||||||
@ -463,6 +464,7 @@ begin
|
|||||||
SetLazarusDefaultFilename;
|
SetLazarusDefaultFilename;
|
||||||
Load(false);
|
Load(false);
|
||||||
end;
|
end;
|
||||||
|
UpdateDefaultPascalFileExtensions;
|
||||||
|
|
||||||
EditorOpts:=TEditorOptions.Create;
|
EditorOpts:=TEditorOptions.Create;
|
||||||
EditorOpts.Load;
|
EditorOpts.Load;
|
||||||
@ -1984,18 +1986,6 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.LoadDesktopSettings(
|
procedure TMainIDE.LoadDesktopSettings(
|
||||||
TheEnvironmentOptions: TEnvironmentOptions);
|
TheEnvironmentOptions: TEnvironmentOptions);
|
||||||
var
|
|
||||||
MacroValueChanged: boolean;
|
|
||||||
|
|
||||||
procedure ChangeMacroValue(const MacroName, NewValue: string);
|
|
||||||
begin
|
|
||||||
with CodeToolBoss.GlobalValues do begin
|
|
||||||
if Variables[ExternalMacroStart+MacroName]=NewValue then exit;
|
|
||||||
Variables[ExternalMacroStart+MacroName]:=NewValue;
|
|
||||||
end;
|
|
||||||
MacroValueChanged:=true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
with TheEnvironmentOptions do begin
|
with TheEnvironmentOptions do begin
|
||||||
if WindowPositionsValid then begin
|
if WindowPositionsValid then begin
|
||||||
@ -2009,13 +1999,21 @@ begin
|
|||||||
ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
ObjectInspectorOptions.AssignTo(ObjectInspector1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// set global variables
|
end;
|
||||||
ChangeMacroValue('LazarusSrcDir',TheEnvironmentOptions.LazarusDirectory);
|
|
||||||
ChangeMacroValue('FPCSrcDir',TheEnvironmentOptions.FPCSourceDirectory);
|
procedure TMainIDE.UpdateDefaultPascalFileExtensions;
|
||||||
if MacroValueChanged then CodeToolBoss.DefineTree.ClearCache;
|
var nut: TNewUnitType;
|
||||||
// ToDo:
|
npt: TProjectType;
|
||||||
// - rescan compiler
|
DefPasExt: string;
|
||||||
// - rescan fpc source directory
|
begin
|
||||||
|
// change default pascal file extensions
|
||||||
|
DefPasExt:=PascalExtension[EnvironmentOptions.PascalFileExtension];
|
||||||
|
for nut:=Low(TNewUnitType) to High(TNewUnitType) do
|
||||||
|
if (UnitTypeDefaultExt[nut]='.pas') or (UnitTypeDefaultExt[nut]='.pp')
|
||||||
|
then UnitTypeDefaultExt[nut]:=DefPasExt;
|
||||||
|
for npt:=Low(TProjectType) to High(TProjectType) do
|
||||||
|
if (ProjectDefaultExt[npt]='.pas') or (ProjectDefaultExt[npt]='.pp')
|
||||||
|
then ProjectDefaultExt[npt]:=DefPasExt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.OnLoadEnvironmentSettings(Sender: TObject;
|
procedure TMainIDE.OnLoadEnvironmentSettings(Sender: TObject;
|
||||||
@ -2032,6 +2030,17 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.mnuEnvGeneralOptionsClicked(Sender : TObject);
|
procedure TMainIDE.mnuEnvGeneralOptionsClicked(Sender : TObject);
|
||||||
var EnvironmentOptionsDialog: TEnvironmentOptionsDialog;
|
var EnvironmentOptionsDialog: TEnvironmentOptionsDialog;
|
||||||
|
MacroValueChanged: boolean;
|
||||||
|
|
||||||
|
procedure ChangeMacroValue(const MacroName, NewValue: string);
|
||||||
|
begin
|
||||||
|
with CodeToolBoss.GlobalValues do begin
|
||||||
|
if Variables[ExternalMacroStart+MacroName]=NewValue then exit;
|
||||||
|
Variables[ExternalMacroStart+MacroName]:=NewValue;
|
||||||
|
end;
|
||||||
|
MacroValueChanged:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
EnvironmentOptionsDialog:=TEnvironmentOptionsDialog.Create(Application);
|
EnvironmentOptionsDialog:=TEnvironmentOptionsDialog.Create(Application);
|
||||||
try
|
try
|
||||||
@ -2045,6 +2054,15 @@ Begin
|
|||||||
if ShowModal=mrOk then begin
|
if ShowModal=mrOk then begin
|
||||||
// load settings from EnvironmentOptionsDialog to EnvironmentOptions
|
// load settings from EnvironmentOptionsDialog to EnvironmentOptions
|
||||||
WriteSettings(EnvironmentOptions);
|
WriteSettings(EnvironmentOptions);
|
||||||
|
UpdateDefaultPascalFileExtensions;
|
||||||
|
// set global variables
|
||||||
|
ChangeMacroValue('LazarusSrcDir',EnvironmentOptions.LazarusDirectory);
|
||||||
|
ChangeMacroValue('FPCSrcDir',EnvironmentOptions.FPCSourceDirectory);
|
||||||
|
if MacroValueChanged then CodeToolBoss.DefineTree.ClearCache;
|
||||||
|
// ToDo:
|
||||||
|
// - rescan compiler
|
||||||
|
// - rescan fpc source directory
|
||||||
|
|
||||||
// save to disk
|
// save to disk
|
||||||
EnvironmentOptions.Save(false);
|
EnvironmentOptions.Save(false);
|
||||||
end;
|
end;
|
||||||
@ -2216,6 +2234,7 @@ var ActiveSrcEdit:TSourceEditor;
|
|||||||
SaveDialog:TSaveDialog;
|
SaveDialog:TSaveDialog;
|
||||||
NewUnitName,NewFilename,NewPageName:string;
|
NewUnitName,NewFilename,NewPageName:string;
|
||||||
AText,ACaption,CompResourceCode,TestFilename: string;
|
AText,ACaption,CompResourceCode,TestFilename: string;
|
||||||
|
SaveAsFileExt, SaveAsFilename: string;
|
||||||
MemStream,BinCompStream,TxtCompStream:TMemoryStream;
|
MemStream,BinCompStream,TxtCompStream:TMemoryStream;
|
||||||
Driver: TAbstractObjectWriter;
|
Driver: TAbstractObjectWriter;
|
||||||
Writer:TWriter;
|
Writer:TWriter;
|
||||||
@ -2282,14 +2301,29 @@ writeln('TMainIDE.DoSaveEditorUnit B2 ',ResourceCode<>nil);
|
|||||||
// let user choose a filename
|
// let user choose a filename
|
||||||
SaveDialog:=TSaveDialog.Create(Application);
|
SaveDialog:=TSaveDialog.Create(Application);
|
||||||
try
|
try
|
||||||
SaveDialog.Title:='Save '+ActiveUnitInfo.UnitName+' (*.pas)';
|
// try to keep the old filename and extension
|
||||||
SaveDialog.FileName:=lowercase(ActiveUnitInfo.UnitName)+'.pas';
|
SaveAsFileExt:=ExtractFileExt(ActiveUnitInfo.FileName);
|
||||||
|
if SaveAsFileExt='' then begin
|
||||||
|
if ActiveSrcEdit.SyntaxHighlighterType in [lshFreePascal, lshDelphi]
|
||||||
|
then
|
||||||
|
SaveAsFileExt:=PascalExtension[EnvironmentOptions.PascalFileExtension]
|
||||||
|
else
|
||||||
|
SaveAsFileExt:=EditorOpts.HighlighterList.GetDefaultFilextension(
|
||||||
|
ActiveSrcEdit.SyntaxHighlighterType);
|
||||||
|
end;
|
||||||
|
SaveAsFilename:=CodeToolBoss.GetSourceName(ActiveUnitInfo.Source);
|
||||||
|
if SaveAsFilename='' then
|
||||||
|
SaveAsFilename:=ActiveUnitInfo.UnitName;
|
||||||
|
if SaveAsFilename='' then
|
||||||
|
SaveAsFilename:='noname';
|
||||||
|
SaveDialog.Title:='Save '+SaveAsFilename+' (*'+SaveAsFileExt+')';
|
||||||
|
SaveDialog.FileName:=SaveAsFilename+SaveAsFileExt;
|
||||||
SaveDialog.InitialDir:=EnvironmentOptions.LastOpenDialogDir;
|
SaveDialog.InitialDir:=EnvironmentOptions.LastOpenDialogDir;
|
||||||
if SaveDialog.Execute then begin
|
if SaveDialog.Execute then begin
|
||||||
NewFilename:=ExpandFilename(SaveDialog.Filename);
|
NewFilename:=ExpandFilename(SaveDialog.Filename);
|
||||||
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(NewFilename);
|
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(NewFilename);
|
||||||
if ExtractFileExt(NewFilename)='' then
|
if ExtractFileExt(NewFilename)='' then
|
||||||
NewFilename:=NewFilename+'.pas';
|
NewFilename:=NewFilename+SaveAsFileExt;
|
||||||
if FileExists(NewFilename) then begin
|
if FileExists(NewFilename) then begin
|
||||||
ACaption:='Overwrite file?';
|
ACaption:='Overwrite file?';
|
||||||
AText:='A file "'+NewFilename+'" already exists.'#13'Replace it?';
|
AText:='A file "'+NewFilename+'" already exists.'#13'Replace it?';
|
||||||
@ -4923,6 +4957,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.161 2001/12/02 11:03:35 lazarus
|
||||||
|
MG: added default pascal file extension option
|
||||||
|
|
||||||
Revision 1.160 2001/12/01 22:17:26 lazarus
|
Revision 1.160 2001/12/01 22:17:26 lazarus
|
||||||
MG: added jump-history
|
MG: added jump-history
|
||||||
|
|
||||||
|
@ -616,7 +616,8 @@ begin
|
|||||||
case fProjectType of
|
case fProjectType of
|
||||||
ptProgram, ptApplication, ptCustomProgram:
|
ptProgram, ptApplication, ptCustomProgram:
|
||||||
begin
|
begin
|
||||||
NewPrgBuf:=CodeToolBoss.CreateFile('project1.pas');
|
NewPrgBuf:=CodeToolBoss.CreateFile(
|
||||||
|
'project1'+ProjectDefaultExt[fProjectType]);
|
||||||
PrgUnitInfo:=TUnitInfo.Create(NewPrgBuf);
|
PrgUnitInfo:=TUnitInfo.Create(NewPrgBuf);
|
||||||
PrgUnitInfo.IsPartOfProject:=true;
|
PrgUnitInfo.IsPartOfProject:=true;
|
||||||
PrgUnitInfo.SyntaxHighlighter:=
|
PrgUnitInfo.SyntaxHighlighter:=
|
||||||
@ -1268,6 +1269,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.44 2001/12/02 11:03:36 lazarus
|
||||||
|
MG: added default pascal file extension option
|
||||||
|
|
||||||
Revision 1.43 2001/12/01 22:17:26 lazarus
|
Revision 1.43 2001/12/01 22:17:26 lazarus
|
||||||
MG: added jump-history
|
MG: added jump-history
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user