diff --git a/Projects/ScriptManager/project1.lpi b/Projects/ScriptManager/project1.lpi index a1d406d..8ab26ec 100644 --- a/Projects/ScriptManager/project1.lpi +++ b/Projects/ScriptManager/project1.lpi @@ -34,12 +34,12 @@ - + - + @@ -50,9 +50,9 @@ - - - + + + @@ -76,8 +76,8 @@ - - + + @@ -118,127 +118,136 @@ + + + + + + + + + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - + - + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - + - - + + - + - + - + - - + + diff --git a/Projects/ScriptManager/scriptmanager.lfm b/Projects/ScriptManager/scriptmanager.lfm index 04f7c49..3ace3ac 100644 --- a/Projects/ScriptManager/scriptmanager.lfm +++ b/Projects/ScriptManager/scriptmanager.lfm @@ -1,9 +1,9 @@ object Form1: TForm1 - Left = 1499 + Left = 1490 Height = 567 - Top = 51 + Top = 293 Width = 825 - ActiveControl = Button1 + ActiveControl = TreeView1 Caption = 'Form1' ClientHeight = 567 ClientWidth = 825 diff --git a/Projects/ScriptManager/scriptmanager.pas b/Projects/ScriptManager/scriptmanager.pas index a042790..f05366e 100644 --- a/Projects/ScriptManager/scriptmanager.pas +++ b/Projects/ScriptManager/scriptmanager.pas @@ -1,3 +1,26 @@ +{ + This file is part of the Simba Project + Copyright (c) 2009 by Raymond van Venetiƫ and Merlijn Wajer + + Simba is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Simba is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MML. If not, see . + + See the file COPYING, included in this distribution, + for details about the copyright. + + Script Manager for the Simba project. +} + unit scriptmanager; {$mode objfpc}{$H+} @@ -33,7 +56,7 @@ type private public - constructor Create(n: TTreeNode); + constructor Create; destructor Delete; end; @@ -48,15 +71,24 @@ implementation procedure fill(s: TMMLSettings); var i:integer; - n, nn: TTreeNode; ss: TSimbaScript; + LI: TListItem; + strarr: TStringArray; begin - n := s.WalkToNode('Scripts/ScriptList/'); - nn := n.GetFirstChild; - while nn <> nil do + if not s.ListKeys('Scripts/ScriptList', strarr) then + writeln('ListKeys returned false'); + writeln('strarr length: ' + inttostr(length(strarr))); + for i := 0 to high(strarr) do begin - ss := TSimbaScript.Create(nn); - nn := nn.GetNextSibling; + writeln(s.GetKeyValue('Scripts/ScriptList/Script/Name')); + ss := TSimbaScript.Create(); + ss.Name := s.GetKeyValue('Scripts/ScriptList/Script/Name'); + LI := Form1.ListView1.Items.Add; + LI.Caption := ss.Name; + LI.Data := ss; + LI.ImageIndex:= 0; + + s.DeleteKey('Scripts/ScriptList/Script'); end; end; @@ -72,14 +104,19 @@ end; { TSimbaScript } -constructor TSimbaScript.Create(n: TTreeNode); +constructor TSimbaScript.Create; begin + inherited; + {stuff here} end; destructor TSimbaScript.Delete; begin + {stuff here} + + inherited; end; end.