Ok now, let me get off the soapbox and back to the topic
Now I'm continuing towards creating a class for the dynamic objects to create. For example, to dynamically create panels with two buttons, to avoid creating every object for itself and reparenting buttons etc. I'd create a class like this:
type
...
TMyPanel = class (TPanel)
ButtonA: TButton;
ButtonB: TButton;
end;
Then I create a dynamic instance of it, like before:
procedure TForm1.FormCreate(Sender: TObject);
begin
MyPanel := TMyPanel.Create(self);
MyPanel.Parent := Self;
end;
Then I get a panel. What needs to be done to create / initialize buttons which don't exist as objects in that moment?
I must note that I've tried doing this by using a frame, and it's actually a perfect solution. It's created visually, then it's simply added to the uses list, created a object using the frame's class, and 'reparented' it to the control where I wanted it to be. Yet I'd still like to know how could it be done manually like above... It's easy to use frames (and maybe object lists like someone mentioned somewhere), but I believe it's beneficial to understand how to use the language fully and without aids if need be.