Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

MDI implementation

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Daniel Franzini

Hi there.

I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31).

I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild.

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:

-----------------
procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject);
var frmChild: TfrmRelatVend;
begin
    frmChild := TfrmRelatVend.Create(self);
    frmChild.Show;
end;
-----------------
I also wrote a formClose handler for the child so it gets freed when I close
it.
-----------------
procedure TfrmRelatVend.FormClose(Sender: TObject;
    var CloseAction: TCloseAction);
begin
    CloseAction := caFree;
end;
-----------------

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.

What am I doing wrong?

thank you

Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110402/06a9a792/attachment.html>

Reply by email

Peter Williams
to Daniel Franzini

Hi Daniel,

Date: Sat, 2 Apr 2011 19:02:46 -0300
From:
To:
Subject: [Lazarus] MDI implementation

Hi there.

I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31).

I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild.

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:

-----------------
procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject);
var frmChild: TfrmRelatVend;
begin
    frmChild := TfrmRelatVend.Create(self);
    frmChild.Show;
end;
-----------------

I also wrote a formClose handler for the child so it gets freed when I close it.

-----------------
procedure TfrmRelatVend.FormClose(Sender: TObject;
    var CloseAction: TCloseAction);
begin
    CloseAction := caFree;
end;
-----------------
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.
What am I doing wrong? thank you

I cannot tell you exactly what you're doing wrong, but I can do the next best thing. I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working. You can find it here:
https://sites.google.com/site/pewtas/home/delphi_source_code and the download for the Delphi 7 source code is here: simple_ed_005_src.zip 19 KB - The Delphi source code files only

(Note that this has a main form and a child MDI form). Best Regards,Peter / pew

>Daniel "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) "Yes, technogeeks can be funny, even if only to each other." (http://www.boogieonline.com/revolution/science/humor/)" "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'') --

Reply by email

Daniel Franzini
to Peter Williams: Date: Sat, 2 Apr 2011 19:02:46 -0300 From: To: Subject: [Lazarus] MDI implementation Hi…

Thank you, Peter.

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.

But thanks anyway for the tip and the code.

2011/4/2 Peter Williams

Show quoted text 95 lines
Hi Daniel, ------------------------------ Date: Sat, 2 Apr 2011 19:02:46 -0300 From: To: Subject: [Lazarus] MDI implementation Hi there. I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31). I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild. 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: ----------------- procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject); var frmChild: TfrmRelatVend; begin frmChild := TfrmRelatVend.Create(self); frmChild.Show; end; ----------------- I also wrote a formClose handler for the child so it gets freed when I close it. ----------------- procedure TfrmRelatVend.FormClose(Sender: TObject; var CloseAction: TCloseAction); begin CloseAction := caFree; end; ----------------- >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. >What am I doing wrong? >thank you I cannot tell you exactly what you're doing wrong, but I can do the next best thing. I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working. You can find it here: https://sites.google.com/site/pewtas/home/delphi_source_code <https://sites.google.com/site/pewtas/home/delphi_source_code>and the download for the Delphi 7 source code is here: simple_ed_005_src.zip <https://sites.google.com/site/pewtas/simple_ed_005_src.zip?attredirects=0>19 KB - The Delphi source code files only (Note that this has a main form and a child MDI form). Best Regards, Peter / pew -- >Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110403/33c877fb/attachment.html>

Reply by email

Peter Williams
to Daniel Franzini

Hi Daniel,

Date: Sun, 3 Apr 2011 10:28:07 -0300
From:
To:
Subject: Re: [Lazarus] MDI implementation

Show quoted text 5 lines
Thank you, Peter. 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. But thanks anyway for the tip and the code.

I found that my Delphi code does not compile in Lazarus for MDI forms. http://wiki.lazarus.freepascal.org/MultiDoc
MultiDoc is the Lazarus version of MDI forms.
http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc%200.2/multidoc-0.2.zip/download 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. Does anyone know how we can get rid of this AV error ??? Note the component is dated 2007-01-06 and version 0.2. Best Regards,Peter / pew

2011/4/2 Peter Williams

Hi Daniel,

Date: Sat, 2 Apr 2011 19:02:46 -0300
From:
To:

Subject: [Lazarus] MDI implementation

Hi there.

I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31).

I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild.

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:

-----------------
procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject);
var frmChild: TfrmRelatVend;
begin
    frmChild := TfrmRelatVend.Create(self);
    frmChild.Show;
end;
-----------------

I also wrote a formClose handler for the child so it gets freed when I close it.

-----------------
procedure TfrmRelatVend.FormClose(Sender: TObject;
    var CloseAction: TCloseAction);
begin
    CloseAction := caFree;
end;
-----------------
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.
What am I doing wrong? thank you

I cannot tell you exactly what you're doing wrong, but I can do the next best thing. I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working.

You can find it here:
https://sites.google.com/site/pewtas/home/delphi_source_code

and the download for the Delphi 7 source code is here: simple_ed_005_src.zip 19 KB - The Delphi source code files only

(Note that this has a main form and a child MDI form). Best Regards,Peter / pew

>Daniel "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) "Yes, technogeeks can be funny, even if only to each other." (http://www.boogieonline.com/revolution/science/humor/)" "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'') --

Reply by email

Daniel Franzini
to Peter Williams

Hi Peter.

I found this version to be newer.

http://www.oocities.org/br/hipernetjr/lmdi/index_en.html

It seems to work well, but needs further testing.

2011/4/3 Peter Williams

Show quoted text 162 lines
Hi Daniel, ------------------------------ Date: Sun, 3 Apr 2011 10:28:07 -0300 From: To: Subject: Re: [Lazarus] MDI implementation >Thank you, Peter. >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. >But thanks anyway for the tip and the code. I found that my Delphi code does not compile in Lazarus for MDI forms. http://wiki.lazarus.freepascal.org/MultiDoc MultiDoc is the Lazarus version of MDI forms. http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc%200.2/multidoc-0.2.zip/download 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. Does anyone know how we can get rid of this AV error ??? Note the component is dated 2007-01-06 and version 0.2. Best Regards, Peter / pew 2011/4/2 Peter Williams Hi Daniel, ------------------------------ Date: Sat, 2 Apr 2011 19:02:46 -0300 From: To: Subject: [Lazarus] MDI implementation Hi there. I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31). I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild. 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: ----------------- procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject); var frmChild: TfrmRelatVend; begin frmChild := TfrmRelatVend.Create(self); frmChild.Show; end; ----------------- I also wrote a formClose handler for the child so it gets freed when I close it. ----------------- procedure TfrmRelatVend.FormClose(Sender: TObject; var CloseAction: TCloseAction); begin CloseAction := caFree; end; ----------------- >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. >What am I doing wrong? >thank you I cannot tell you exactly what you're doing wrong, but I can do the next best thing. I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working. You can find it here: https://sites.google.com/site/pewtas/home/delphi_source_code <https://sites.google.com/site/pewtas/home/delphi_source_code>and the download for the Delphi 7 source code is here: simple_ed_005_src.zip <https://sites.google.com/site/pewtas/simple_ed_005_src.zip?attredirects=0>19 KB - The Delphi source code files only (Note that this has a main form and a child MDI form). Best Regards, Peter / pew -- >Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Daniel "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) "Yes, technogeeks can be funny, even if only to each other." ( http://www.boogieonline.com/revolution/science/humor/)" "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'') -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110403/1fb32fda/attachment.html>

Reply by email

Peter Williams
to Daniel Franzini

Hi Daniel,
I am getting now an error with the new version. I try to install it and it comes back with cannot find package LMDI (or possibly graph). Best Regards,Peter / pew

Date: Sun, 3 Apr 2011 14:17:18 -0300
From:
To:
Subject: Re: [Lazarus] MDI implementation

Hi Peter.

I found this version to be newer.

http://www.oocities.org/br/hipernetjr/lmdi/index_en.html

It seems to work well, but needs further testing.

2011/4/3 Peter Williams

Hi Daniel,

Date: Sun, 3 Apr 2011 10:28:07 -0300
From:
To:

Subject: Re: [Lazarus] MDI implementation

Thank you, Peter. 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.
But thanks anyway for the tip and the code.

I found that my Delphi code does not compile in Lazarus for MDI forms. http://wiki.lazarus.freepascal.org/MultiDoc

MultiDoc is the Lazarus version of MDI forms.
http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc%200.2/multidoc-0.2.zip/download

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. Does anyone know how we can get rid of this AV error ???

Note the component is dated 2007-01-06 and version 0.2. Best Regards,Peter / pew

2011/4/2 Peter Williams

Hi Daniel,

Date: Sat, 2 Apr 2011 19:02:46 -0300
From:
To:

Subject: [Lazarus] MDI implementation

Hi there.

I'm trying to write a MDI application in Lazarus (Win32/Vista, Lazarus 0.9.31).

I created the main form and set its FormStyle property to fsMDIForm. Then I created the child form and set its FormsStyle to fsMDIChild.

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:

-----------------
procedure TfrmMain.mnuEntrarDadosClick(Sender: TObject);
var frmChild: TfrmRelatVend;
begin
    frmChild := TfrmRelatVend.Create(self);
    frmChild.Show;
end;
-----------------

I also wrote a formClose handler for the child so it gets freed when I close it.

-----------------
procedure TfrmRelatVend.FormClose(Sender: TObject;
    var CloseAction: TCloseAction);
begin
    CloseAction := caFree;
end;
-----------------
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.
What am I doing wrong? thank you

I cannot tell you exactly what you're doing wrong, but I can do the next best thing. I have a Simple_Ed (simple text editor) which supports unlimited MDI child text windows working.

You can find it here:
https://sites.google.com/site/pewtas/home/delphi_source_code

and the download for the Delphi 7 source code is here: simple_ed_005_src.zip 19 KB - The Delphi source code files only

(Note that this has a main form and a child MDI form). Best Regards,Peter / pew

>Daniel "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) "Yes, technogeeks can be funny, even if only to each other." (http://www.boogieonline.com/revolution/science/humor/)" "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'') --

Reply by email

William Oliveira Ferreira
to Patrick Chevalley

Maybe i'll say a pile of bullshit, but: Could contraints solve this problem as a workaround?
________________________________
William de Oliveira Ferreira
Bacharel em Sistemas de Informa??o

2011/4/4 Patrick Chevalley :

Show quoted text 17 lines
Hi, You can get the last version for Multidoc from the svn for my skychart application, see http://wiki.lazarus.freepascal.org/MultiDoc It work with Lazarus 0.9.30 and svn trunk. But the zeljko way look much better, so I eagerly await I can trash it :-) Patrick -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email