2009-09-04 00:26:56 -04:00
|
|
|
unit TestUnit;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
2009-09-22 16:55:15 -04:00
|
|
|
StdCtrls, Menus, ComCtrls, SynEdit, SynHighlighterPas, SynMemo,
|
|
|
|
//Client,
|
|
|
|
MufasaTypes,
|
|
|
|
mmlpsthread,
|
|
|
|
mmlthread,
|
|
|
|
window // for the comp picker and selector
|
|
|
|
;
|
2009-09-04 00:26:56 -04:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
TForm1 = class(TForm)
|
2009-09-22 16:55:15 -04:00
|
|
|
Mufasa_Image_List: TImageList;
|
2009-09-19 22:08:02 -04:00
|
|
|
MainMenu1: TMainMenu;
|
|
|
|
Memo1: TMemo;
|
|
|
|
MenuItemScript: TMenuItem;
|
|
|
|
MenuItemRun: TMenuItem;
|
2009-09-12 02:24:59 -04:00
|
|
|
SynEdit1: TSynEdit;
|
|
|
|
SynFreePascalSyn1: TSynFreePascalSyn;
|
2009-09-22 16:55:15 -04:00
|
|
|
ToolBar1: TToolBar;
|
|
|
|
TB_Run: TToolButton;
|
|
|
|
TB_Pause: TToolButton;
|
|
|
|
TB_Stop: TToolButton;
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
TB_ReloadPlugins: TToolButton;
|
|
|
|
TB_WAT: TToolButton;
|
|
|
|
TB_NewTab: TToolButton;
|
|
|
|
TB_CloseTab: TToolButton;
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
TB_ClearDebug: TToolButton;
|
|
|
|
TB_PickColour: TToolButton;
|
|
|
|
TB_SelectClient: TToolButton;
|
|
|
|
ToolButton8: TToolButton;
|
|
|
|
TB_Convert: TToolButton;
|
2009-09-04 00:26:56 -04:00
|
|
|
procedure Button1Click(Sender: TObject);
|
2009-09-12 14:50:10 -04:00
|
|
|
procedure FormCreate(Sender: TObject);
|
2009-09-13 19:56:15 -04:00
|
|
|
procedure FormDestroy(Sender: TObject);
|
2009-09-19 22:08:02 -04:00
|
|
|
procedure MenuItemRunClick(Sender: TObject);
|
2009-09-04 00:26:56 -04:00
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
2009-09-22 16:55:15 -04:00
|
|
|
Window: TMWindow;
|
2009-09-04 00:26:56 -04:00
|
|
|
{ public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
2009-09-09 03:08:58 -04:00
|
|
|
uses
|
2009-09-13 19:56:15 -04:00
|
|
|
lclintf,plugins;
|
2009-09-04 00:26:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ TForm1 }
|
2009-09-19 22:08:02 -04:00
|
|
|
procedure Run;
|
2009-09-04 00:26:56 -04:00
|
|
|
Var
|
2009-09-12 02:24:59 -04:00
|
|
|
MMLPSThread : TMMLPSThread;
|
2009-09-04 00:26:56 -04:00
|
|
|
|
|
|
|
begin
|
2009-09-12 02:24:59 -04:00
|
|
|
MMLPSThread := TMMLPSThread.Create(True);
|
2009-09-19 22:08:02 -04:00
|
|
|
MMLPSThread.SetPSScript(Form1.SynEdit1.Lines.Text);
|
|
|
|
MMLPSThread.SetDebug(Form1.Memo1);
|
2009-09-12 02:24:59 -04:00
|
|
|
MMLPSThread.Resume;
|
2009-09-19 22:08:02 -04:00
|
|
|
end;
|
2009-09-12 02:24:59 -04:00
|
|
|
|
2009-09-19 22:08:02 -04:00
|
|
|
procedure TForm1.Button1Click(Sender: TObject);
|
|
|
|
begin;
|
|
|
|
Run;
|
2009-09-12 02:24:59 -04:00
|
|
|
end;
|
|
|
|
|
2009-09-12 14:50:10 -04:00
|
|
|
procedure TForm1.FormCreate(Sender: TObject);
|
|
|
|
begin
|
2009-09-22 16:55:15 -04:00
|
|
|
Window := TMWindow.Create;
|
2009-09-13 19:56:15 -04:00
|
|
|
MainDir:= ExtractFileDir(Application.ExeName);
|
|
|
|
PluginsGlob := TMPlugins.Create;
|
|
|
|
PluginsGlob.PluginDirs.Add(ExpandFileName(MainDir + DS + '..' + DS + '..'+ DS + 'Plugins'+ DS));
|
2009-09-19 22:08:02 -04:00
|
|
|
// SynMemo1.sc
|
2009-09-13 19:56:15 -04:00
|
|
|
end;
|
2009-09-12 14:50:10 -04:00
|
|
|
|
2009-09-13 19:56:15 -04:00
|
|
|
procedure TForm1.FormDestroy(Sender: TObject);
|
|
|
|
begin
|
2009-09-22 16:55:15 -04:00
|
|
|
Window.Free;
|
2009-09-13 19:56:15 -04:00
|
|
|
PluginsGlob.Free;
|
2009-09-12 14:50:10 -04:00
|
|
|
end;
|
|
|
|
|
2009-09-19 22:08:02 -04:00
|
|
|
procedure TForm1.MenuItemRunClick(Sender: TObject);
|
2009-09-12 02:24:59 -04:00
|
|
|
begin
|
2009-09-19 22:08:02 -04:00
|
|
|
Run;
|
2009-09-04 00:26:56 -04:00
|
|
|
end;
|
|
|
|
|
2009-09-19 22:08:02 -04:00
|
|
|
|
2009-09-04 00:26:56 -04:00
|
|
|
initialization
|
|
|
|
{$I testunit.lrs}
|
|
|
|
|
|
|
|
end.
|
|
|
|
|