1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-11 03:45:06 -05:00
Simba/Projects/SAMufasaGUI/testunit.pas
Wizzup? b5a8426f1e Gui changes:
- Added the TToolBar with the old Buttons.
	- Removed the bug Run button. The Green Run button is now functional.

Window changes:
	- Removed the Client: TObject parameter in TMWindow.Create,
	  the point of TMWindow was to be client independant, so it could
	  be used in the GUI too. This doesn't effect it's functionality in any way.

Client changes:
	Removed the Self variable passed to TMWindow.Create.



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@77 3f818213-9676-44b0-a9b4-5e4c4e03d09d
2009-09-22 20:55:15 +00:00

107 lines
2.1 KiB
ObjectPascal

unit TestUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Menus, ComCtrls, SynEdit, SynHighlighterPas, SynMemo,
//Client,
MufasaTypes,
mmlpsthread,
mmlthread,
window // for the comp picker and selector
;
type
{ TForm1 }
TForm1 = class(TForm)
Mufasa_Image_List: TImageList;
MainMenu1: TMainMenu;
Memo1: TMemo;
MenuItemScript: TMenuItem;
MenuItemRun: TMenuItem;
SynEdit1: TSynEdit;
SynFreePascalSyn1: TSynFreePascalSyn;
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;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure MenuItemRunClick(Sender: TObject);
private
{ private declarations }
public
Window: TMWindow;
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses
lclintf,plugins;
{ TForm1 }
procedure Run;
Var
MMLPSThread : TMMLPSThread;
begin
MMLPSThread := TMMLPSThread.Create(True);
MMLPSThread.SetPSScript(Form1.SynEdit1.Lines.Text);
MMLPSThread.SetDebug(Form1.Memo1);
MMLPSThread.Resume;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin;
Run;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Window := TMWindow.Create;
MainDir:= ExtractFileDir(Application.ExeName);
PluginsGlob := TMPlugins.Create;
PluginsGlob.PluginDirs.Add(ExpandFileName(MainDir + DS + '..' + DS + '..'+ DS + 'Plugins'+ DS));
// SynMemo1.sc
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Window.Free;
PluginsGlob.Free;
end;
procedure TForm1.MenuItemRunClick(Sender: TObject);
begin
Run;
end;
initialization
{$I testunit.lrs}
end.