Board index » delphi » Docking an MDI Form on a Panel in an SDI form

Docking an MDI Form on a Panel in an SDI form

Hi all,

 Did anyone try to dock and MDI Form onto a Panel that
belongs to an SDI Form?

We are trying to have a Main Form in which there are two panels
and a splitter. The aim is to have the MDI Client area stretch with
the left Panel and always show the right panel of the SDI Form.

We achieved the docking of the MDI Parent Form but when a new
MDI Child is created, an exception is raised stating that there are no
active MDI parents.

Any suggestions?

--
Salim Naufal
salim.nau...@softnet-eng.com

-------------------------------------------------

 

Re:Docking an MDI Form on a Panel in an SDI form


Sounds to me that what you are trying to do is have an MDI form that has a
resizable client area for the MDI child, with some kind of vertical
toolbar down the right.

If this is the case, what you need to do is use an MDI form, not an SDI
form, then place 1 panel align it right, and then place a splitter on the
form (aligned right).  The client area of the MDI form needs to be empty -
no panel.  Then when you create mdi child forms, the child form will use
the empty area... and the splitter will work.

Sincerely,

Gabriel Forner
gfor...@fesoft.com

Quote
Salim Naufal wrote:
> Hi all,

>  Did anyone try to dock and MDI Form onto a Panel that
> belongs to an SDI Form?

> We are trying to have a Main Form in which there are two panels
> and a splitter. The aim is to have the MDI Client area stretch with
> the left Panel and always show the right panel of the SDI Form.

> We achieved the docking of the MDI Parent Form but when a new
> MDI Child is created, an exception is raised stating that there are no
> active MDI parents.

> Any suggestions?

> --
> Salim Naufal
> salim.nau...@softnet-eng.com

> -------------------------------------------------

Re:Docking an MDI Form on a Panel in an SDI form


Quote
In article <38171A76.A592D...@fesoft.com>, Gabriel Forner wrote:
> If this is the case, what you need to do is use an MDI form, not an SDI
> form, then place 1 panel align it right, and then place a splitter on the
> form (aligned right).  The client area of the MDI form needs to be empty
> -no panel.  Then when you create mdi child forms, the child form will use
> the empty area... and the splitter will work.

Thank you for this. You've answered a question that I was on the point of
asking. There's just one thing that puzzles me (never having got involved
in splitters before, except as an end user). In design mode you make the
width of the panel 100 or whatever, right or left aligned (likewise the
splitter), and then at run time when you move the splitter the panel
resizes as intended. But to ask what is probably a very elementary
question, how does the panel know that it needs to resize itself? The panel
and the splitter each have the form as a parent, but there seems to be
nothing that gives one any knowledge of the other.

Tony Bryer  SDA UK

Re:Docking an MDI Form on a Panel in an SDI form


There is a private method inside the splitter FindControl where it goes through
the controls of the parent... (in other words its siblings <grin>).  This
procedure looks for the control that is aligned the same and sits right next to
the splitter.  Lastly the splitter resizes the control it found.

-Gabe

Quote
Tony Bryer wrote:
> In article <38171A76.A592D...@fesoft.com>, Gabriel Forner wrote:
> > If this is the case, what you need to do is use an MDI form, not an SDI
> > form, then place 1 panel align it right, and then place a splitter on the
> > form (aligned right).  The client area of the MDI form needs to be empty
> > -no panel.  Then when you create mdi child forms, the child form will use
> > the empty area... and the splitter will work.

> Thank you for this. You've answered a question that I was on the point of
> asking. There's just one thing that puzzles me (never having got involved
> in splitters before, except as an end user). In design mode you make the
> width of the panel 100 or whatever, right or left aligned (likewise the
> splitter), and then at run time when you move the splitter the panel
> resizes as intended. But to ask what is probably a very elementary
> question, how does the panel know that it needs to resize itself? The panel
> and the splitter each have the form as a parent, but there seems to be
> nothing that gives one any knowledge of the other.

> Tony Bryer  SDA UK

Re:Docking an MDI Form on a Panel in an SDI form


Quote
In article <381F74BB.B307B...@fesoft.com>, Gabriel Forner wrote:
> There is a private method inside the splitter FindControl where it goes
> through the controls of the parent... (in other words its siblings
> <grin>).  This procedure looks for the control that is aligned the same
> and sits right next to the splitter.  Lastly the splitter resizes the >

control it found.

Thanks for the explanation. It had never occurred to me that a child had
the right to go poking around its parent's possessions to see what might
be found <g>

Tony Bryer  SDA UK

Other Threads