<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Just Share my app. I used Link List to do this <br><br><span style="font-style: italic;">procedure close_list_form(formclass:TFormClass);</span><br style="font-style: italic;"><span style="font-style: italic;">var</span><br style="font-style: italic;"><span style="font-style: italic;"> _i:integer;</span><br style="font-style: italic;"><span style="font-style: italic;"> _temp:Plistform;</span><br style="font-style: italic;"><span style="font-style: italic;">begin</span><br style="font-style: italic;"><span style="font-style: italic;"> for _i:=0 to mainform.TB.ButtonCount-1 do mainform.TB.Buttons[0].Destroy;</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr:=_head;</span><br style="font-style: italic;"><span style="font-style: italic;"> while (_curr<>nil) do</span><br style="font-style:
italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr^.form^.ClassName=formclass.ClassName then</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr^.back<>nil then</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.back^.next:=_curr^.next;</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr^.next<>nil then</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.next^.back:=_curr^.back;</span><br style="font-style: italic;"><span style="font-style: italic;"> if
_curr=_head then _head:=_curr^.next;</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr=_tail then _tail:=_curr^.back;</span><br style="font-style: italic;"><span style="font-style: italic;"> dispose(_curr);</span><br style="font-style: italic;"><span style="font-style: italic;"> end</span><br style="font-style: italic;"><span style="font-style: italic;"> else</span><br style="font-style: italic;"><span style="font-style: italic;"> mainform.add_menu_btn(_curr^.form^.Caption);</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr:=_curr^.next;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;">end;</span><br style="font-style: italic;"><br
style="font-style: italic;"><span style="font-style: italic;">procedure find_list_form(formclass:TFormClass);</span><br style="font-style: italic;"><span style="font-style: italic;">var</span><br style="font-style: italic;"><span style="font-style: italic;"> _find:boolean;</span><br style="font-style: italic;"><span style="font-style: italic;">begin</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr:=_head;</span><br style="font-style: italic;"><span style="font-style: italic;"> _find:=false;</span><br style="font-style: italic;"><span style="font-style: italic;"> while (_curr<>nil)and(not _find) do</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr^.form^.ClassName=formclass.ClassName then _find:=true</span><br style="font-style: italic;"><span
style="font-style: italic;"> else _curr:=_curr^.next;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;">end;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">function new_list_form(formclass:TFormClass;_par:integer = 0):boolean;</span><br style="font-style: italic;"><span style="font-style: italic;">var</span><br style="font-style: italic;"><span style="font-style: italic;"> _flag:boolean;</span><br style="font-style: italic;"><span style="font-style: italic;"> _i:integer;</span><br style="font-style: italic;"><span style="font-style: italic;">begin</span><br style="font-style: italic;"><span style="font-style: italic;"> _flag:=true;</span><br style="font-style: italic;"><span style="font-style: italic;"> find_list_form(formclass);</span><br
style="font-style: italic;"><span style="font-style: italic;"> if _curr=nil then</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> try</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr:=new(Plistform);</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.back:=nil;</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.next:=nil;</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.form:=new(Pform);</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.form^:=formclass.Create(mainform);</span><br style="font-style: italic;"><span
style="font-style: italic;"> mainform.add_menu_btn(_curr^.form^.Caption);</span><br style="font-style: italic;"><span style="font-style: italic;"> if _head=nil then</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> _head:=_curr;</span><br style="font-style: italic;"><span style="font-style: italic;"> _tail:=_curr;</span><br style="font-style: italic;"><span style="font-style: italic;"> end</span><br style="font-style: italic;"><span style="font-style: italic;"> else</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span
style="font-style: italic;"> _tail^.next:=_curr;</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.back:=_tail;</span><br style="font-style: italic;"><span style="font-style: italic;"> _tail:=_curr;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;"> except</span><br style="font-style: italic;"><span style="font-style: italic;"> on Exception do _flag:=false;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;"> if _curr<>nil
then</span><br style="font-style: italic;"><span style="font-style: italic;"> begin</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.form^.Tag:=_par;</span><br style="font-style: italic;"><span style="font-style: italic;"> _curr^.form^.Show;</span><br style="font-style: italic;"><span style="font-style: italic;"> end;</span><br style="font-style: italic;"><span style="font-style: italic;"> Result:=_flag;</span><br style="font-style: italic;"><span style="font-style: italic;">end; </span><br><br>Do you find any problem ? Thanks<br><br><br>=============INTOSOFT============<br>
ALEXIO CHAOS<br>
Darmawan_Sugiarto@yahoo.com <br>
Yahoo Messager<br>
=================================<br><br>--- On <b>Tue, 2/3/09, Malcolm Poole <i><malcolm@lingua-z.co.uk></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Malcolm Poole <malcolm@lingua-z.co.uk><br>Subject: Re: [Lazarus] creating multiple non-modal form instances<br>To: "General mailing list" <lazarus@lazarus.freepascal.org><br>Date: Tuesday, February 3, 2009, 11:52 AM<br><br><div class="plainMail">Graeme Geldenhuys wrote:<br>> How do I track such instances? By tracking I mean something like a MDI<br>> interface's 'Windows' menu item?<br>> My application is a SDI style app. If the user has many forms open, I<br>> want them to somehow be able to bring a certain form to the front. Or<br>> should I not bother and they simply use the taskbar for that. Then<br>> again, what if the app is run under Linux and the window manager<br>> doesn't
have a taskbar?<br>><br>> <br>My first commissioned app worked like that - you could open any number <br>of reports which used the same forms and could be accessed by a <br>dynamically created menu on the main form. If I remember correctly I had <br>a TList to which each form was added as it was created and when the <br>report forms closed they called a procedure of the main form which <br>removed them from the TList.<br><br>Regards,<br>Malcolm<br>_______________________________________________<br>Lazarus mailing list<br><a ymailto="mailto:Lazarus@lazarus.freepascal.org" href="/mc/compose?to=Lazarus@lazarus.freepascal.org">Lazarus@lazarus.freepascal.org</a><br><a href="http://www.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://www.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br></div></blockquote></td></tr></table><br>