Hi.
I am in the process of creating a program that retrieves information about the contents of a bookmark from an INI file.
I have successfully created a new tab:
actionList.Clear;
conf.ReadSectionValues(section,actionList);
if actionList.Count>0 then
begin
page:=PageControl1.AddTabSheet;
page.Visible:=True;
page.AutoSize:=True;
page.Caption:=actionGroup.Items[actionGroup.ItemIndex];
makePage(page);
PageControl1.ActivePage:=page;
self.DoAutoSize;
closeForm:=false;
end;
The procedure that generates its contents looks as follows:
var
actLine:integer; // actual line in INI section
elType,elParams:String; // element type (from INI section key) and element parameters (from key value)
elValue:TStringList;
eLabel:TLabel; // variables for new components
eRadiobutton:TRadioButton;
eCheckBox:TCheckBox;
eInput:TEdit;
i:Integer; // help variable
begin
actLine:=0;
while actLine<actionList.Count-1 do
begin
// take line from INI section
elType:=trim(actionList[actLine]); inc(actLine);
// split key as a element type and key value as a element parameters
i:=Pos('=',elType);
if i>0 then
begin
elParams:=copy(elType,i+1);
elType:=copy(elType,1,i);
end
else
elParams:='';
// split parameters to array of string
elValue:=TStringList.Create;
elValue.AddDelimitedText(elParams,',',True);
case elType of
'label':
begin
with TLabel.Create(tabSheet) do
begin
Align:=alTop;
Autosize:=true;
Parent:=tabSheet;
Caption:=elValue[0]; // first parameter is label content
end;
end;
'radiobutton':
begin
with TRadioButton.Create(tabSheet) do
begin
// first parameter is Name, but is not used
Align:=alTop;
Parent:=tabSheet;
Caption:=elValue[1]; // secound parameter is Caption
Tag:=actLine;
end;
end;
'checkbox':
begin
with TCheckbox.Create(tabSheet) do
begin
Align:=alTop;
Parent:=tabSheet;
Caption:=elValue[1];
Tag:=actLine;
end;
end;
'input':
begin
with TEdit.Create(tabSheet) do
begin
Align:=alTop;
Parent:=tabSheet;
Tag:=actLine;
end;
end;
end;
elValue.Free;
end;
end;
The code is not the most beautiful, but it was written on the fly

Example INI Section:
label="Krok 1."
radiobutton="Found","Pojazd przypisany do OBU"
checkbox="TollPass","Znaleziony w TollPass"
input=TP-LPN,Rejestracja pojazdu:
checkBox="O","Znaleziony w Outlooku"
input=OLPN,Rejestracja pojazdu:
radiobutton="Not Found',"Brak pojazdu z przypisanym OBU"
next=close
Unfortunately, after creating the content, nothing shows up for me in the Tab. What I don't know about is what needs to be done to make the contents of the bookmark visible. I send the expected view in the attachment.
The form in which the PageControl is located is of modal type, but that doesn't seem to matter much.
What I'd like is for the elements that are created in the tab, to be automatically aligned is the top of the tab (hence 'Align:=alTop') and be placed one below the other.
The whole window is supposed to adjust in size to the number of components in the tab - this is where I found the TForm.doAutosize procedure, which seems to work. I execute it at the end of creating the tab content.
Please Help.