<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi Daniel,<br><br><hr id="stopSpelling">Date: Sun, 3 Apr 2011 10:28:07 -0300<br>From: daniel.franzini@gmail.com<br>To: lazarus@lists.lazarus.freepascal.org<br>Subject: Re: [Lazarus] MDI implementation<br><br>>Thank you, Peter.<br><br>>I already tried in Delphi and it works fine. I wanted to do this in Lazarus because I intended it to work in Linux too.<br><br>>But thanks anyway for the tip and the code.<br><br><div>I found that my Delphi code does not compile in Lazarus for MDI forms.</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://wiki.lazarus.freepascal.org/MultiDoc">http://wiki.lazarus.freepascal.org/MultiDoc</a></div><div><br></div><div>MultiDoc is the Lazarus version of MDI forms.</div><div><br></div><div><a href="http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc%200.2/multidoc-0.2.zip/download">http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc%200.2/multidoc-0.2.zip/download</a></div><div><br></div><div>I installed it and ran the demo and found that when I have some child forms, when I close one of the forms I get an EAccess violation error (216) exception.</div><div><br></div><div>Does anyone know how we can get rid of this AV error ???</div><div><br></div><div>Note the component is dated 2007-01-06 and version 0.2.</div><div><br></div><div>Best Regards,</div><div>Peter / pew</div><div><br><div class="ecxgmail_quote">
2011/4/2 Peter Williams <span dir="ltr"><<a href="mailto:pewilliams2010@live.com">pewilliams2010@live.com</a>></span><br><blockquote class="ecxgmail_quote" style="padding-left:1ex">
<div>
Hi Daniel,<br><br><hr>Date: Sat, 2 Apr 2011 19:02:46 -0300<br>From: <a href="mailto:daniel.franzini@gmail.com">daniel.franzini@gmail.com</a><br>To: <a href="mailto:lazarus@lists.lazarus.freepascal.org">lazarus@lists.lazarus.freepascal.org</a><br>
Subject: [Lazarus] MDI implementation<div class="ecxim"><br><br>Hi there.<br><br>I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31).<br><br>I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild.<br>
<br>I also created a menu where I can start a new form. I moved the child form the non-automatic-created form list. And used the following code to create it:<br><br>-----------------<br>procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject);<br>
var frmChild: TfrmRelatVend;<br>begin<br> frmChild := TfrmRelatVend.Create(self);<br> frmChild.Show;<br>end; <br>-----------------<br><br>I also wrote a formClose handler for the child so it gets freed when I close it.<br>
-----------------<br>procedure TfrmRelatVend.FormClose(Sender: TObject;<br> var CloseAction: TCloseAction);<br>begin<br> CloseAction := caFree;<br>end; <br>-----------------<br><br>>Altough the form gets created and shows up, it does not have a MDI behavior, eg, it does not "stay" in the limits of its parent form and it gets maximized on top of its parent form.<br>
<br>>What am I doing wrong?<br><br>>thank you<br><br clear="all"></div>I cannot tell you exactly what you're doing wrong, but I can do the next best thing.<div><br></div><div>I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working.</div>
<div><br></div><div>You can find it here:</div><div><br></div><div><a href="https://sites.google.com/site/pewtas/home/delphi_source_code" target="_blank">https://sites.google.com/site/pewtas/home/delphi_source_code</a></div>
<div><br></div><div><a href="https://sites.google.com/site/pewtas/home/delphi_source_code" target="_blank"></a>and the download for the Delphi 7 source code is here:</div><div><br></div><div><span style="color:rgb(38, 0, 91);font-family:'trebuchet ms';line-height:18px"><a href="https://sites.google.com/site/pewtas/simple_ed_005_src.zip?attredirects=0" style="color:rgb(230, 0, 102) ! important;text-decoration:underline" target="_blank">simple_ed_005_src.zip </a>19 KB - The Delphi source code files only</span><br>
<div><br></div><div>(Note that this has a main form and a child MDI form).</div><div><br></div><div>Best Regards,</div><div>Peter / pew</div><div><div class="ecxim"><br>-- <br>>Daniel<br><br>"Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." (Donald Knuth)<br>
<br>"Yes, technogeeks can be funny, even if only to each other." (<a href="http://www.boogieonline.com/revolution/science/humor/" target="_blank">http://www.boogieonline.com/revolution/science/humor/</a>)"<br>
<br>"Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software." (Yukihiro Matsumoto, a.k.a. ``Matz'')<br>
<br></div>--
_______________________________________________
Lazarus mailing list
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a></div></div> </div>
<br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Daniel<br><br>"Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." (Donald Knuth)<br>
<br>"Yes, technogeeks can be funny, even if only to each other." (<a href="http://www.boogieonline.com/revolution/science/humor/" target="_blank">http://www.boogieonline.com/revolution/science/humor/</a>)"<br><br>"Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software." (Yukihiro Matsumoto, a.k.a. ``Matz'')<br>
<br>--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</div> </body>
</html>