05-04-2018, 04:51 PM
i found that working dynamically with Frames in iw is the same as in a vcl app, but it's not so simple and it's not like using a regular component.
i think you would need to register the Frame as a Class.
in EVERY Frame that need it, just before your Frame's type, add this :
type TFrameClass = Class of TIWAppForm;
then as usual :
type
TFrameMyRegisteredFrame = class(TFrame)
...
private
...
public
end;
and before the "end." add :
initialization
RegisterClass(TFrameMyRegisteredFrame);
another way is to work with Interfaces, but i never tried it myself so maybe you can dig into that and see if it's better for you.
don't forget to set the Frame's Parent when you create it in runtime, and also assign different names if you have more then one of the same frame.
currently, my app have about 300 Forms and Frames, so i looked for a more efficient way.
after many tries, i got to the conclusion that it doesn't worth the pain, so i converted many of my frames to be Forms...
i think you would need to register the Frame as a Class.
in EVERY Frame that need it, just before your Frame's type, add this :
type TFrameClass = Class of TIWAppForm;
then as usual :
type
TFrameMyRegisteredFrame = class(TFrame)
...
private
...
public
end;
and before the "end." add :
initialization
RegisterClass(TFrameMyRegisteredFrame);
another way is to work with Interfaces, but i never tried it myself so maybe you can dig into that and see if it's better for you.
don't forget to set the Frame's Parent when you create it in runtime, and also assign different names if you have more then one of the same frame.
currently, my app have about 300 Forms and Frames, so i looked for a more efficient way.
after many tries, i got to the conclusion that it doesn't worth the pain, so i converted many of my frames to be Forms...

