* * *

Author Topic: [SOLVED] Multiple copies of one form  (Read 300 times)

Eugene Loza

  • Sr. Member
  • ****
  • Posts: 364
    • Decoherence Studio :)
[SOLVED] Multiple copies of one form
« on: April 10, 2017, 05:02:06 pm »
Hi all! I'm making an game data editor and I need to work simultaneously in several copies of a form (i.e. in several translations or editing several game objects in parallel).
I've found two ways of doing that:
http://wiki.freepascal.org/Form_Tutorial#Create_a_Lazarus_designed_form_dynamically
by Application.CreateForm(TFormX, FormX[j]);
or by FormX[j] := TFormX.Create(MainForm);
Which one should I use?
« Last Edit: April 10, 2017, 09:40:19 pm by Eugene Loza »
My games in Lazarus/CastleGameEngine:
Project Helena (TBS/RPG) http://sourceforge.net/projects/projecthelena/ (Alpha)
Fire Madness (bullet hell) https://github.com/eugeneloza/FireMadness/ (release candidate)
Decoherence: beyond Wizardry (RPG) https://github.com/eugeneloza/Mazer (just started)

ASerge

  • Sr. Member
  • ****
  • Posts: 283
Re: Multiple copies of one form
« Reply #1 on: April 10, 2017, 06:37:01 pm »
by Application.CreateForm(TFormX, FormX[j]);
or by FormX[j] := TFormX.Create(MainForm);
The first performs additional actions that, in my opinion, you are not required. By the way, in the second case the owner is not Application, but the MainForm.

Eugene Loza

  • Sr. Member
  • ****
  • Posts: 364
    • Decoherence Studio :)
Re: Multiple copies of one form
« Reply #2 on: April 10, 2017, 09:40:07 pm »
Thanks a lot!
My games in Lazarus/CastleGameEngine:
Project Helena (TBS/RPG) http://sourceforge.net/projects/projecthelena/ (Alpha)
Fire Madness (bullet hell) https://github.com/eugeneloza/FireMadness/ (release candidate)
Decoherence: beyond Wizardry (RPG) https://github.com/eugeneloza/Mazer (just started)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus