* * *

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

Eugene Loza

  • Sr. Member
  • ****
  • Posts: 450
    • My "almost daily" development blog
[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 Free and Open Source games in Lazarus/FreePascal/CastleGameEngine:
https://decoherence.itch.io/
(and some ancient games in Turbo Pascal too)
Sources are here: https://github.com/eugeneloza?tab=repositories

ASerge

  • Sr. Member
  • ****
  • Posts: 403
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: 450
    • My "almost daily" development blog
Re: Multiple copies of one form
« Reply #2 on: April 10, 2017, 09:40:07 pm »
Thanks a lot!
My Free and Open Source games in Lazarus/FreePascal/CastleGameEngine:
https://decoherence.itch.io/
(and some ancient games in Turbo Pascal too)
Sources are here: https://github.com/eugeneloza?tab=repositories

 

Recent

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