Hi all,
I am currently using FPC 2.6.4., Lazarus 1.2.4 on Win 7/64.
In a benchmark unit I am using a CheckListBox for selection of functions to bench. So far I had it defined completely via object inspector - meaning when adding or deleting a function I had to change source code and make an equivalent change in the setup of the CheckListBox. As these things tend to screw up I wanted to initialize the items in the CheckListBox inside the benchmark unit. I found on message on the board regarding this and thought that something like the following would do
...
type
{ TBench }
TBench = class(TForm)
btnOK: TButton;
btnCancel: TButton;
clbFunc: TCheckListBox;
gbFunc: TGroupBox;
gbParam: TGroupBox;
vleParams: TValueListEditor;
procedure btnCancelClick(Sender: TObject);
procedure btnOKClick(Sender: TObject);
procedure btnOKEnter(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
...
type
tTimeFunc = procedure();
tBenchTab = record
Func: tTimeFunc;
Name: pChar;
Dscr: pChar;
end;
...
procedure lBenchInit();
var
Count: Cardinal;
begin
with Bench do
begin
for Count := 0 to SizeOf( BenchTab )-1 do
clbFunc.Items.Add( BenchTab[ Count ].Dscr );
end;
end;
Unfortunately all I get are runtime errors - I tried with an empty list in the object inspector, a list with one item, setting the item counter of the list to 0 before adding etc. etc.
Can anyone pls. help me with a link to a documentation how to work with CheckListBox or to a documented example in source pls.
Kind regards,
MathMan