From 98359e445afb1e426a24848e0cda557f75cfc7f5 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 11 May 2010 14:56:11 +0200 Subject: [PATCH] Renamed the mainform, renamed the testunit added begining for a bitmapConversion tool. --- Projects/SAMufasaGUI/about.pas | 8 +- Projects/SAMufasaGUI/bitmapconv.lfm | 26 ++ Projects/SAMufasaGUI/bitmapconv.pas | 32 ++ Projects/SAMufasaGUI/colourhistory.pas | 8 +- Projects/SAMufasaGUI/debugimage.pas | 4 +- Projects/SAMufasaGUI/extensionmanager.pas | 2 +- Projects/SAMufasaGUI/framefunctionlist.pas | 34 +- Projects/SAMufasaGUI/framescript.lfm | 2 +- Projects/SAMufasaGUI/framescript.pas | 100 ++--- Projects/SAMufasaGUI/project1.lpi | 22 +- Projects/SAMufasaGUI/project1.lpr | 7 +- Projects/SAMufasaGUI/psextension.pas | 14 +- .../SAMufasaGUI/{testunit.lfm => simba.lfm} | 2 +- .../SAMufasaGUI/{testunit.pas => simba.pas} | 356 +++++++++--------- Projects/SAMufasaGUI/updateform.pas | 6 +- 15 files changed, 348 insertions(+), 275 deletions(-) create mode 100644 Projects/SAMufasaGUI/bitmapconv.lfm create mode 100644 Projects/SAMufasaGUI/bitmapconv.pas rename Projects/SAMufasaGUI/{testunit.lfm => simba.lfm} (99%) rename Projects/SAMufasaGUI/{testunit.pas => simba.pas} (88%) diff --git a/Projects/SAMufasaGUI/about.pas b/Projects/SAMufasaGUI/about.pas index 75b2c61..f50c54b 100644 --- a/Projects/SAMufasaGUI/about.pas +++ b/Projects/SAMufasaGUI/about.pas @@ -54,15 +54,15 @@ var implementation uses - TestUnit; + simba; { TAboutForm } procedure TAboutForm.FormCreate(Sender: TObject); begin - Self.Caption := format('About Simba r%d', [TestUnit.SimbaVersion]); - Self.LabelRevision.Caption := format('Revision %d', [TestUnit.SimbaVersion]); + Self.Caption := format('About Simba r%d', [simba.SimbaVersion]); + Self.LabelRevision.Caption := format('Revision %d', [simba.SimbaVersion]); AboutMemo.Lines.Add('Simba is released under the GPL license.'); - AboutMemo.Lines.Add(format('You are currently using version: %d',[Testunit.SimbaVersion])); + AboutMemo.Lines.Add(format('You are currently using version: %d',[simba.SimbaVersion])); AboutMemo.Lines.Add(''); AboutMemo.Lines.Add('Please report bugs at: http://mufasa.villavu.com/mantis/'); end; diff --git a/Projects/SAMufasaGUI/bitmapconv.lfm b/Projects/SAMufasaGUI/bitmapconv.lfm new file mode 100644 index 0000000..f9c9695 --- /dev/null +++ b/Projects/SAMufasaGUI/bitmapconv.lfm @@ -0,0 +1,26 @@ +object BitmapConvForm: TBitmapConvForm + Left = 726 + Height = 240 + Top = 192 + Width = 320 + Caption = 'BitmapConvForm' + ClientHeight = 240 + ClientWidth = 320 + LCLVersion = '0.9.29' + object Button1: TButton + Left = 144 + Height = 52 + Top = 152 + Width = 105 + Caption = 'Button1' + TabOrder = 0 + end + object CheckBox1: TCheckBox + Left = 24 + Height = 17 + Top = 160 + Width = 71 + Caption = 'CheckBox1' + TabOrder = 1 + end +end diff --git a/Projects/SAMufasaGUI/bitmapconv.pas b/Projects/SAMufasaGUI/bitmapconv.pas new file mode 100644 index 0000000..65fb6ff --- /dev/null +++ b/Projects/SAMufasaGUI/bitmapconv.pas @@ -0,0 +1,32 @@ +unit bitmapconv; + +{$mode objfpc} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls; + +type + + { TBitmapConvForm } + + TBitmapConvForm = class(TForm) + Button1: TButton; + CheckBox1: TCheckBox; + private + { private declarations } + public + { public declarations } + end; + +var + BitmapConvForm: TBitmapConvForm; + +implementation + +{$R *.lfm} + +end. + diff --git a/Projects/SAMufasaGUI/colourhistory.pas b/Projects/SAMufasaGUI/colourhistory.pas index e7a741d..4522ce5 100644 --- a/Projects/SAMufasaGUI/colourhistory.pas +++ b/Projects/SAMufasaGUI/colourhistory.pas @@ -104,7 +104,7 @@ var implementation uses - colour_conv, TestUnit, lclintf, lcltype; + colour_conv, simba, lclintf, lcltype; constructor TColourPickerObject.Create(C: Integer; P: TPoint; N: String); begin @@ -502,7 +502,7 @@ constructor TColourHistoryForm.Create(TheOwner: TComponent); begin inherited Create(TheOwner); - PickNewColourButton.OnClick:= @Form1.ButtonPickClick; + PickNewColourButton.OnClick:= @SimbaForm.ButtonPickClick; end; destructor TColourHistoryForm.Destroy; @@ -544,12 +544,12 @@ end; procedure TColourHistoryForm.SetCHShowMenu(Sender: TObject); begin - Form1.MenuItemColourHistory.Checked := True; + SimbaForm.MenuItemColourHistory.Checked := True; end; procedure TColourHistoryForm.UnSetCHShowMenu(Sender: TObject); begin - Form1.MenuItemColourHistory.Checked := False; + SimbaForm.MenuItemColourHistory.Checked := False; end; initialization diff --git a/Projects/SAMufasaGUI/debugimage.pas b/Projects/SAMufasaGUI/debugimage.pas index ac3bfa8..bd21574 100644 --- a/Projects/SAMufasaGUI/debugimage.pas +++ b/Projects/SAMufasaGUI/debugimage.pas @@ -59,7 +59,7 @@ var implementation uses - MufasaTypes, math, graphtype, IntfGraphics,TestUnit,lclintf,colour_conv,InterfaceBase; + MufasaTypes, math, graphtype, IntfGraphics,simba,lclintf,colour_conv,InterfaceBase; { TDebugImgForm } procedure TDebugImgForm.FormCreate(Sender: TObject); @@ -76,7 +76,7 @@ end; procedure TDebugImgForm.FormHide(Sender: TObject); begin - Form1.MenuItemDebugImage.Checked := False; + SimbaForm.MenuItemDebugImage.Checked := False; end; procedure TDebugImgForm.BlackDebugImage; diff --git a/Projects/SAMufasaGUI/extensionmanager.pas b/Projects/SAMufasaGUI/extensionmanager.pas index 722da31..4840ae1 100644 --- a/Projects/SAMufasaGUI/extensionmanager.pas +++ b/Projects/SAMufasaGUI/extensionmanager.pas @@ -38,7 +38,7 @@ var implementation uses - TestUnit, settingssandbox,simbasettings; + simba, settingssandbox,simbasettings; procedure TExtensionManager.SetOnchange(const AValue: TNotifyEvent); var diff --git a/Projects/SAMufasaGUI/framefunctionlist.pas b/Projects/SAMufasaGUI/framefunctionlist.pas index a792301..2e36f15 100644 --- a/Projects/SAMufasaGUI/framefunctionlist.pas +++ b/Projects/SAMufasaGUI/framefunctionlist.pas @@ -72,7 +72,7 @@ type implementation uses - TestUnit, Graphics, stringutil, simpleanalyzer,v_ideCodeParser,lclintf; + simba, Graphics, stringutil, simpleanalyzer,v_ideCodeParser,lclintf; { TFunctionListFrame } @@ -99,14 +99,14 @@ procedure TFunctionListFrame.FrameEndDock(Sender, Target: TObject; X, Y: Integer begin if Target is TPanel then begin - Form1.SplitterFunctionList.Visible := true; + SimbaForm.SplitterFunctionList.Visible := true; CloseButton.Visible:= true; end else if Target is TCustomDockForm then begin TCustomDockForm(Target).Caption := 'Functionlist'; TCustomDockForm(Target).OnClose := @DockFormOnClose; - Form1.SplitterFunctionList.Visible:= false; + SimbaForm.SplitterFunctionList.Visible:= false; CloseButton.Visible:= false; end; end; @@ -125,8 +125,8 @@ begin if node.Data <> nil then if InCodeCompletion then begin - Form1.CurrScript.SynEdit.InsertTextAtCaret( GetMethodName(PMethodInfo(node.Data)^.MethodStr,true)); - Form1.RefreshTab; + SimbaForm.CurrScript.SynEdit.InsertTextAtCaret( GetMethodName(PMethodInfo(node.Data)^.MethodStr,true)); + SimbaForm.RefreshTab; end else begin @@ -138,10 +138,10 @@ begin if MethodInfo.Filename <> '' then begin; // Writeln(MethodInfo.filename); - Form1.LoadScriptFile(MethodInfo.Filename,true,true); + SimbaForm.LoadScriptFile(MethodInfo.Filename,true,true); end; - Form1.CurrScript.SynEdit.SelStart := MethodInfo.BeginPos + 1; - Form1.CurrScript.SynEdit.SelEnd := MethodInfo.EndPos + 1; + SimbaForm.CurrScript.SynEdit.SelStart := MethodInfo.BeginPos + 1; + SimbaForm.CurrScript.SynEdit.SelEnd := MethodInfo.EndPos + 1; end; end; end; @@ -172,13 +172,13 @@ end; procedure TFunctionListFrame.DockFormOnClose(Sender: TObject; var CloseAction: TCloseAction); begin CloseAction := caHide; - Form1.MenuItemFunctionList.Checked := False; + SimbaForm.MenuItemFunctionList.Checked := False; end; procedure TFunctionListFrame.CloseButtonClick(Sender: TObject); begin self.Hide; - Form1.MenuItemFunctionList.Checked := False; + SimbaForm.MenuItemFunctionList.Checked := False; end; procedure TFunctionListFrame.FunctionListMouseUp(Sender: TObject; @@ -248,8 +248,8 @@ begin FillThread.Analyzer := TCodeInsight.Create; with FillThread,FillThread.Analyzer do begin - OnFindInclude := @Form1.OnCCFindInclude; - FileName := Form1.CurrScript.ScriptFile; + OnFindInclude := @SimbaForm.OnCCFindInclude; + FileName := SimbaForm.CurrScript.ScriptFile; MS := TMemoryStream.Create; MS.Write(Script[1],length(script)); OnTerminate:=@FillThreadTerminate; @@ -278,9 +278,9 @@ begin FunctionList.FullCollapse; if InCodeCompletion then begin; - Form1.CurrScript.SynEdit.Lines[CompletionCaret.y - 1] := CompletionStart; - Form1.CurrScript.SynEdit.LogicalCaretXY:= point(CompletionCaret.x,CompletionCaret.y); - Form1.CurrScript.SynEdit.SelEnd:= Form1.CurrScript.SynEdit.SelStart; + SimbaForm.CurrScript.SynEdit.Lines[CompletionCaret.y - 1] := CompletionStart; + SimbaForm.CurrScript.SynEdit.LogicalCaretXY:= point(CompletionCaret.x,CompletionCaret.y); + SimbaForm.CurrScript.SynEdit.SelEnd:= SimbaForm.CurrScript.SynEdit.SelStart; end; FilterTreeVis(False); ScriptNode.Expand(true); @@ -403,7 +403,7 @@ begin FilterTreeVis(false); editSearchList.Color := 6711039; if InCodeCompletion then - Form1.CurrScript.SynEdit.Lines[CompletionCaret.y - 1] := CompletionStart; + SimbaForm.CurrScript.SynEdit.Lines[CompletionCaret.y - 1] := CompletionStart; end; FilterTree.EndUpdate; end; @@ -411,7 +411,7 @@ begin if result and InCodeCompletion then begin; str := format(CompletionLine, [InsertStr]); - with Form1.CurrScript.SynEdit do + with SimbaForm.CurrScript.SynEdit do begin; Lines[CompletionCaret.y - 1] := str; LogicalCaretXY:= StartWordCompletion; diff --git a/Projects/SAMufasaGUI/framescript.lfm b/Projects/SAMufasaGUI/framescript.lfm index f0ad4a6..5754b6d 100644 --- a/Projects/SAMufasaGUI/framescript.lfm +++ b/Projects/SAMufasaGUI/framescript.lfm @@ -20,7 +20,7 @@ object ScriptFrame: TScriptFrame Font.Quality = fqNonAntialiased ParentColor = False ParentFont = False - PopupMenu = Form1.ScriptPopup + PopupMenu = SimbaForm.ScriptPopup TabOrder = 0 OnDragDrop = SynEditDragDrop OnDragOver = SynEditDragOver diff --git a/Projects/SAMufasaGUI/framescript.pas b/Projects/SAMufasaGUI/framescript.pas index 31d3c3d..ff2b26e 100644 --- a/Projects/SAMufasaGUI/framescript.pas +++ b/Projects/SAMufasaGUI/framescript.pas @@ -93,7 +93,7 @@ type implementation uses - TestUnit, SynEditTypes, LCLIntF, StrUtils,framefunctionlist; + simba, SynEditTypes, LCLIntF, StrUtils,framefunctionlist; function WordAtCaret(e: TSynEdit; var sp, ep: Integer; Start: Integer = -1): string; var @@ -156,7 +156,7 @@ begin if not ScriptChanged then begin; ScriptChanged:= True; - Form1.Caption:= Format(WindowTitle,[ScriptName + '*']); + SimbaForm.Caption:= Format(WindowTitle,[ScriptName + '*']); OwnerSheet.Caption:=ScriptName + '*'; end; end; @@ -172,8 +172,8 @@ var begin mp := TCodeInsight.Create; mp.FileName := ScriptFile; - mp.OnMessage := @Form1.OnCCMessage; - mp.OnFindInclude := @Form1.OnCCFindInclude; + mp.OnMessage := @SimbaForm.OnCCMessage; + mp.OnFindInclude := @SimbaForm.OnCCFindInclude; ms := TMemoryStream.Create; SynEdit.Lines.SaveToStream(ms); @@ -194,10 +194,10 @@ begin begin if FileExists(TCodeInsight(d.Parser).FileName) then begin; - if Form1.LoadScriptFile(TCodeInsight(d.Parser).FileName,true,true) then + if SimbaForm.LoadScriptFile(TCodeInsight(d.Parser).FileName,true,true) then begin; - Form1.CurrScript.SynEdit.SelStart:= d.StartPos + 1; - Form1.CurrScript.SynEdit.SelEnd := d.StartPos + Length(TrimRight(d.RawText)) + 1; + SimbaForm.CurrScript.SynEdit.SelStart:= d.StartPos + 1; + SimbaForm.CurrScript.SynEdit.SelEnd := d.StartPos + Length(TrimRight(d.RawText)) + 1; end; end else @@ -220,7 +220,7 @@ procedure TScriptFrame.SynEditCommandProcessed(Sender: TObject; var Command2 : TSynEditorCommand; begin - if (Command = ecChar) and (AChar = '(') and (Form1.ParamHint.Visible = false) and (Form1.ShowHintAuto) then + if (Command = ecChar) and (AChar = '(') and (SimbaForm.ParamHint.Visible = false) and (SimbaForm.ShowHintAuto) then begin Command2:= ecCodeHints; SynEditProcessUserCommand(sender,command2,achar,nil); @@ -237,12 +237,12 @@ end; procedure TScriptFrame.SynEditDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin - Accept := Source = Form1.frmFunctionList; + Accept := Source = SimbaForm.frmFunctionList; if(Accept)then begin SynEdit.CaretXY := SynEdit.PixelsToLogicalPos(point(x, y)); - if(not(Form1.Active))then Form1.BringToFront; - if(Form1.ActiveControl <> SynEdit)then Form1.ActiveControl := SynEdit; + if(not(SimbaForm.Active))then SimbaForm.BringToFront; + if(SimbaForm.ActiveControl <> SynEdit)then SimbaForm.ActiveControl := SynEdit; end; end; @@ -251,18 +251,18 @@ procedure TScriptFrame.SynEditKeyDown(Sender: TObject; var Key: Word; begin if key = VK_F3 then begin; - Form1.ActionFindNextExecute(Sender); + SimbaForm.ActionFindNextExecute(Sender); key := 0; end; if key = VK_ESCAPE then - Form1.ParamHint.Hide; + SimbaForm.ParamHint.Hide; - Form1.CodeCompletionForm.HandleKeyDown(Sender, Key, Shift); + SimbaForm.CodeCompletionForm.HandleKeyDown(Sender, Key, Shift); end; procedure TScriptFrame.SynEditKeyPress(Sender: TObject; var Key: char); begin - Form1.CodeCompletionForm.HandleKeyPress(Sender, Key); + SimbaForm.CodeCompletionForm.HandleKeyPress(Sender, Key); end; procedure TScriptFrame.SynEditMouseLink(Sender: TObject; X, Y: Integer; @@ -309,8 +309,8 @@ begin if (Command = ecCodeCompletion) and ((not SynEdit.GetHighlighterAttriAtRowCol(SynEdit.CaretXY, s, Attri)) or ((Attri.Name <> SYNS_AttrComment) and (Attri.name <> SYNS_AttrString) and (Attri.name <> SYNS_AttrDirective))) then begin - {form1.FunctionListShown(True); - with form1.frmFunctionList do + {SimbaForm.FunctionListShown(True); + with SimbaForm.frmFunctionList do if editSearchList.CanFocus then begin; editSearchList.SetFocus; @@ -348,8 +348,8 @@ begin end;} mp := TCodeInsight.Create; mp.FileName := ScriptFile; - mp.OnMessage := @Form1.OnCCMessage; - mp.OnFindInclude := @Form1.OnCCFindInclude; + mp.OnMessage := @SimbaForm.OnCCMessage; + mp.OnFindInclude := @SimbaForm.OnCCFindInclude; ms := TMemoryStream.Create; ItemList := TStringList.Create; @@ -360,7 +360,7 @@ begin try Filter := WordAtCaret(Synedit, sp, ep); - Form1.CodeCompletionStart := Point(sp, Synedit.CaretY); + SimbaForm.CodeCompletionStart := Point(sp, Synedit.CaretY); //mp.Run(ms, nil, Synedit.SelStart + (ep - Synedit.CaretX) - 1); s := SynEdit.Lines[SynEdit.Carety-1]; @@ -382,7 +382,7 @@ begin mp.FillSynCompletionProposal(ItemList, InsertList, s); p := SynEdit.ClientToScreen(SynEdit.RowColumnToPixels(Point(ep, SynEdit.CaretY))); p.y := p.y + SynEdit.LineHeight; - Form1.CodeCompletionForm.Show(p, ItemList, InsertList, Filter, SynEdit); + SimbaForm.CodeCompletionForm.Show(p, ItemList, InsertList, Filter, SynEdit); finally FreeAndNil(ms); FreeAndNil(mp); @@ -392,11 +392,11 @@ begin end; if command = ecCodeHints then begin - if Form1.ParamHint.Visible = true then - form1.ParamHint.hide; + if SimbaForm.ParamHint.Visible = true then + SimbaForm.ParamHint.hide; mp := TCodeInsight.Create; - mp.OnMessage := @form1.OnCCMessage; - mp.OnFindInclude := @form1.OnCCFindInclude; + mp.OnMessage := @SimbaForm.OnCCMessage; + mp.OnFindInclude := @SimbaForm.OnCCFindInclude; ms := TMemoryStream.Create; synedit.Lines.SaveToStream(ms); @@ -441,7 +441,7 @@ begin if (not (d is TciProcedureDeclaration)) and (d.Owner is TciProcedureDeclaration) then d := d.Owner; if (TciProcedureDeclaration(d).Params <> '') then - Form1.ParamHint.Show(PosToCaretXY(synedit,posi + 1), PosToCaretXY(synedit,bracketpos), + SimbaForm.ParamHint.Show(PosToCaretXY(synedit,posi + 1), PosToCaretXY(synedit,bracketpos), TciProcedureDeclaration(d), synedit,mp) else FormWriteln(''); @@ -452,21 +452,21 @@ begin //Do not free the MP, we need to use this. end; end; - if Form1.CodeCompletionForm.Visible then + if SimbaForm.CodeCompletionForm.Visible then case Command of ecDeleteChar, ecDeleteWord, ecDeleteEOL: begin - if (SynEdit.CaretY = Form1.CodeCompletionStart.y) then + if (SynEdit.CaretY = SimbaForm.CodeCompletionStart.y) then begin //e.GetWordBoundsAtRowCol(acp_start, sp, ep); - s := WordAtCaret(SynEdit, sp, ep, Form1.CodeCompletionStart.x); - if (SynEdit.CaretX >= Form1.CodeCompletionStart.x) and (SynEdit.CaretX <= ep) then + s := WordAtCaret(SynEdit, sp, ep, SimbaForm.CodeCompletionStart.x); + if (SynEdit.CaretX >= SimbaForm.CodeCompletionStart.x) and (SynEdit.CaretX <= ep) then begin - Form1.CodeCompletionForm.ListBox.Filter := s; + SimbaForm.CodeCompletionForm.ListBox.Filter := s; Exit; end; end; - Form1.CodeCompletionForm.Hide; + SimbaForm.CodeCompletionForm.Hide; end; end; end; @@ -491,28 +491,28 @@ begin {$IFDEF UpdateEditButtons} if scSelection in changes then begin; - Form1.TT_Cut.Enabled := SynEdit.SelAvail; - form1.TT_Copy.Enabled:= Form1.TT_Cut.Enabled; - form1.TT_Paste.Enabled:= SynEdit.CanPaste; + SimbaForm.TT_Cut.Enabled := SynEdit.SelAvail; + SimbaForm.TT_Copy.Enabled:= SimbaForm.TT_Cut.Enabled; + SimbaForm.TT_Paste.Enabled:= SynEdit.CanPaste; end; {$ENDIF} - if Form1.CodeCompletionForm.Visible then + if SimbaForm.CodeCompletionForm.Visible then if (scAll in Changes) or (scTopLine in Changes) then - Form1.CodeCompletionForm.Visible := False + SimbaForm.CodeCompletionForm.Visible := False else if (scCaretX in Changes) or (scCaretY in Changes) or (scSelection in Changes) or (scModified in Changes) then begin - if (SynEdit.CaretY = Form1.CodeCompletionStart.y) then + if (SynEdit.CaretY = SimbaForm.CodeCompletionStart.y) then begin - s := WordAtCaret(SynEdit, sp, ep, Form1.CodeCompletionStart.x); - if (SynEdit.CaretX >= Form1.CodeCompletionStart.x) and (SynEdit.CaretX - 1 <= ep) then + s := WordAtCaret(SynEdit, sp, ep, SimbaForm.CodeCompletionStart.x); + if (SynEdit.CaretX >= SimbaForm.CodeCompletionStart.x) and (SynEdit.CaretX - 1 <= ep) then begin - Form1.CodeCompletionForm.ListBox.Filter := s; + SimbaForm.CodeCompletionForm.ListBox.Filter := s; Exit; end; end; - Form1.CodeCompletionForm.Hide; + SimbaForm.CodeCompletionForm.Hide; end; end; @@ -522,7 +522,7 @@ begin if ScriptChanged then if SynEdit.Lines.Text = StartText then begin; - Form1.Caption:= format(WindowTitle,[ScriptName]); + SimbaForm.Caption:= format(WindowTitle,[ScriptName]); OwnerSheet.Caption:= ScriptName; ScriptChanged := false; end; @@ -534,7 +534,7 @@ begin if ScriptChanged then if SynEdit.Lines.Text = StartText then begin; - Form1.Caption:= format(WindowTitle,[ScriptName]); + SimbaForm.Caption:= format(WindowTitle,[ScriptName]); OwnerSheet.Caption := ScriptName; ScriptChanged := false; end; @@ -551,10 +551,10 @@ begin else begin ErrorData.Module:= SetDirSeparators(ErrorData.Module);// Set it right ;-) - Form1.LoadScriptFile(ErrorData.Module,true,true);//Checks if the file is already open! + SimbaForm.LoadScriptFile(ErrorData.Module,true,true);//Checks if the file is already open! ErrorData.Module:= ''; - Form1.CurrScript.ErrorData := Self.ErrorData; - Form1.CurrScript.HandleErrorData; + SimbaForm.CurrScript.ErrorData := Self.ErrorData; + SimbaForm.CurrScript.HandleErrorData; exit; end; end; @@ -575,7 +575,7 @@ procedure TScriptFrame.MakeActiveScriptFrame; var i : integer; begin - if Form1.Visible then + if SimbaForm.Visible then for i := 0 to OwnerPage.PageCount - 1 do if OwnerPage.Pages[i] = OwnerSheet then begin; @@ -589,7 +589,7 @@ end; procedure TScriptFrame.ScriptThreadTerminate(Sender: TObject); begin FScriptState:= ss_None; - Form1.RefreshTab; + SimbaForm.RefreshTab; end; procedure AddKey(const SynEdit : TSynEdit; const ACmd: TSynEditorCommand; const AKey: word;const AShift: TShiftState); begin @@ -614,7 +614,7 @@ begin FScriptState:= ss_None; ScriptErrorLine:= -1; OwnerSheet.Caption:= ScriptName; - SynEdit.Highlighter := Form1.CurrHighlighter; + SynEdit.Highlighter := SimbaForm.CurrHighlighter; SynEdit.Options:= SynEdit.Options + [eoTabIndent] - [eoSmartTabs]; SynEdit.IncrementColor.Background := $30D070; SynEdit.HighlightAllColor.Background:= clYellow; diff --git a/Projects/SAMufasaGUI/project1.lpi b/Projects/SAMufasaGUI/project1.lpi index 3560cf7..d704128 100644 --- a/Projects/SAMufasaGUI/project1.lpi +++ b/Projects/SAMufasaGUI/project1.lpi @@ -40,19 +40,19 @@ - + - + - + - + @@ -288,6 +288,13 @@ + + + + + + + @@ -319,4 +326,11 @@ + + + + + + + diff --git a/Projects/SAMufasaGUI/project1.lpr b/Projects/SAMufasaGUI/project1.lpr index d94613e..bc2ee9c 100644 --- a/Projects/SAMufasaGUI/project1.lpr +++ b/Projects/SAMufasaGUI/project1.lpr @@ -31,12 +31,12 @@ uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, cmem, {$ENDIF}{$ENDIF} - Interfaces, Forms, testunit, colourhistory, About, internets, debugimage, + Interfaces, Forms, simba, colourhistory, About, internets, debugimage, framefunctionlist, simpleanalyzer, updater, updateform, simbasettings, libloader, mufasabase, v_ideCodeInsight, PSDump, v_ideCodeParser, v_AutoCompleteForm, CastaliaPasLex, CastaliaPasLexTypes, CastaliaSimplePasPar, CastaliaSimplePasParTypes, dcpbase64, mPasLex, v_Constants, v_MiscFunctions, - extensionmanagergui, mmisc; + extensionmanagergui, mmisc, bitmapconv; {$R project1.res} @@ -44,11 +44,12 @@ begin Application.Title:='Simba'; Application.Initialize; - Application.CreateForm(TForm1, Form1); + Application.CreateForm(TSimbaForm, SimbaForm); Application.CreateForm(TColourHistoryForm, ColourHistoryForm); Application.CreateForm(TAboutForm, AboutForm); Application.CreateForm(TDebugImgForm, DebugImgForm); Application.CreateForm(TExtensionsForm, ExtensionsForm); + Application.CreateForm(TBitmapConvForm, BitmapConvForm); // Application.CreateForm(TSimbaUpdateForm, SimbaUpdateForm); // Application.CreateForm(TSettingsForm, SettingsForm); Done in FormCreate of MainForm Application.Run; diff --git a/Projects/SAMufasaGUI/psextension.pas b/Projects/SAMufasaGUI/psextension.pas index f1d84fa..d851f63 100644 --- a/Projects/SAMufasaGUI/psextension.pas +++ b/Projects/SAMufasaGUI/psextension.pas @@ -49,7 +49,7 @@ uses uPSC_extctrls,uPSC_menus, //Compile libs uPSR_std, uPSR_controls,uPSR_classes,uPSR_graphics,uPSR_stdctrls,uPSR_forms, uPSR_extctrls,uPSR_menus, //Runtime-libs - testunit,updateform,settingssandbox,bitmaps,files,Dialogs, mmisc//Writeln + simba,updateform,settingssandbox,bitmaps,files,Dialogs, mmisc//Writeln ; function TSimbaPSExtension.HookExists(const HookName: String): Boolean; @@ -119,10 +119,10 @@ procedure TSimbaPSExtension.RegisterMyMethods(Sender: TPSScript); begin Sender.Comp.AddTypes('TStringArray','Array of String'); Sender.Comp.AddConstantN('AppPath','string').SetString(MainDir + DirectorySeparator); - Sender.Comp.AddConstantN('IncludePath','string').SetString(Form1.IncludePath); - Sender.Comp.AddConstantN('PluginPath','string').SetString(Form1.PluginPath); - Sender.Comp.AddConstantN('FontPath','string').SetString(form1.FontPath); - Sender.Comp.AddConstantN('ExtPath','string').SetString(form1.ExtPath); + Sender.Comp.AddConstantN('IncludePath','string').SetString(SimbaForm.IncludePath); + Sender.Comp.AddConstantN('PluginPath','string').SetString(SimbaForm.PluginPath); + Sender.Comp.AddConstantN('FontPath','string').SetString(SimbaForm.FontPath); + Sender.Comp.AddConstantN('ExtPath','string').SetString(SimbaForm.ExtPath); Sender.Comp.AddTypeS('TMsgDlgType', '( mtWarning, mtError, mtInformation, mtConfirmati' +'on, mtCustom )'); Sender.Comp.AddTypeS('TMsgDlgBtn', '( mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, m' @@ -146,8 +146,8 @@ end; procedure TSimbaPSExtension.OnPSExecute(Sender: TPSScript); begin - Sender.SetVarToInstance('simba',Form1); - Sender.SetVarToInstance('Simba_MainMenu',Form1.MainMenu); + Sender.SetVarToInstance('simba',SimbaForm); + Sender.SetVarToInstance('Simba_MainMenu',SimbaForm.MainMenu); Sender.SetPointerToData('Settings',@Self.Settings,Sender.FindNamedType('TMMLSettingsSandbox')); end; diff --git a/Projects/SAMufasaGUI/testunit.lfm b/Projects/SAMufasaGUI/simba.lfm similarity index 99% rename from Projects/SAMufasaGUI/testunit.lfm rename to Projects/SAMufasaGUI/simba.lfm index 8c05652..a95f6b4 100644 --- a/Projects/SAMufasaGUI/testunit.lfm +++ b/Projects/SAMufasaGUI/simba.lfm @@ -1,4 +1,4 @@ -object Form1: TForm1 +object SimbaForm: TSimbaForm Left = 150 Height = 623 Top = 69 diff --git a/Projects/SAMufasaGUI/testunit.pas b/Projects/SAMufasaGUI/simba.pas similarity index 88% rename from Projects/SAMufasaGUI/testunit.pas rename to Projects/SAMufasaGUI/simba.pas index c2425a4..42eab89 100644 --- a/Projects/SAMufasaGUI/testunit.pas +++ b/Projects/SAMufasaGUI/simba.pas @@ -18,10 +18,10 @@ See the file COPYING, included in this distribution, for details about the copyright. - TestUnit/GUI for the Mufasa Macro Library + simba/GUI for the Mufasa Macro Library } -unit TestUnit; +unit simba; {$undef EditButtons} {$Undef ProcessMessages} //Define this for processmessages in ThreadSafeCall @@ -64,9 +64,9 @@ type end; // Tab - { TForm1 } + { TSimbaForm } - TForm1 = class(TForm) + TSimbaForm = class(TForm) ActionConsole: TAction; ActionNormalSize: TAction; ActionCompileScript: TAction; @@ -445,7 +445,7 @@ const Image_Stop = 7; Image_Terminate = 19; var - Form1: TForm1; + SimbaForm: TSimbaForm; MainDir : string; {$ifdef MSWindows} PrevWndProc : WNDPROC; @@ -466,7 +466,7 @@ uses {$ifdef mswindows} function ConsoleHandler( eventType : DWord) : WINBOOL;stdcall; begin - TThread.Synchronize(nil,@Form1.Close); + TThread.Synchronize(nil,@SimbaForm.Close); Result := true; end; @@ -476,7 +476,7 @@ function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam; begin if uMsg = WM_HOTKEY then begin - Form1.ActionStopScript.Execute; + SimbaForm.ActionStopScript.Execute; Result := 0; end else Result := Windows.CallWindowProc(PrevWndProc,Ahwnd, uMsg, WParam, LParam); @@ -487,7 +487,7 @@ end; var DebugCriticalSection: syncobjs.TCriticalSection; -procedure TForm1.OnCCMessage(Sender: TObject; const Typ: TMessageEventType; const Msg: string; X, Y: Integer); +procedure TSimbaForm.OnCCMessage(Sender: TObject; const Typ: TMessageEventType; const Msg: string; X, Y: Integer); begin if (Typ = meNotSupported) then Exit; @@ -497,7 +497,7 @@ begin mDebugLn('ERROR: '+Format('%d:%d %s', [Y + 1, X, Msg])+' in '+TCodeInsight(Sender).FileName); end; -procedure TForm1.OnCompleteCode(Str: string); +procedure TSimbaForm.OnCompleteCode(Str: string); var sp, ep: Integer; s: string; @@ -516,7 +516,7 @@ begin end; end; -function TForm1.OnCCFindInclude(Sender: TObject; var FileName: string): Boolean; +function TSimbaForm.OnCCFindInclude(Sender: TObject; var FileName: string): Boolean; var Temp : string; begin @@ -529,7 +529,7 @@ begin result := false; end; -procedure TForm1.HandleConnectionData; +procedure TSimbaForm.HandleConnectionData; var Args : TVariantArray; begin @@ -546,12 +546,12 @@ begin end; end; -function TForm1.GetScriptPath: string; +function TSimbaForm.GetScriptPath: string; begin result :=IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Scripts/Path', ExpandFileName(MainDir+DS+'Scripts' + DS))); end; -procedure TForm1.HandleOpenFileData; +procedure TSimbaForm.HandleOpenFileData; var Args : TVariantArray; begin @@ -568,7 +568,7 @@ begin end; end; -procedure TForm1.HandleWriteFileData; +procedure TSimbaForm.HandleWriteFileData; var Args : TVariantArray; begin @@ -585,7 +585,7 @@ begin end; end; -procedure TForm1.HandleScriptStartData; +procedure TSimbaForm.HandleScriptStartData; var Args : TVariantArray; begin @@ -602,7 +602,7 @@ begin end; end; -procedure TForm1.ProcessDebugStream(Sender: TObject); +procedure TSimbaForm.ProcessDebugStream(Sender: TObject); begin if length(DebugStream) = 0 then Exit; @@ -620,7 +620,7 @@ begin end; end; -procedure TForm1.RecentFileItemsClick(Sender: TObject); +procedure TSimbaForm.RecentFileItemsClick(Sender: TObject); var i : integer; begin @@ -632,7 +632,7 @@ begin end; end; -procedure TForm1.ScriptPanelDockDrop(Sender: TObject; Source: TDragDockObject; +procedure TSimbaForm.ScriptPanelDockDrop(Sender: TObject; Source: TDragDockObject; X, Y: Integer); begin if(X <= (ScriptPanel.Width div 2))then @@ -655,7 +655,7 @@ begin SplitterFunctionList.Show; end; -procedure TForm1.ScriptPanelDockOver(Sender: TObject; Source: TDragDockObject; //is there a better way to do all of this? +procedure TSimbaForm.ScriptPanelDockOver(Sender: TObject; Source: TDragDockObject; //is there a better way to do all of this? X, Y: Integer; State: TDragState; var Accept: Boolean); var P: TPoint; @@ -671,29 +671,29 @@ begin end; end; -procedure TForm1.ScriptPopupPopup(Sender: TObject); +procedure TSimbaForm.ScriptPopupPopup(Sender: TObject); begin SetEditActions; end; -procedure TForm1.SpeedButtonSearchClick(Sender: TObject); +procedure TSimbaForm.SpeedButtonSearchClick(Sender: TObject); begin CloseFindPanel; end; -procedure TForm1.SplitterFunctionListCanResize(Sender: TObject; var NewSize: Integer; +procedure TSimbaForm.SplitterFunctionListCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); begin if(NewSize > ScriptPanel.Width div 2)then NewSize := ScriptPanel.Width div 2; end; -procedure TForm1.TB_ReloadPluginsClick(Sender: TObject); +procedure TSimbaForm.TB_ReloadPluginsClick(Sender: TObject); begin // PluginsGlob.FreePlugins; end; -procedure TForm1.ThreadOpenConnectionEvent(Sender: TObject; var url: string;var Continue: boolean); +procedure TSimbaForm.ThreadOpenConnectionEvent(Sender: TObject; var url: string;var Continue: boolean); begin OpenConnectionData.Sender := Sender; OpenConnectionData.URL:= @URL; @@ -701,7 +701,7 @@ begin TThread.Synchronize(nil,@HandleConnectionData); end; -procedure TForm1.ThreadOpenFileEvent(Sender: TObject; var Filename: string; +procedure TSimbaForm.ThreadOpenFileEvent(Sender: TObject; var Filename: string; var Continue: boolean); begin OpenFileData.Sender := Sender; @@ -710,7 +710,7 @@ begin TThread.Synchronize(nil,@HandleOpenFileData); end; -procedure TForm1.ThreadWriteFileEvent(Sender: TObject; var Filename: string; +procedure TSimbaForm.ThreadWriteFileEvent(Sender: TObject; var Filename: string; var Continue: boolean); begin WriteFileData.Sender := Sender; @@ -719,24 +719,24 @@ begin TThread.Synchronize(nil,@HandleWriteFileData); end; -procedure TForm1.TrayPopupPopup(Sender: TObject); +procedure TSimbaForm.TrayPopupPopup(Sender: TObject); begin - MenuItemHide.enabled:= Form1.Visible; + MenuItemHide.enabled:= SimbaForm.Visible; {$ifdef MSWindows} - MenuItemShow.Enabled:= not Form1.Visible; - if Form1.Visible then - if Form1.CanFocus then - form1.SetFocus; + MenuItemShow.Enabled:= not SimbaForm.Visible; + if SimbaForm.Visible then + if SimbaForm.CanFocus then + SimbaForm.SetFocus; {$endif} end; -procedure TForm1.TT_UpdateClick(Sender: TObject); +procedure TSimbaForm.TT_UpdateClick(Sender: TObject); begin SimbaUpdateForm.ShowModal; TT_Update.Visible:=False; end; -procedure TForm1.UpdateTimerCheck(Sender: TObject); +procedure TSimbaForm.UpdateTimerCheck(Sender: TObject); var chk: String; time:integer; @@ -764,7 +764,7 @@ begin UpdateTimer.Interval:= time {mins} * 60 {secs} * 1000 {ms};//Every half hour end; -procedure TForm1.UpdateMenuButtonClick(Sender: TObject); +procedure TSimbaForm.UpdateMenuButtonClick(Sender: TObject); begin SimbaUpdateForm.ShowModal; end; @@ -772,9 +772,9 @@ end; procedure ClearDebug; begin {$IFNDEF MSWINDOWS} - Form1.ProcessDebugStream(nil); + SimbaForm.ProcessDebugStream(nil); {$ENDIF} - TThread.Synchronize(nil,@Form1.Memo1.Clear); + TThread.Synchronize(nil,@SimbaForm.Memo1.Clear); end; procedure formWriteln( S : String); @@ -782,12 +782,12 @@ begin mDebugLn('formWriteln: ' + s); {$ifdef MSWindows} //Ha, we cán acces the debugmemo - Form1.Memo1.Lines.Add(s); + SimbaForm.Memo1.Lines.Add(s); {$else} DebugCriticalSection.Enter; try s := s + MEOL; - Form1.DebugStream:= Form1.DebugStream + s; + SimbaForm.DebugStream:= SimbaForm.DebugStream + s; finally DebugCriticalSection.Leave; end; @@ -796,7 +796,7 @@ end; //{$ENDIF} -procedure TForm1.RunScript; +procedure TSimbaForm.RunScript; begin with CurrScript do begin @@ -821,7 +821,7 @@ begin end; end; -procedure TForm1.PauseScript; +procedure TSimbaForm.PauseScript; begin with CurrScript do begin; @@ -841,7 +841,7 @@ begin end; end; -procedure TForm1.StopScript; +procedure TSimbaForm.StopScript; begin with CurrScript do begin; @@ -869,7 +869,7 @@ begin end; end; -procedure TForm1.AddTab; +procedure TSimbaForm.AddTab; var Tab : TMufasaTab; begin; @@ -886,7 +886,7 @@ begin; end; end; -function TForm1.DeleteTab(TabIndex: integer; CloseLast : boolean; Silent : boolean = false) : boolean; +function TSimbaForm.DeleteTab(TabIndex: integer; CloseLast : boolean; Silent : boolean = false) : boolean; var Tab : TMufasaTab; OldIndex : integer;//So that we can switch back, if needed. @@ -931,12 +931,12 @@ begin RefreshTab; end; -procedure TForm1.ClearTab(TabIndex: integer); +procedure TSimbaForm.ClearTab(TabIndex: integer); begin TMufasaTab(Tabs[TabIndex]).Clear; end; -procedure TForm1.CloseTabs(Exclude: integer = -1; Silent : boolean = false); +procedure TSimbaForm.CloseTabs(Exclude: integer = -1; Silent : boolean = false); var I : integer; begin @@ -946,7 +946,7 @@ begin exit; end; -procedure TForm1.SetEditActions; +procedure TSimbaForm.SetEditActions; procedure EditActions(Undo,Redo,Cut,Copy,Paste,Delete : boolean); begin; ActionUndo.Enabled:= Undo; @@ -994,7 +994,7 @@ begin EditActions(false,false,false,false,false,false); end; -procedure TForm1.DoSearch(Next: boolean; HighlightAll : boolean); +procedure TSimbaForm.DoSearch(Next: boolean; HighlightAll : boolean); var Res : integer; CurrPos : TPoint; @@ -1052,7 +1052,7 @@ begin end; end; -procedure TForm1.RefreshTab; +procedure TSimbaForm.RefreshTab; var Tab : TMufasaTab; Script : TScriptFrame; @@ -1100,12 +1100,12 @@ begin SetEditActions; end; -procedure TForm1.RefreshTabSender(sender: PtrInt); +procedure TSimbaForm.RefreshTabSender(sender: PtrInt); begin RefreshTab; end; -procedure TForm1.CreateDefaultEnvironment; +procedure TSimbaForm.CreateDefaultEnvironment; var PluginsPath,extensionsPath : string; begin @@ -1160,7 +1160,7 @@ begin UpdateTimer.Interval:=25; end; -procedure TForm1.LoadFormSettings; +procedure TSimbaForm.LoadFormSettings; var str,str2 : string; Data : TStringArray; @@ -1210,7 +1210,7 @@ begin self.EndFormUpdate; end; -procedure TForm1.SaveFormSettings; +procedure TSimbaForm.SaveFormSettings; var Data : TStringArray; path : string; @@ -1256,7 +1256,7 @@ begin end; end; -procedure TForm1.LoadExtensions; +procedure TSimbaForm.LoadExtensions; var extCount : integer; function LoadExtension(Number : integer) : boolean; @@ -1306,7 +1306,7 @@ begin ExtManager.LoadPSExtensionsDir(str,str2); end; -procedure TForm1.AddRecentFile(const filename: string); +procedure TSimbaForm.AddRecentFile(const filename: string); var MaxRecentFiles : integer; Len,i : integer; @@ -1330,7 +1330,7 @@ begin RecentFileItems[len - 1-i].Caption:= ExtractFileName(RecentFiles[i]); end; -procedure TForm1.InitalizeTMThread(var Thread: TMThread); +procedure TSimbaForm.InitalizeTMThread(var Thread: TMThread); var DbgImgInfo : TDbgImgInfo; AppPath : string; @@ -1412,7 +1412,7 @@ begin Thread.OpenFileEvent:=@ThreadOpenFileEvent; end; -procedure TForm1.HandleParameters; +procedure TSimbaForm.HandleParameters; var DoRun : Boolean; ErrorMsg : string; @@ -1452,7 +1452,7 @@ begin Self.RunScript; end; -procedure TForm1.OnSaveScript(const Filename: string); +procedure TSimbaForm.OnSaveScript(const Filename: string); begin with CurrScript do begin @@ -1472,7 +1472,7 @@ begin end; -procedure TForm1.ActionTabLastExecute(Sender: TObject); +procedure TSimbaForm.ActionTabLastExecute(Sender: TObject); var CurrIndex : integer; begin @@ -1484,7 +1484,7 @@ begin PageControl1.TabIndex:= CurrIndex; end; -procedure TForm1.ActionCloseTabExecute(Sender: TObject); +procedure TSimbaForm.ActionCloseTabExecute(Sender: TObject); begin if(PageControl1.PageCount > 1)then Self.DeleteTab(PageControl1.TabIndex,false) @@ -1492,7 +1492,7 @@ begin Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way. end; -procedure TForm1.ActionCompileScriptExecute(Sender: TObject); +procedure TSimbaForm.ActionCompileScriptExecute(Sender: TObject); var TempThread : TMThread; begin @@ -1501,14 +1501,14 @@ begin TempThread.Resume; end; -procedure TForm1.ActionConsoleExecute(Sender: TObject); +procedure TSimbaForm.ActionConsoleExecute(Sender: TObject); begin {$ifdef mswindows} ShowConsole(not ConsoleVisible); {$endif} end; -procedure TForm1.ActionCopyExecute(Sender: TObject); +procedure TSimbaForm.ActionCopyExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.SynEdit.CopyToClipboard @@ -1516,7 +1516,7 @@ begin Memo1.CopyToClipboard; end; -procedure TForm1.ActionCutExecute(Sender: TObject); +procedure TSimbaForm.ActionCutExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.SynEdit.CutToClipboard @@ -1524,7 +1524,7 @@ begin Memo1.CutToClipboard; end; -procedure TForm1.ActionDeleteExecute(Sender: TObject); +procedure TSimbaForm.ActionDeleteExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.SynEdit.ClearSelection @@ -1532,17 +1532,17 @@ begin Memo1.ClearSelection; end; -procedure TForm1.ActionExitExecute(Sender: TObject); +procedure TSimbaForm.ActionExitExecute(Sender: TObject); begin Self.Close; end; -procedure TForm1.ActionFindNextExecute(Sender: TObject); +procedure TSimbaForm.ActionFindNextExecute(Sender: TObject); begin DoSearch(true, false); end; -procedure TForm1.ActionFindstartExecute(Sender: TObject); +procedure TSimbaForm.ActionFindstartExecute(Sender: TObject); begin if frmFunctionList.Focused or frmFunctionList.FunctionList.Focused or frmFunctionList.editSearchList.Focused then begin @@ -1556,23 +1556,23 @@ begin end; end; -procedure TForm1.ActionClearDebugExecute(Sender: TObject); +procedure TSimbaForm.ActionClearDebugExecute(Sender: TObject); begin Memo1.Clear; end; -procedure TForm1.ActionNewExecute(Sender: TObject); +procedure TSimbaForm.ActionNewExecute(Sender: TObject); begin //Self.ClearScript; Self.AddTab; end; -procedure TForm1.ActionNewTabExecute(Sender: TObject); +procedure TSimbaForm.ActionNewTabExecute(Sender: TObject); begin Self.AddTab; end; -procedure TForm1.ActionNormalSizeExecute(Sender: TObject); +procedure TSimbaForm.ActionNormalSizeExecute(Sender: TObject); var SizeStr : string; Data : TStringArray; @@ -1590,12 +1590,12 @@ begin end; end; -procedure TForm1.ActionOpenExecute(Sender: TObject); +procedure TSimbaForm.ActionOpenExecute(Sender: TObject); begin Self.OpenScript; end; -procedure TForm1.ActionPasteExecute(Sender: TObject); +procedure TSimbaForm.ActionPasteExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.SynEdit.PasteFromClipboard @@ -1608,12 +1608,12 @@ begin end; -procedure TForm1.ActionPauseExecute(Sender: TObject); +procedure TSimbaForm.ActionPauseExecute(Sender: TObject); begin Self.PauseScript; end; -procedure TForm1.ActionRedoExecute(Sender: TObject); +procedure TSimbaForm.ActionRedoExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.Redo @@ -1621,19 +1621,19 @@ begin Memo1.Undo; //? end; -procedure TForm1.ActionReplaceExecute(Sender: TObject); +procedure TSimbaForm.ActionReplaceExecute(Sender: TObject); begin if(ScriptPopup.HandleAllocated)then dlgReplace.FindText:= CurrScript.SynEdit.SelText; dlgReplace.Execute; end; -procedure TForm1.ActionRunExecute(Sender: TObject); +procedure TSimbaForm.ActionRunExecute(Sender: TObject); begin Self.RunScript; end; -procedure TForm1.ActionSaveAllExecute(Sender: TObject); +procedure TSimbaForm.ActionSaveAllExecute(Sender: TObject); var i : integer; OldIndex : integer; @@ -1647,17 +1647,17 @@ begin PageControl1.TabIndex:= oldindex; end; -procedure TForm1.ActionSaveAsExecute(Sender: TObject); +procedure TSimbaForm.ActionSaveAsExecute(Sender: TObject); begin Self.SaveCurrentScriptAs; end; -procedure TForm1.ActionSaveExecute(Sender: TObject); +procedure TSimbaForm.ActionSaveExecute(Sender: TObject); begin Self.SaveCurrentScript; end; -procedure TForm1.ActionSelectAllExecute(Sender: TObject); +procedure TSimbaForm.ActionSelectAllExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.SynEdit.SelectAll @@ -1668,12 +1668,12 @@ begin end; -procedure TForm1.ActionStopExecute(Sender: TObject); +procedure TSimbaForm.ActionStopExecute(Sender: TObject); begin Self.StopScript; end; -procedure TForm1.ActionTabNextExecute(Sender: TObject); +procedure TSimbaForm.ActionTabNextExecute(Sender: TObject); var CurrIndex : integer; begin @@ -1685,7 +1685,7 @@ begin PageControl1.TabIndex:= CurrIndex; end; -procedure TForm1.ActionUndoExecute(Sender: TObject); +procedure TSimbaForm.ActionUndoExecute(Sender: TObject); begin if CurrScript.SynEdit.Focused or ScriptPopup.HandleAllocated then CurrScript.Undo @@ -1693,7 +1693,7 @@ begin Memo1.Undo; end; -procedure TForm1.ChangeMouseStatus(Sender: TObject); +procedure TSimbaForm.ChangeMouseStatus(Sender: TObject); var x, y: Integer; begin @@ -1709,7 +1709,7 @@ begin StatusBar.Panels[Panel_Coords].Text := Format('(%d, %d)', [x, y]); end; -procedure TForm1.CheckBoxMatchCaseClick(Sender: TObject); +procedure TSimbaForm.CheckBoxMatchCaseClick(Sender: TObject); begin RefreshTab; CurrScript.SynEdit.MarkupByClass[TSynEditMarkupHighlightAllCaret].TempDisable; @@ -1721,7 +1721,7 @@ end; -procedure TForm1.CloseFindPanel; +procedure TSimbaForm.CloseFindPanel; begin SearchPanel.Visible:= false; if CurrScript.SynEdit.CanFocus then @@ -1732,13 +1732,13 @@ end; If we are being sent to the background; then minimize other active windows as well. } -procedure TForm1.doOnHide(Sender: TObject); +procedure TSimbaForm.doOnHide(Sender: TObject); begin if DebugImgForm.Visible then DebugImgForm.Hide; end; -procedure TForm1.StopCodeCompletion; +procedure TSimbaForm.StopCodeCompletion; begin CodeCompletionForm.Hide; if frmFunctionList.InCodeCompletion then @@ -1760,12 +1760,12 @@ begin end; end; -function TForm1.FindTab(filename: string): integer; +function TSimbaForm.FindTab(filename: string): integer; var i : integer; begin FileName := SetDirSeparators(filename); - for i := 0 to Form1.Tabs.Count - 1 do + for i := 0 to SimbaForm.Tabs.Count - 1 do {$ifdef MSWindows} //Case insensitive if lowercase(TMufasaTab(Tabs[i]).ScriptFrame.ScriptFile) = lowercase(filename) then {$else} @@ -1775,13 +1775,13 @@ begin result := -1; end; -procedure TForm1.editSearchListExit(Sender: TObject); +procedure TSimbaForm.editSearchListExit(Sender: TObject); begin frmFunctionList.editSearchList.Color := clWhite; StopCodeCompletion; end; -procedure TForm1.editSearchListKeyDown(Sender: TObject; var Key: Word; +procedure TSimbaForm.editSearchListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key = vk_up then @@ -1796,7 +1796,7 @@ begin end; end; -procedure TForm1.editSearchListKeyPress(Sender: TObject; var Key: char); +procedure TSimbaForm.editSearchListKeyPress(Sender: TObject; var Key: char); var linetext : string; begin @@ -1831,7 +1831,7 @@ begin end; end; -procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String +procedure TSimbaForm.FormDropFiles(Sender: TObject; const FileNames: array of String ); var i : integer; @@ -1857,7 +1857,7 @@ begin {$EndIf}; end; -procedure TForm1.FunctionListChange(Sender: TObject; Node: TTreeNode); +procedure TSimbaForm.FunctionListChange(Sender: TObject; Node: TTreeNode); var MethodInfo : TMethodInfo; begin @@ -1872,33 +1872,33 @@ begin end; end; -procedure TForm1.FunctionListEnter(Sender: TObject); +procedure TSimbaForm.FunctionListEnter(Sender: TObject); begin frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text); end; -procedure TForm1.FunctionListExit(Sender: TObject); +procedure TSimbaForm.FunctionListExit(Sender: TObject); begin // StatusBar.Panels[2].Text:= ''; end; -procedure TForm1.FunctionListTimerTimer(Sender: TObject); +procedure TSimbaForm.FunctionListTimerTimer(Sender: TObject); begin if Self.Visible and (CurrScript <> nil) then frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text); end; -procedure TForm1.MenuItemExtensionsClick(Sender: TObject); +procedure TSimbaForm.MenuItemExtensionsClick(Sender: TObject); begin ExtensionsForm.Show; end; -procedure TForm1.MenuItemHandbookClick(Sender: TObject); +procedure TSimbaForm.MenuItemHandbookClick(Sender: TObject); begin OpenURL('http://wizzup.org/static/simba/doc/ps_handbook/'); end; -procedure TForm1.MenuItemColourHistoryClick(Sender: TObject); +procedure TSimbaForm.MenuItemColourHistoryClick(Sender: TObject); begin MenuItemColourHistory.Checked := not ColourHistoryForm.Visible; if MenuItemColourHistory.Checked then @@ -1907,13 +1907,13 @@ begin ColourHistoryForm.Hide; end; -procedure TForm1.dlgReplaceFind(Sender: TObject); +procedure TSimbaForm.dlgReplaceFind(Sender: TObject); begin SearchString := dlgReplace.FindText; DoSearch(True, False); end; -procedure TForm1.dlgReplaceReplace(Sender: TObject); +procedure TSimbaForm.dlgReplaceReplace(Sender: TObject); var SOptions: TSynSearchOptions; P: TPoint; @@ -1952,13 +1952,13 @@ begin end; end; -procedure TForm1.EditSearchChange(Sender: TObject); +procedure TSimbaForm.EditSearchChange(Sender: TObject); begin SearchString :=LabeledEditSearch.Text; DoSearch(false, true); end; -procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction); +procedure TSimbaForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); var i : integer; begin @@ -1981,21 +1981,21 @@ var b: TStringList; ms: TMemoryStream; begin - if form1.UpdatingFonts then + if SimbaForm.UpdatingFonts then begin mDebugLn('Updating the fonts, thus waiting a bit till we init the OCR.'); - while form1.UpdatingFonts do + while SimbaForm.UpdatingFonts do begin if GetCurrentThreadId = MainThreadID then Application.ProcessMessages; sleep(25); end; end; - form1.InitalizeTMThread(t); + SimbaForm.InitalizeTMThread(t); KillThread(t.ThreadID); if (t is TPSThread) then try - a := TPSScriptExtension.Create(form1); + a := TPSScriptExtension.Create(SimbaForm); b := TStringList.Create; ms := TMemoryStream.Create; @@ -2015,7 +2015,7 @@ begin CoreBuffer[0] := TCodeInsight.Create; with CoreBuffer[0] do begin - OnMessage := @form1.OnCCMessage; + OnMessage := @SimbaForm.OnCCMessage; b.SaveToStream(ms); Run(ms, nil, -1, True); FileName := '"PSCORE"'; @@ -2030,7 +2030,7 @@ begin end; end; -procedure TForm1.FormCreate(Sender: TObject); +procedure TSimbaForm.FormCreate(Sender: TObject); var FillThread : TProcThread; begin @@ -2112,7 +2112,7 @@ begin self.EndFormUpdate; end; -procedure TForm1.FormDestroy(Sender: TObject); +procedure TSimbaForm.FormDestroy(Sender: TObject); var i : integer; begin @@ -2137,7 +2137,7 @@ begin {$endif} end; -procedure TForm1.FormShortCuts(var Msg: TLMKey; var Handled: Boolean); +procedure TSimbaForm.FormShortCuts(var Msg: TLMKey; var Handled: Boolean); begin SetEditActions; Handled := ActionList.IsShortCut(Msg); @@ -2145,7 +2145,7 @@ end; -procedure TForm1.LabeledEditSearchEnter(Sender: TObject); +procedure TSimbaForm.LabeledEditSearchEnter(Sender: TObject); begin SearchStart := CurrScript.SynEdit.LogicalCaretXY; with CurrScript.SynEdit do @@ -2155,13 +2155,13 @@ begin end; end; -procedure TForm1.LabeledEditSearchExit(Sender: TObject); +procedure TSimbaForm.LabeledEditSearchExit(Sender: TObject); begin if not CheckBoxMatchCase.MouseEntered then RefreshTab; end; -procedure TForm1.LabeledEditSearchKeyDown(Sender: TObject; var Key: Word; +procedure TSimbaForm.LabeledEditSearchKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (ssCtrl in Shift) and (key = vk_f) then @@ -2175,7 +2175,7 @@ begin end; end; -procedure TForm1.LabeledEditSearchKeyPress(Sender: TObject; var Key: char); +procedure TSimbaForm.LabeledEditSearchKeyPress(Sender: TObject; var Key: char); begin if key = #13 then begin; @@ -2186,22 +2186,22 @@ begin end; end; -procedure TForm1.MenuEditClick(Sender: TObject); +procedure TSimbaForm.MenuEditClick(Sender: TObject); begin SetEditActions; end; -procedure TForm1.MenuItemAboutClick(Sender: TObject); +procedure TSimbaForm.MenuItemAboutClick(Sender: TObject); begin AboutForm.ShowModal; end; -procedure TForm1.MenuItemCloseTabsClick(Sender: TObject); +procedure TSimbaForm.MenuItemCloseTabsClick(Sender: TObject); begin Self.CloseTabs; end; -procedure TForm1.MenuItemDebugImageClick(Sender: TObject); +procedure TSimbaForm.MenuItemDebugImageClick(Sender: TObject); begin MenuItemDebugImage.Checked := not DebugImgForm.Visible; if MenuItemDebugImage.Checked then @@ -2210,7 +2210,7 @@ begin DebugImgForm.Hide; end; -procedure TForm1.MenuItemExportHTMLClick(Sender: TObject); +procedure TSimbaForm.MenuItemExportHTMLClick(Sender: TObject); var SynExporterHTML : TSynExporterHTML; begin; @@ -2239,7 +2239,7 @@ end; procedure formWritelnEx(S: String); begin - Form1.Memo1.Lines.Add(s); + SimbaForm.Memo1.Lines.Add(s); end; function GetMethodName( Decl : string; PlusNextChar : boolean) : string; @@ -2269,7 +2269,7 @@ begin; result := result + ';'; end; -procedure TForm1.MenuitemFillFunctionListClick(Sender: TObject); +procedure TSimbaForm.MenuitemFillFunctionListClick(Sender: TObject); var Methods : TExpMethodArr; LastSection : string; @@ -2324,7 +2324,7 @@ begin frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text); end; -procedure TForm1.MenuItemHideClick(Sender: TObject); +procedure TSimbaForm.MenuItemHideClick(Sender: TObject); begin if Self.Visible = false then MenuItemShowClick(sender) @@ -2332,45 +2332,45 @@ begin Self.Hide; end; -procedure TForm1.MenuItemReportBugClick(Sender: TObject); +procedure TSimbaForm.MenuItemReportBugClick(Sender: TObject); begin OpenURL('http://mufasa.villavu.com/mantis/bug_report_page.php'); end; -procedure TForm1.MenuItemSettingsButtonClick(Sender: TObject); +procedure TSimbaForm.MenuItemSettingsButtonClick(Sender: TObject); begin SettingsForm.ShowModal; end; -procedure TForm1.MenuItemShowClick(Sender: TObject); +procedure TSimbaForm.MenuItemShowClick(Sender: TObject); begin Self.Show; Self.WindowState := wsNormal; end; -procedure TForm1.MenuItemTabCloseClick(Sender: TObject); +procedure TSimbaForm.MenuItemTabCloseClick(Sender: TObject); begin DeleteTab(PopupTab,false); end; -procedure TForm1.MenuItemTabCloseOthersClick(Sender: TObject); +procedure TSimbaForm.MenuItemTabCloseOthersClick(Sender: TObject); begin CloseTabs(PopupTab); end; -procedure TForm1.MenuItemFunctionListClick(Sender: TObject); +procedure TSimbaForm.MenuItemFunctionListClick(Sender: TObject); begin FunctionListShown(not MenuItemFunctionList.Checked); end; -procedure TForm1.MTrayIconClick(Sender: TObject); +procedure TSimbaForm.MTrayIconClick(Sender: TObject); begin self.Show; if Self.CanFocus then self.SetFocus; end; -function TForm1.GetSimbaNews: String; +function TSimbaForm.GetSimbaNews: String; var t: TDownloadThread; begin @@ -2384,12 +2384,12 @@ begin end; end; -procedure TForm1.SetExtPath(const AValue: string); +procedure TSimbaForm.SetExtPath(const AValue: string); begin SetSetting('Settings/Extensions/Path',AValue,true); end; -procedure TForm1.NewsTimerTimer(Sender: TObject); +procedure TSimbaForm.NewsTimerTimer(Sender: TObject); var s: String; News : TStringList; {Need it for correct EOL stuff} @@ -2403,7 +2403,7 @@ begin News.free; end; -procedure TForm1.OnLinePSScript(Sender: TObject); +procedure TSimbaForm.OnLinePSScript(Sender: TObject); begin {$IFDEF ProcessMessages} Application.ProcessMessages; //Don't think that this is neccesary though @@ -2412,7 +2412,7 @@ end; -procedure TForm1.ButtonPickClick(Sender: TObject); +procedure TSimbaForm.ButtonPickClick(Sender: TObject); var c, x, y: Integer; cobj: TColourPickerObject; @@ -2429,30 +2429,30 @@ begin end; -procedure TForm1.ButtonSelectorDown(Sender: TObject; Button: TMouseButton; +procedure TSimbaForm.ButtonSelectorDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Manager.SetTarget(Selector.Drag); FormWritelnEx('New window: ' + IntToStr(Selector.LastPick)); end; -procedure TForm1.PageControl1Change(Sender: TObject); +procedure TSimbaForm.PageControl1Change(Sender: TObject); begin RefreshTab(); end; -procedure TForm1.ButtonTrayClick(Sender: TObject); +procedure TSimbaForm.ButtonTrayClick(Sender: TObject); begin self.hide; end; -procedure TForm1.PageControl1Changing(Sender: TObject; var AllowChange: Boolean +procedure TSimbaForm.PageControl1Changing(Sender: TObject; var AllowChange: Boolean ); begin LastTab:= PageControl1.TabIndex; end; -procedure TForm1.PageControl1ContextPopup(Sender: TObject; MousePos: TPoint; +procedure TSimbaForm.PageControl1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); begin PopupTab := PageControl1.TabIndexAtClientPos(MousePos); @@ -2463,7 +2463,7 @@ begin end; end; -procedure TForm1.PageControl1DragDrop(Sender, Source: TObject; X, Y: Integer); +procedure TSimbaForm.PageControl1DragDrop(Sender, Source: TObject; X, Y: Integer); var NewPos : integer; OldPos : integer; @@ -2479,7 +2479,7 @@ begin end; end; -procedure TForm1.PageControl1DragOver(Sender, Source: TObject; X, Y: Integer; +procedure TSimbaForm.PageControl1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); var Pos: Integer; @@ -2488,7 +2488,7 @@ begin Accept := (Pos <> PageControl1.TabIndex) and (Pos <> -1); end; -procedure TForm1.PageControl1MouseDown(Sender: TObject; Button: TMouseButton; +procedure TSimbaForm.PageControl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if(Button = mbLeft)then @@ -2500,7 +2500,7 @@ begin end; end; -procedure TForm1.PageControl1MouseUp(Sender: TObject; Button: TMouseButton; +procedure TSimbaForm.PageControl1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if(Button = mbMiddle) and (not(PageControl1.Dragging))then @@ -2508,7 +2508,7 @@ begin DeleteTab(PageControl1.TabIndexAtClientPos(Classes.Point(x,y)), False); end; -procedure TForm1.PickerPick(Sender: TObject; const Colour, colourx, +procedure TSimbaForm.PickerPick(Sender: TObject; const Colour, colourx, coloury: integer); var Args : TVariantArray; @@ -2520,38 +2520,38 @@ begin ExtManager.HandleHook(EventHooks[SExt_OnColourPick].HookName,Args); end; -procedure TForm1.PopupItemFindClick(Sender: TObject); +procedure TSimbaForm.PopupItemFindClick(Sender: TObject); begin SearchString := CurrScript.SynEdit.SelText; ActionFindNextExecute(ScriptPopup); end; -function TForm1.GetScriptState: TScriptState; +function TSimbaForm.GetScriptState: TScriptState; begin result := CurrScript.FScriptState; end; -function TForm1.GetShowHintAuto: boolean; +function TSimbaForm.GetShowHintAuto: boolean; begin Result := LowerCase(LoadSettingDef('Settings/CodeHints/ShowAutomatically','True')) = 'true'; end; -procedure TForm1.SetFontPath(const AValue: String); +procedure TSimbaForm.SetFontPath(const AValue: String); begin SetSetting('Settings/Fonts/Path',AValue,true); end; -function TForm1.GetFontPath: String; +function TSimbaForm.GetFontPath: String; begin Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Fonts/Path', ExpandFileName(MainDir+DS+'Fonts' + DS))); end; -function TForm1.GetExtPath: string; +function TSimbaForm.GetExtPath: string; begin result :=IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Extensions/Path', ExpandFileName(MainDir+DS+'Extensions' + DS))); end; -function TForm1.GetHighlighter: TSynCustomHighlighter; +function TSimbaForm.GetHighlighter: TSynCustomHighlighter; begin if lowercase(LoadSettingDef('Settings/SourceEditor/LazColors','True')) = 'true' then result := LazHighlighter @@ -2559,32 +2559,32 @@ begin result := SCARHighlighter; end; -function TForm1.GetIncludePath: String; +function TSimbaForm.GetIncludePath: String; begin Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Includes/Path', ExpandFileName(MainDir+DS+'Includes' + DS))); end; -function TForm1.GetPluginPath: string; +function TSimbaForm.GetPluginPath: string; begin Result := IncludeTrailingPathDelimiter(LoadSettingDef('Settings/Plugins/Path', ExpandFileName(MainDir+DS+'Plugins' + DS))); end; -procedure TForm1.SetIncludePath(const AValue: String); +procedure TSimbaForm.SetIncludePath(const AValue: String); begin SetSetting('Settings/Includes/Path',AValue,true); end; -procedure TForm1.SetPluginPath(const AValue: string); +procedure TSimbaForm.SetPluginPath(const AValue: string); begin SetSetting('Settings/Plugins/Path',AValue,true); end; -procedure TForm1.SetScriptPath(const AValue: string); +procedure TSimbaForm.SetScriptPath(const AValue: string); begin SetSetting('Settings/Scripts/Path',AValue,True); end; -procedure TForm1.SetScriptState(const State: TScriptState); +procedure TSimbaForm.SetScriptState(const State: TScriptState); begin CurrScript.FScriptState:= State; with Self.StatusBar.panels[Panel_State] do @@ -2612,17 +2612,17 @@ begin end; end; -function TForm1.LoadSettingDef(const Key,Def: string): string; +function TSimbaForm.LoadSettingDef(const Key,Def: string): string; begin result := SettingsForm.Settings.GetKeyValueDefLoad(Key,def,SimbaSettingsFile); end; -function TForm1.CreateSetting(const Key,Value: string): string; +function TSimbaForm.CreateSetting(const Key,Value: string): string; begin result := SettingsForm.Settings.GetKeyValueDef(Key,value); end; -procedure TForm1.SetSetting(const key,Value: string; save : boolean); +procedure TSimbaForm.SetSetting(const key,Value: string; save : boolean); begin //Creates the setting if needed SettingsForm.Settings.SetKeyValue(key,value); @@ -2630,12 +2630,12 @@ begin SettingsForm.Settings.SaveToXML(SimbaSettingsFile); end; -function TForm1.SettingExtists(const key: string): boolean; +function TSimbaForm.SettingExtists(const key: string): boolean; begin result :=SettingsForm.Settings.KeyExists(key); end; -procedure TForm1.FontUpdate; +procedure TSimbaForm.FontUpdate; procedure Idler; begin Application.ProcessMessages; @@ -2697,7 +2697,7 @@ begin UpdatingFonts := False; end; -procedure TForm1.ScriptStartEvent(Sender: TObject; var Script: string; +procedure TSimbaForm.ScriptStartEvent(Sender: TObject; var Script: string; var Continue: boolean); begin ScriptStartData.Sender:=Sender; @@ -2706,7 +2706,7 @@ begin TThread.Synchronize(nil,@HandleScriptStartData); end; -procedure TForm1.SetShowHintAuto(const AValue: boolean); +procedure TSimbaForm.SetShowHintAuto(const AValue: boolean); begin SetSetting('Settings/CodeHints/ShowAutomatically',Booltostr(AValue,true)); end; @@ -2714,7 +2714,7 @@ end; {$ifdef mswindows} function GetConsoleWindow: HWND; stdcall; external kernel32 name 'GetConsoleWindow'; -procedure TForm1.ShowConsole(ShowIt: boolean); +procedure TSimbaForm.ShowConsole(ShowIt: boolean); var ProcessId : DWOrd; begin @@ -2734,7 +2734,7 @@ begin end; {$endif} -procedure TForm1.FunctionListShown(ShowIt: boolean); +procedure TSimbaForm.FunctionListShown(ShowIt: boolean); begin with MenuItemFunctionList, frmFunctionList do begin @@ -2766,7 +2766,7 @@ begin end; -procedure TForm1.SafeCallThread; +procedure TSimbaForm.SafeCallThread; var thread: TMThread; LocalCopy : TSyncInfo; @@ -2793,7 +2793,7 @@ begin end; end; -function TForm1.OpenScript: boolean; +function TSimbaForm.OpenScript: boolean; var OpenInNewTab : boolean; begin @@ -2814,7 +2814,7 @@ begin end; end; -function TForm1.LoadScriptFile(filename: string; AlwaysOpenInNewTab: boolean; CheckOtherTabs : boolean +function TSimbaForm.LoadScriptFile(filename: string; AlwaysOpenInNewTab: boolean; CheckOtherTabs : boolean ): boolean; var OpenInNewTab : boolean; @@ -2858,7 +2858,7 @@ begin end; end; -function TForm1.SaveCurrentScript: boolean; +function TSimbaForm.SaveCurrentScript: boolean; begin with CurrScript do begin @@ -2879,7 +2879,7 @@ begin end; end; -function TForm1.SaveCurrentScriptAs: boolean; +function TSimbaForm.SaveCurrentScriptAs: boolean; var ScriptFile : string; begin @@ -2904,7 +2904,7 @@ begin end; end; -function TForm1.CanExitOrOpen: boolean; +function TSimbaForm.CanExitOrOpen: boolean; begin; Self.Enabled := False;//We HAVE to answer the popup Result := True; @@ -2937,7 +2937,7 @@ begin; Self.SetFocus; end; -function TForm1.ClearScript: boolean; +function TSimbaForm.ClearScript: boolean; begin result := false; if CanExitOrOpen then diff --git a/Projects/SAMufasaGUI/updateform.pas b/Projects/SAMufasaGUI/updateform.pas index 48880e1..ebb0d9d 100644 --- a/Projects/SAMufasaGUI/updateform.pas +++ b/Projects/SAMufasaGUI/updateform.pas @@ -81,14 +81,14 @@ var implementation uses - internets, TestUnit, simbasettings,lclintf; + internets, simba, simbasettings,lclintf; function TSimbaUpdateForm.CanUpdate: Boolean; begin GetLatestSimbaVersion; - mDebugLn(format('Current Simba version: %d',[TestUnit.SimbaVersion])); + mDebugLn(format('Current Simba version: %d',[simba.SimbaVersion])); mDebugLn('Latest Simba Version: ' + IntToStr(FSimbaVersion)); - Exit(testunit.SimbaVersion < FSimbaVersion); + Exit(simba.SimbaVersion < FSimbaVersion); end; function TSimbaUpdateForm.GetLatestFontVersion: integer;