Board index » cppbuilder » Simulate MDI with non-MDI windows?

Simulate MDI with non-MDI windows?

Hi,

I am so sick and tired of Borland's {*word*99}; there's the menu merge bug, not
being able to disable automerge with MDI forms, the runtime package vs.
static library bug, and this bug, and that other bug, and... well, I give
up.

Does anyone know how to simulate MDI with non-MDI windows?

- Dennis

 

Re:Simulate MDI with non-MDI windows?


Try simply setting each child forms' Parent property manually to the desired
main form.  You can have forms Parented inside of other forms

Gambit

Quote
"Dennis Jones" <djo...@nospam.com> wrote in message

news:3d1bb689$1_2@dnews...
Quote
> Does anyone know how to simulate MDI with non-MDI windows?

Re:Simulate MDI with non-MDI windows?


Remy,

Yeah, unfortunately, that isn't enough.  As I started thinking about this, I
realized that there is also the handling of maximize, title-bar
double-click, system menu Maximize item, changing the border icons (maximize
into restore); then while the window is maximized, you have to prevent
window resize and moving, and automatically resize the window as the client
area changes.  All of which are done for you with MDI, and it's just too
danged much work.  So simulating MDI isn't going to be a viable option for
me.

I need to figure out why using the static library causes my submenu to not
work.  I tried a small test app, and it worked, even with the static
library...so that's the tack I am going to take.

- Dennis

"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3d1c082d$1_2@dnews...

Quote
> Try simply setting each child forms' Parent property manually to the
desired
> main form.  You can have forms Parented inside of other forms

> Gambit

> "Dennis Jones" <djo...@nospam.com> wrote in message
> news:3d1bb689$1_2@dnews...

> > Does anyone know how to simulate MDI with non-MDI windows?

Re:Simulate MDI with non-MDI windows?


Quote
"Dennis Jones" <djo...@nospam.com> wrote in message

news:3d1c865b$1_2@dnews...

Quote
> Yeah, unfortunately, that isn't enough.  As I started thinking about
> this, I realized that there is also the handling of maximize, title-bar
> double-click, system menu Maximize item, changing the border icons
> (maximize into restore);

Why would you have to handle all of that yourself?  If you simply leave the
child form's BorderStyle set to bsSizeable, then all of that is handled by
the OS automatically.  The form knows that is has a parent, and will stay
within the bounds of that parent.  the only thing you would have to do
manually, if anything, would be to intercept the WM_WINDOWPOSChanging or
WM_GETMINMAXINFO message in the child form so as to keep the child inside of
a specific area of the parent form, if desired.

Quote
> So simulating MDI isn't going to be a viable option for me.

See my comment above.  With minimal effort, I was able to get the above
approach to work just fine.

Gambit

Re:Simulate MDI with non-MDI windows?


Did you get the restore border icon to appear?  And how about if the main
form has a menu and a title bar?

Anyway, I solved the underlying problem...so I don't have to simulate MDI
after all.

- Dennis

"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3d1caa85$1_1@dnews...

Quote

> "Dennis Jones" <djo...@nospam.com> wrote in message
> news:3d1c865b$1_2@dnews...

> > Yeah, unfortunately, that isn't enough.  As I started thinking about
> > this, I realized that there is also the handling of maximize, title-bar
> > double-click, system menu Maximize item, changing the border icons
> > (maximize into restore);

> Why would you have to handle all of that yourself?  If you simply leave
the
> child form's BorderStyle set to bsSizeable, then all of that is handled by
> the OS automatically.  The form knows that is has a parent, and will stay
> within the bounds of that parent.  the only thing you would have to do
> manually, if anything, would be to intercept the WM_WINDOWPOSChanging or
> WM_GETMINMAXINFO message in the child form so as to keep the child inside
of
> a specific area of the parent form, if desired.

> > So simulating MDI isn't going to be a viable option for me.

> See my comment above.  With minimal effort, I was able to get the above
> approach to work just fine.

> Gambit

Re:Simulate MDI with non-MDI windows?


Quote
"Dennis Jones" <djo...@nospam.com> wrote in message

news:3d1cdc6a$1_1@dnews...

Quote
> Did you get the restore border icon to appear?

Yes.  I didn't have to change anything, the OS handled everything itself
just fine.

Quote
> And how about if the main form has a menu and a title bar?

Makes no difference at all.

Quote
> Anyway, I solved the underlying problem...so I don't have to simulate MDI
> after all.

Which was...?

Gambit

Re:Simulate MDI with non-MDI windows?


"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3d1cea64_1@dnews...

Quote
> > Anyway, I solved the underlying problem...so I don't have to simulate
MDI
> > after all.

> Which was...?

Which was...when I turned off "Build with runtime packages" my "recently
opened records" submenu wouldn't display.  I found that if a menu item has
an action assigned with an OnUpdate() event handler but no OnExecute() event
handler, the menu item may not work correctly, or may be disabled (depending
on if it is the first or second time you try to open the menu -- the first
time, the submenu simply doesn't display...after that, the parent menu item
is disabled).

This became an issue when I was forced to use static linking in order to
take advantage of the "MDI menu merge" bug fix in menus.pas that was
provided by Mark Cashman.  I would have preferred the ability to override
the menus.obj module in VCL50.BPL so I could still use packages, but
apparently, that is not possible.  If only Borland would give us the ability
to rebuild the VCL package ourselves...oh well...sigh.

- Dennis

Re:Simulate MDI with non-MDI windows?


Remy,

Yeah, unfortunately, that isn't enough.  As I started thinking about this, I
realized that there is also the handling of maximize, title-bar
double-click, system menu Maximize item, changing the border icons (maximize
into restore); then while the window is maximized, you have to prevent
window resize and moving, and automatically resize the window as the client
area changes.  All of which are done for you with MDI, and it's just too
danged much work.  So simulating MDI isn't going to be a viable option for
me.

I need to figure out why using the static library causes my submenu to not
work.  I tried a small test app, and it worked, even with the static
library...so that's the tack I am going to take.

- Dennis

"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3d1c082d$1_2@dnews...

Quote
> Try simply setting each child forms' Parent property manually to the
desired
> main form.  You can have forms Parented inside of other forms

> Gambit

> "Dennis Jones" <djo...@nospam.com> wrote in message
> news:3d1bb689$1_2@dnews...

> > Does anyone know how to simulate MDI with non-MDI windows?

Other Threads