tags:

views:

421

answers:

3

I currently have an SDI application that is build with Delphi 7, I want the final user to choose the type of interface between SDI and MDI at runtime. my question is how can I change the behavior of the application between SDI and MDI at runtime?

Currently I know a couple of applications build with delphi that allow this: EMS SQL Manager and TOAD.

alt text

thanks in advance.

+1  A: 

I would convert my current windows into frames and put these frames with align=alClient into either mdi child windows or normal windows as configured.

But beware: I have never actually done this, so there might be problems that I don't know about.

dummzeuch
+1 This is the easiest solution.
skamradt
You don't need to convert anything. You can put the FOrms onto your windows without changing them into frames, using TForm.ManualDock.
Warren P
+1  A: 

At runtime set TForm.FormStyle either to fsNormal or fsMDIChild depending on if you want SDI or MDI.

Lars Truijens
"real MDI" is bad news.seehttp://stackoverflow.com/questions/1463221/delphi-mdi-vs-tabs-for-multi-document-interface
Warren P
@WarrenP: I'm sorry if you do not like MDI, but it is an valid answer to this question
Lars Truijens
A: 

Do not actually use the FormStyle=fsMDIChild unless you want lots of problems.

Do not convert windows into frames. This is a bad solution.

For an MDI-like environment, that does not have the MDI problems, use a docking solution (components either commercial or open source that support docking). I use JvDocking which is included in the JEDI JVCL, which is free and open source.

You use your forms in both "docked" and "undocked" (floating) modes, and this gives you a docked IDE look and feel (VIsual Studio and RAD Studio), and an undocked IDE Look and feel (RAD Studio in undocked, or classic delphi 7).

Warren P