2010-06-06 07:05:15 -04:00
|
|
|
unit scriptmanager;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
2010-06-07 18:15:20 -04:00
|
|
|
ExtCtrls, ComCtrls, settings, MufasaTypes;
|
2010-06-06 07:05:15 -04:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
TForm1 = class(TForm)
|
|
|
|
Button1: TButton;
|
|
|
|
ImageList1: TImageList;
|
|
|
|
ListView1: TListView;
|
|
|
|
TreeView1: TTreeView;
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
|
|
|
{ public declarations }
|
2010-06-07 18:15:20 -04:00
|
|
|
end;
|
|
|
|
|
|
|
|
TSimbaScript = class(TObject)
|
|
|
|
|
|
|
|
public
|
|
|
|
Name, Version, Author, Description: String;
|
|
|
|
Tags, Files: TStringArray;
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
public
|
|
|
|
constructor Create(n: TTreeNode);
|
|
|
|
destructor Delete;
|
|
|
|
end;
|
2010-06-06 07:05:15 -04:00
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
|
|
|
{ TForm1 }
|
2010-06-07 18:15:20 -04:00
|
|
|
procedure fill(s: TMMLSettings);
|
|
|
|
var
|
|
|
|
i:integer;
|
|
|
|
n, nn: TTreeNode;
|
|
|
|
ss: TSimbaScript;
|
|
|
|
begin
|
|
|
|
n := s.WalkToNode('Scripts/ScriptList/');
|
|
|
|
nn := n.GetFirstChild;
|
|
|
|
while nn <> nil do
|
|
|
|
begin
|
|
|
|
ss := TSimbaScript.Create(nn);
|
|
|
|
nn := nn.GetNextSibling;
|
|
|
|
end;
|
|
|
|
end;
|
2010-06-06 07:05:15 -04:00
|
|
|
|
|
|
|
procedure TForm1.Button1Click(Sender: TObject);
|
2010-06-07 18:15:20 -04:00
|
|
|
var
|
|
|
|
s: TMMLSettings;
|
|
|
|
begin
|
|
|
|
s := TMMLSettings.Create(TreeView1.Items);
|
|
|
|
s.LoadFromXML('/scratch/gittest/list.xml');
|
|
|
|
fill(s);
|
|
|
|
s.Free;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ TSimbaScript }
|
|
|
|
|
|
|
|
constructor TSimbaScript.Create(n: TTreeNode);
|
2010-06-06 07:05:15 -04:00
|
|
|
begin
|
2010-06-07 18:15:20 -04:00
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
destructor TSimbaScript.Delete;
|
|
|
|
begin
|
|
|
|
|
2010-06-06 07:05:15 -04:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|
|
|
|
|