[Lazarus] MDI implementation

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] MDI implementation

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'')

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Peter Williams
Hi Daniel,


Date: Sat, 2 Apr 2011 19:02:46 -0300
From: [hidden email]
To: [hidden email]
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:


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'')

-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

zeljko
In reply to this post by Daniel Franzini
Quoting Daniel Franzini <[hidden email]>:

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

MDI isn't yet supported on lazarus, but will be available soon.
You can see progres at my todo list.
http://wiki.lazarus.freepascal.org/User:Zeljan
There are also some mdi screenshoots.

zeljko


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Daniel Franzini
In reply to this post by Peter Williams
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 <[hidden email]>
Hi Daniel,


Date: Sat, 2 Apr 2011 19:02:46 -0300
From: [hidden email]
To: [hidden email]
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:


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'')

-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Peter Williams
Hi Daniel,


Date: Sun, 3 Apr 2011 10:28:07 -0300
From: [hidden email]
To: [hidden email]
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.


MultiDoc is the Lazarus version of MDI forms.


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 <[hidden email]>
Hi Daniel,


Date: Sat, 2 Apr 2011 19:02:46 -0300
From: [hidden email]
To: [hidden email]
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:


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'')

-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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 [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Daniel Franzini
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 <[hidden email]>
Hi Daniel,


Date: Sun, 3 Apr 2011 10:28:07 -0300Subject: 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.


MultiDoc is the Lazarus version of MDI forms.


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 <[hidden email]>
Hi Daniel,


Date: Sat, 2 Apr 2011 19:02:46 -0300
From: [hidden email]
To: [hidden email]
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:


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'')

-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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 [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Peter Williams
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: [hidden email]
To: [hidden email]
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 <[hidden email]>
Hi Daniel,


Date: Sun, 3 Apr 2011 10:28:07 -0300Subject: 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.


MultiDoc is the Lazarus version of MDI forms.

<a href="http://sourceforge.net/projects/lazarus-ccr/files/MultiDoc/MultiDoc 0.2/multidoc-0.2.zip/download" target="_blank">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 <[hidden email]>
Hi Daniel,


Date: Sat, 2 Apr 2011 19:02:46 -0300
From: [hidden email]
To: [hidden email]
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:


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'')

-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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 [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
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 [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

Patrick Chevalley
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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] MDI implementation

William Oliveira Ferreira
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 <[hidden email]>:

> 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
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus