1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 01:02:17 -05:00

Simba: USE_EXTENSTIONS Define.

This commit is contained in:
John P (Dgby714) 2011-06-30 05:37:15 -04:00 committed by Merlijn Wajer
parent 1d447bb668
commit 1f21fb2769
4 changed files with 86 additions and 43 deletions

View File

@ -30,7 +30,7 @@
//{$DEFINE USE_CPASCAL} // TODO //{$DEFINE USE_CPASCAL} // TODO
//{$DEFINE USE_LAPE} // TODO //{$DEFINE USE_LAPE} // TODO
//{$DEFINE USE_EXTENSIONS} // TODO //{$DEFINE USE_EXTENSIONS}
//{$DEFINE USE_CODECOMPLETION} // TODO //{$DEFINE USE_CODECOMPLETION} // TODO
//{$DEFINE TERMINALWRITELN} // Only used once. Remove from SimbaUnit? //{$DEFINE TERMINALWRITELN} // Only used once. Remove from SimbaUnit?

View File

@ -265,7 +265,7 @@ begin
begin begin
{$I ../../Units/MMLAddon/PSInc/pscompile.inc} {$I ../../Units/MMLAddon/PSInc/pscompile.inc}
AddTypes('TStringArray','Array of String'); AddTypes('TStringArray','Array of String');
AddConstantN('ExtPath','string').SetString(ExtPath); AddConstantN('ExtPath', 'string').SetString({$IFDEF USE_EXTENSIONS}ExtPath{$ELSE}''{$ENDIF});
for i := 0 to high(VirtualKeys) do for i := 0 to high(VirtualKeys) do
AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key); AddConstantN(Format('VK_%S',[VirtualKeys[i].Str]),'Byte').SetInt(VirtualKeys[i].Key);
end; end;

View File

@ -5,7 +5,7 @@ object SimbaForm: TSimbaForm
Width = 660 Width = 660
AllowDropFiles = True AllowDropFiles = True
Caption = 'THA FUKING Simba' Caption = 'THA FUKING Simba'
ClientHeight = 598 ClientHeight = 603
ClientWidth = 660 ClientWidth = 660
KeyPreview = True KeyPreview = True
Menu = MainMenu Menu = MainMenu
@ -207,8 +207,8 @@ object SimbaForm: TSimbaForm
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Height = 21 Height = 23
Top = 577 Top = 580
Width = 660 Width = 660
Panels = < Panels = <
item item
@ -230,7 +230,7 @@ object SimbaForm: TSimbaForm
object PanelMemo: TPanel object PanelMemo: TPanel
Left = 0 Left = 0
Height = 154 Height = 154
Top = 423 Top = 426
Width = 660 Width = 660
Align = alBottom Align = alBottom
ClientHeight = 154 ClientHeight = 154
@ -253,19 +253,19 @@ object SimbaForm: TSimbaForm
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 5 Height = 5
Top = 418 Top = 421
Width = 660 Width = 660
Align = alBottom Align = alBottom
ResizeAnchor = akBottom ResizeAnchor = akBottom
end end
object ScriptPanel: TPanel object ScriptPanel: TPanel
Left = 0 Left = 0
Height = 394 Height = 397
Top = 24 Top = 24
Width = 660 Width = 660
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 394 ClientHeight = 397
ClientWidth = 660 ClientWidth = 660
DockSite = True DockSite = True
TabOrder = 4 TabOrder = 4
@ -273,7 +273,7 @@ object SimbaForm: TSimbaForm
OnDockOver = ScriptPanelDockOver OnDockOver = ScriptPanelDockOver
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 155 Left = 155
Height = 359 Height = 362
Top = 0 Top = 0
Width = 505 Width = 505
Align = alClient Align = alClient
@ -292,7 +292,7 @@ object SimbaForm: TSimbaForm
object SearchPanel: TPanel object SearchPanel: TPanel
Left = 0 Left = 0
Height = 35 Height = 35
Top = 359 Top = 362
Width = 660 Width = 660
Align = alBottom Align = alBottom
BevelOuter = bvSpace BevelOuter = bvSpace
@ -387,7 +387,7 @@ object SimbaForm: TSimbaForm
end end
object LabeledEditSearch: TLabeledEdit object LabeledEditSearch: TLabeledEdit
Left = 104 Left = 104
Height = 27 Height = 23
Top = 6 Top = 6
Width = 80 Width = 80
EditLabel.AnchorSideLeft.Control = LabeledEditSearch EditLabel.AnchorSideLeft.Control = LabeledEditSearch
@ -395,10 +395,10 @@ object SimbaForm: TSimbaForm
EditLabel.AnchorSideTop.Side = asrCenter EditLabel.AnchorSideTop.Side = asrCenter
EditLabel.AnchorSideRight.Control = LabeledEditSearch EditLabel.AnchorSideRight.Control = LabeledEditSearch
EditLabel.AnchorSideBottom.Control = LabeledEditSearch EditLabel.AnchorSideBottom.Control = LabeledEditSearch
EditLabel.Left = 66 EditLabel.Left = 71
EditLabel.Height = 18 EditLabel.Height = 16
EditLabel.Top = 10 EditLabel.Top = 9
EditLabel.Width = 35 EditLabel.Width = 30
EditLabel.Caption = 'Find: ' EditLabel.Caption = 'Find: '
EditLabel.ParentColor = False EditLabel.ParentColor = False
LabelPosition = lpLeft LabelPosition = lpLeft
@ -413,7 +413,7 @@ object SimbaForm: TSimbaForm
Left = 320 Left = 320
Height = 19 Height = 19
Top = 7 Top = 7
Width = 93 Width = 80
Caption = 'Match case' Caption = 'Match case'
OnClick = CheckBoxMatchCaseClick OnClick = CheckBoxMatchCaseClick
TabOrder = 1 TabOrder = 1
@ -421,38 +421,38 @@ object SimbaForm: TSimbaForm
end end
object SplitterFunctionList: TSplitter object SplitterFunctionList: TSplitter
Left = 150 Left = 150
Height = 359 Height = 362
Top = 0 Top = 0
Width = 5 Width = 5
OnCanResize = SplitterFunctionListCanResize OnCanResize = SplitterFunctionListCanResize
Visible = False Visible = False
end end
inline frmFunctionList: TFunctionListFrame inline frmFunctionList: TFunctionListFrame
Height = 359 Height = 362
Width = 150 Width = 150
ClientHeight = 359 ClientHeight = 362
ClientWidth = 150 ClientWidth = 150
OnEndDock = nil OnEndDock = nil
TabOrder = 3 TabOrder = 3
inherited FunctionList: TTreeView inherited FunctionList: TTreeView
Height = 310 Height = 319
Top = 22 Top = 20
Width = 150 Width = 150
DefaultItemHeight = 19 DefaultItemHeight = 17
OnChange = FunctionListChange OnChange = FunctionListChange
OnEnter = FunctionListEnter OnEnter = FunctionListEnter
OnExit = FunctionListExit OnExit = FunctionListExit
end end
inherited editSearchList: TEdit inherited editSearchList: TEdit
Height = 27 Height = 23
Top = 332 Top = 339
Width = 150 Width = 150
OnExit = editSearchListExit OnExit = editSearchListExit
OnKeyDown = editSearchListKeyDown OnKeyDown = editSearchListKeyDown
OnKeyPress = editSearchListKeyPress OnKeyPress = editSearchListKeyPress
end end
inherited FunctionListLabel: TLabel inherited FunctionListLabel: TLabel
Height = 18 Height = 16
Width = 146 Width = 146
end end
end end
@ -3006,6 +3006,7 @@ object SimbaForm: TSimbaForm
Caption = '&Extensions' Caption = '&Extensions'
OnExecute = ActionExtensionsExecute OnExecute = ActionExtensionsExecute
OnUpdate = ActionExtensionsUpdate OnUpdate = ActionExtensionsUpdate
Visible = False
end end
object ActionPascalScript: TAction object ActionPascalScript: TAction
Caption = 'PascalScript' Caption = 'PascalScript'

View File

@ -51,8 +51,9 @@ uses
SynExportHTML, SynEditKeyCmds, SynEditHighlighter, SynExportHTML, SynEditKeyCmds, SynEditHighlighter,
SynEditMarkupHighAll, LMessages, Buttons, SynEditMarkupHighAll, LMessages, Buttons,
mmisc, stringutil,mufasatypesutil, mufasabase, mmisc, stringutil,mufasatypesutil, mufasabase,
about, framefunctionlist, ocr, updateform, Simbasettings, psextension, virtualextension, about, framefunctionlist, ocr, updateform, Simbasettings,
extensionmanager, settingssandbox, {$IFDEF USE_EXTENSIONS}psextension, virtualextension, extensionmanager,{$ENDIF}
settingssandbox,
v_ideCodeParser, v_ideCodeInsight, CastaliaPasLexTypes, // Code completion units v_ideCodeParser, v_ideCodeInsight, CastaliaPasLexTypes, // Code completion units
CastaliaSimplePasPar, v_AutoCompleteForm, // Code completion units CastaliaSimplePasPar, v_AutoCompleteForm, // Code completion units
@ -418,7 +419,7 @@ type
function GetInterpreter: Integer; function GetInterpreter: Integer;
function GetDefScriptPath: string; function GetDefScriptPath: string;
function GetScriptPath : string; function GetScriptPath : string;
function GetExtPath: string; {$IFDEF USE_EXTENSIONS}function GetExtPath: string;{$ENDIF}
function GetFontPath: String; function GetFontPath: String;
function GetHighlighter: TSynCustomHighlighter; function GetHighlighter: TSynCustomHighlighter;
function GetIncludePath: String; function GetIncludePath: String;
@ -428,7 +429,7 @@ type
function GetShowCodeCompletionAuto: Boolean; function GetShowCodeCompletionAuto: Boolean;
function GetSimbaNews: String; function GetSimbaNews: String;
procedure SetDefScriptPath(const AValue: string); procedure SetDefScriptPath(const AValue: string);
procedure SetExtPath(const AValue: string); {$IFDEF USE_EXTENSIONS}procedure SetExtPath(const AValue: string);{$ENDIF}
procedure SetFontPath(const AValue: String); procedure SetFontPath(const AValue: String);
procedure SetIncludePath(const AValue: String); procedure SetIncludePath(const AValue: String);
procedure SetInterpreter(const AValue: Integer); procedure SetInterpreter(const AValue: Integer);
@ -501,7 +502,7 @@ type
property IncludePath : String read GetIncludePath write SetIncludePath; property IncludePath : String read GetIncludePath write SetIncludePath;
property FontPath : String read GetFontPath write SetFontPath; property FontPath : String read GetFontPath write SetFontPath;
property PluginPath : string read GetPluginPath write SetPluginPath; property PluginPath : string read GetPluginPath write SetPluginPath;
property ExtPath : string read GetExtPath write SetExtPath; {$IFDEF USE_EXTENSIONS}property ExtPath : string read GetExtPath write SetExtPath;{$ENDIF}
property ScriptDir : string read GetScriptPath write SetScriptPath; property ScriptDir : string read GetScriptPath write SetScriptPath;
property DefScriptPath : string read GetDefScriptPath write SetDefScriptPath; property DefScriptPath : string read GetDefScriptPath write SetDefScriptPath;
property CurrHighlighter : TSynCustomHighlighter read GetHighlighter; property CurrHighlighter : TSynCustomHighlighter read GetHighlighter;
@ -545,7 +546,7 @@ uses
InterfaceBase, InterfaceBase,
bitmapconv, bitmapconv,
bitmaps, bitmaps,
extensionmanagergui, {$IFDEF USE_EXTENSIONS}extensionmanagergui,{$ENDIF}
colourhistory, colourhistory,
math math
@ -744,6 +745,7 @@ begin
end; end;
procedure TSimbaForm.HandleConnectionData; procedure TSimbaForm.HandleConnectionData;
{$IFDEF USE_EXTENSIONS}
var var
Args : TVariantArray; Args : TVariantArray;
begin begin
@ -758,6 +760,9 @@ begin
on e : Exception do on e : Exception do
mDebugLn('ERROR in HandleConnectiondata: ' + e.message); mDebugLn('ERROR in HandleConnectiondata: ' + e.message);
end; end;
{$ELSE}
begin
{$ENDIF}
end; end;
function TSimbaForm.GetInterpreter: Integer; function TSimbaForm.GetInterpreter: Integer;
@ -781,6 +786,7 @@ begin
end; end;
procedure TSimbaForm.HandleOpenFileData; procedure TSimbaForm.HandleOpenFileData;
{$IFDEF USE_EXTENSIONS}
var var
Args : TVariantArray; Args : TVariantArray;
begin begin
@ -795,9 +801,13 @@ begin
on e : Exception do on e : Exception do
mDebugLn('ERROR in HandleOpenFileData: ' + e.message); mDebugLn('ERROR in HandleOpenFileData: ' + e.message);
end; end;
{$ELSE}
begin
{$ENDIF}
end; end;
procedure TSimbaForm.HandleWriteFileData; procedure TSimbaForm.HandleWriteFileData;
{$IFDEF USE_EXTENSIONS}
var var
Args : TVariantArray; Args : TVariantArray;
begin begin
@ -812,9 +822,13 @@ begin
on e : Exception do on e : Exception do
mDebugLn('ERROR in HandleWriteFileData: ' + e.message); mDebugLn('ERROR in HandleWriteFileData: ' + e.message);
end; end;
{$ELSE}
begin
{$ENDIF}
end; end;
procedure TSimbaForm.HandleScriptStartData; procedure TSimbaForm.HandleScriptStartData;
{$IFDEF USE_EXTENSIONS}
var var
Args : TVariantArray; Args : TVariantArray;
begin begin
@ -829,6 +843,9 @@ begin
on e : Exception do on e : Exception do
mDebugLn('ERROR in HandleScriptStartData: ' + e.message); mDebugLn('ERROR in HandleScriptStartData: ' + e.message);
end; end;
{$ELSE}
begin
{$ENDIF}
end; end;
procedure TSimbaForm.ProcessDebugStream(Sender: TObject); procedure TSimbaForm.ProcessDebugStream(Sender: TObject);
@ -1361,7 +1378,7 @@ begin
CreateSetting('Settings/CodeHints/ShowAutomatically','True'); CreateSetting('Settings/CodeHints/ShowAutomatically','True');
CreateSetting('Settings/CodeCompletion/ShowAutomatically','True'); CreateSetting('Settings/CodeCompletion/ShowAutomatically','True');
CreateSetting('Settings/SourceEditor/LazColors','True'); CreateSetting('Settings/SourceEditor/LazColors','True');
CreateSetting('Settings/Extensions/FileExtension','sex'); {$IFDEF USE_EXTENSIONS}CreateSetting('Settings/Extensions/FileExtension','sex');{$ENDIF}
CreateSetting('Settings/Updater/RemoteLink',SimbaURL + 'Simba'{$IFDEF WINDOWS} +'.exe'{$ENDIF}); CreateSetting('Settings/Updater/RemoteLink',SimbaURL + 'Simba'{$IFDEF WINDOWS} +'.exe'{$ENDIF});
CreateSetting('Settings/Updater/RemoteVersionLink',SimbaURL + 'Version'); CreateSetting('Settings/Updater/RemoteVersionLink',SimbaURL + 'Version');
@ -1372,8 +1389,10 @@ begin
{Creates the paths and returns the path} {Creates the paths and returns the path}
PluginsPath := CreateSetting('Settings/Plugins/Path', ExpandFileName(MainDir+ DS+ 'Plugins' + DS)); PluginsPath := CreateSetting('Settings/Plugins/Path', ExpandFileName(MainDir+ DS+ 'Plugins' + DS));
{$IFDEF USE_EXTENSIONS}
extensionsPath := CreateSetting('Settings/Extensions/Path',ExpandFileName(MainDir +DS + 'Extensions' + DS)); extensionsPath := CreateSetting('Settings/Extensions/Path',ExpandFileName(MainDir +DS + 'Extensions' + DS));
CreateSetting('Extensions/ExtensionCount','0'); CreateSetting('Extensions/ExtensionCount','0');
{$ENDIF}
CreateSetting('LastConfig/MainForm/Position',''); CreateSetting('LastConfig/MainForm/Position','');
CreateSetting('LastConfig/MainForm/State','Normal'); CreateSetting('LastConfig/MainForm/State','Normal');
{$ifdef MSWindows} {$ifdef MSWindows}
@ -1387,10 +1406,12 @@ begin
CreateDir(FontPath); CreateDir(FontPath);
if not DirectoryExists(PluginsPath) then if not DirectoryExists(PluginsPath) then
CreateDir(PluginsPath); CreateDir(PluginsPath);
{$IFDEF USE_EXTENSIONS}
if not DirectoryExists(extensionsPath) then if not DirectoryExists(extensionsPath) then
CreateDir(extensionsPath); CreateDir(extensionsPath);
if not DirectoryExists(ExtPath) then if not DirectoryExists(ExtPath) then
CreateDir(ExtPath); CreateDir(ExtPath);
{$ENDIF}
if not DirectoryExists(ScriptDir) then if not DirectoryExists(ScriptDir) then
CreateDir(ScriptDir); CreateDir(ScriptDir);
SettingsForm.SettingsTreeView.Items.GetFirstNode.Expand(false); SettingsForm.SettingsTreeView.Items.GetFirstNode.Expand(false);
@ -1491,19 +1512,21 @@ begin
else else
SetSetting('LastConfig/Console/Visible','False'); SetSetting('LastConfig/Console/Visible','False');
{$endif} {$endif}
{$IFDEF USE_EXTENSIONS}
SetSetting('Extensions/ExtensionCount',inttostr(ExtManager.Extensions.Count)); SetSetting('Extensions/ExtensionCount',inttostr(ExtManager.Extensions.Count));
for i := 0 to ExtManager.Extensions.Count-1 do for i := 0 to ExtManager.Extensions.Count-1 do
begin; begin;
path :='Extensions/Extension' + inttostr(I); path :='Extensions/Extension' + inttostr(I);
SetSetting(Path + '/Path',TVirtualSimbaExtension(ExtManager.Extensions[i]).Filename); SetSetting(Path + '/Path',TVirtualSimbaExtension(ExtManager.Extensions[i]).Filename);
SetSetting(Path + '/Enabled',BoolToStr(TVirtualSimbaExtension(ExtManager.Extensions[i]).Enabled,True)); SetSetting(Path + '/Enabled',BoolToStr(TVirtualSimbaExtension(ExtManager.Extensions[i]).Enabled,True));
end; end;
{$ENDIF}
SaveToXML(SimbaSettingsFile); SaveToXML(SimbaSettingsFile);
end; end;
end; end;
procedure TSimbaForm.LoadExtensions; procedure TSimbaForm.LoadExtensions;
{$IFDEF USE_EXTENSIONS}
var var
extCount : integer; extCount : integer;
function LoadExtension(Number : integer) : boolean; function LoadExtension(Number : integer) : boolean;
@ -1551,6 +1574,9 @@ begin
str := LoadSettingDef('Settings/Extensions/Path',ExpandFileName(MainDir +DS + 'Extensions' + DS)); str := LoadSettingDef('Settings/Extensions/Path',ExpandFileName(MainDir +DS + 'Extensions' + DS));
str2 := LoadSettingDef('Settings/Extensions/FileExtension','sex'); str2 := LoadSettingDef('Settings/Extensions/FileExtension','sex');
ExtManager.LoadPSExtensionsDir(str,str2); ExtManager.LoadPSExtensionsDir(str,str2);
{$ELSE}
begin
{$ENDIF}
end; end;
procedure TSimbaForm.AddRecentFile(const filename: string); procedure TSimbaForm.AddRecentFile(const filename: string);
@ -1834,15 +1860,17 @@ end;
procedure TSimbaForm.ActionExtensionsExecute(Sender: TObject); procedure TSimbaForm.ActionExtensionsExecute(Sender: TObject);
begin begin
{$IFDEF USE_EXTENSIONS}
if not ExtensionsForm.Showing then if not ExtensionsForm.Showing then
ExtensionsForm.Show ExtensionsForm.Show
else else
ExtensionsForm.Hide; ExtensionsForm.Hide;
{$ENDIF}
end; end;
procedure TSimbaForm.ActionExtensionsUpdate(Sender: TObject); procedure TSimbaForm.ActionExtensionsUpdate(Sender: TObject);
begin begin
TAction(Sender).Checked := ExtensionsForm.Showing; {$IFDEF USE_EXTENSIONS}TAction(Sender).Checked := ExtensionsForm.Showing;{$ENDIF}
end; end;
procedure TSimbaForm.ActionFindNextExecute(Sender: TObject); procedure TSimbaForm.ActionFindNextExecute(Sender: TObject);
@ -2312,7 +2340,7 @@ begin
end; end;
FunctionListTimer.Enabled:= false; FunctionListTimer.Enabled:= false;
CloseAction := caFree; CloseAction := caFree;
FreeAndNil(ExtManager); {$IFDEF USE_EXTENSIONS}FreeAndNil(ExtManager);{$ENDIF}
end; end;
procedure CCFillCore; procedure CCFillCore;
@ -2414,6 +2442,7 @@ begin
UpdateTimer.OnTimer:= @UpdateTimerCheck; UpdateTimer.OnTimer:= @UpdateTimerCheck;
Application.CreateForm(TSimbaUpdateForm, SimbaUpdateForm); Application.CreateForm(TSimbaUpdateForm, SimbaUpdateForm);
{$IFDEF USE_EXTENSIONS}Application.CreateForm(TExtensionsForm, ExtensionsForm);{$ENDIF}
if FileExistsUTF8(SimbaSettingsFile) then if FileExistsUTF8(SimbaSettingsFile) then
begin begin
@ -2468,13 +2497,15 @@ begin
FillThread.Resume; FillThread.Resume;
//Load the extensions //Load the extensions
LoadExtensions; {$IFDEF USE_EXTENSIONS}LoadExtensions;{$ENDIF}
UpdateTitle; UpdateTitle;
{$IFNDEF USE_RUTIS} {$IFNDEF USE_RUTIS}
MenuItemRUTIS.Enabled:=False; MenuItemRUTIS.Enabled:=False;
{$ENDIF} {$ENDIF}
{$IFDEF USE_EXTENSIONS}ActionExtensions.Visible := True;{$ENDIF}
self.EndFormUpdate; self.EndFormUpdate;
if SettingsForm.Oops then if SettingsForm.Oops then
@ -2492,8 +2523,10 @@ begin
for i := 0 to high(RecentFileItems) do for i := 0 to high(RecentFileItems) do
RecentFileItems[i].Free; RecentFileItems[i].Free;
{$IFDEF USE_EXTENSIONS}
if ExtManager <> nil then if ExtManager <> nil then
FreeAndNil(extmanager); FreeAndNil(extmanager);
{$ENDIF}
Tabs.Free; Tabs.Free;
@ -2803,10 +2836,12 @@ begin
SetSetting('Settings/SourceEditor/DefScriptPath',AValue,True); SetSetting('Settings/SourceEditor/DefScriptPath',AValue,True);
end; end;
{$IFDEF USE_EXTENSIONS}
procedure TSimbaForm.SetExtPath(const AValue: string); procedure TSimbaForm.SetExtPath(const AValue: string);
begin begin
SetSetting('Settings/Extensions/Path',AValue,true); SetSetting('Settings/Extensions/Path',AValue,true);
end; end;
{$ENDIF}
procedure TSimbaForm.NewsTimerTimer(Sender: TObject); procedure TSimbaForm.NewsTimerTimer(Sender: TObject);
var var
@ -2936,6 +2971,7 @@ end;
procedure TSimbaForm.PickerPick(Sender: TObject; const Colour, colourx, procedure TSimbaForm.PickerPick(Sender: TObject; const Colour, colourx,
coloury: integer); coloury: integer);
{$IFDEF USE_EXTENSIONS}
var var
Args : TVariantArray; Args : TVariantArray;
begin begin
@ -2944,6 +2980,9 @@ begin
Args[1] := Colourx; Args[1] := Colourx;
Args[2] := Coloury; Args[2] := Coloury;
ExtManager.HandleHook(EventHooks[SExt_OnColourPick].HookName,Args); ExtManager.HandleHook(EventHooks[SExt_OnColourPick].HookName,Args);
{$ELSE}
begin
{$ENDIF}
end; end;
procedure TSimbaForm.PopupItemFindClick(Sender: TObject); procedure TSimbaForm.PopupItemFindClick(Sender: TObject);
@ -2977,10 +3016,12 @@ begin
Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Fonts/Path', ExpandFileName(MainDir+DS+'Fonts' + DS))); Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Fonts/Path', ExpandFileName(MainDir+DS+'Fonts' + DS)));
end; end;
{$IFDEF USE_EXTENSIONS}
function TSimbaForm.GetExtPath: string; function TSimbaForm.GetExtPath: string;
begin begin
result :=IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Extensions/Path', ExpandFileName(MainDir+DS+'Extensions' + DS))); Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Extensions/Path', ExpandFileName(MainDir+DS+'Extensions' + DS)));
end; end;
{$ENDIF}
function TSimbaForm.GetHighlighter: TSynCustomHighlighter; function TSimbaForm.GetHighlighter: TSynCustomHighlighter;
begin begin
@ -3299,7 +3340,8 @@ begin
else else
InitialDir := ScriptDir; InitialDir := ScriptDir;
Options := [ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]; Options := [ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail];
Filter:= 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt;*.' +LoadSettingDef('Settings/Extensions/FileExtension','sex')+ Filter:= 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt' +
{$IFDEF USE_EXTENSIONS}';*.' + LoadSettingDef('Settings/Extensions/FileExtension', 'sex') + {$ENDIF}
'|Any files|*.*'; '|Any files|*.*';
if Execute then if Execute then
begin begin
@ -3406,8 +3448,8 @@ begin
InitialDir := ExtractFileDir(CurrScript.ScriptFile) InitialDir := ExtractFileDir(CurrScript.ScriptFile)
else else
InitialDir := ScriptDir; InitialDir := ScriptDir;
filter := 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt;*.' + filter := 'Simba Files|*.simba;*.simb;*.cogat;*.mufa;*.txt' +
LoadSettingDef('Settings/Extensions/FileExtension','sex')+ {$IFDEF USE_EXTENSIONS}';*.' + LoadSettingDef('Settings/Extensions/FileExtension','sex') + {$ENDIF}
'|Any files|*.*'; '|Any files|*.*';
if Execute then if Execute then
begin; begin;