Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi, MDI vs Tabs for multi-document interface

I'm developing a multi-document application. Currently it uses MDI which is quite convenient for me (as a developer) as well as for users I believe. However there is one "against" - I haven't found a solution to quickly load many child windows (each time the window is created and maximized to fill the parent's area, there is an 'animation' of resizing which takes a lot of time) so far, thus I'm considering switching back to tabbed interface (which requires some more work, I need to "embed" a form to the page sheet, as there are many "kinds" of forms available, some for editing text documents, some for other objects)...

So, what is your opinion? Should I use MDI or tabbed interface?

like image 813
migajek Avatar asked Sep 22 '09 23:09

migajek


People also ask

Is MDI obsolete?

Even though MDI is considered harmful, several applications (even MS Office, Adobe apps) still use it either in its pure form or some as a hybrid with a tabbed/IDE-like interface.

What is MDI & SDI?

MDI (multi-document interface) - allows users to simultaneously view multiple documents. SDI (single-document interface) - unlike MDI, SDI only supports a single “active” document. A classic example of an SDI interface are static tabs.

Why do you use MDI in Visual Basic?

Multiple-document interface (MDI) applications enable you to display multiple documents at the same time, with each document displayed in its own window.

What is difference between SDI and MDI?

SDI applications allow only one open document frame window at a time. MDI applications allow multiple document frame windows to be open in the same instance of an application.


3 Answers

To avoid the resizing animation (and thus the delay) of new MDI child windows, send a WM_SETREDRAW message to the parent TForm's ClientHandle property before creating your child windows, and then send it again when you are done, ie:

Self.Perform(WM_SETREDRAW, False, 0);
... create child windows as needed ...
Self.Perform(WM_SETREDRAW, True, 0);
Windows.InvalidateRect(Self.ClientHandle, nil, True);
Windows.UpdateWindow(Self.ClientHandle);
like image 50
Remy Lebeau Avatar answered Sep 22 '22 06:09

Remy Lebeau


MDI was developed back in the Windows 3 days (or possibly earlier?) and isn't well-supported these days. If you need multiple documents with different forms, I'd recommend using a tabbed interface. Use frames instead of forms, and create the new tabs and place a frame on it, aligned alClient.

like image 30
Mason Wheeler Avatar answered Sep 19 '22 06:09

Mason Wheeler


There are certainly more negative points to MDI than the one you cite. You can find discussions on this in the Wikipedia, and even in the Windows Interface Guidelines as well. MDI has been deprecated now for years. Microsoft itself isn't using MDI in its "standard" form for any of its big applications any more, they often provide just a MDI emulation together with other UI styles.

If your program is for users with multiple screens both MDI and a tab-based UI have the problem of limiting the document windows to the insides of the parent window.

With a proper application design you don't really have to decide between MDI and tab-based UI. Let your users decide which UI they are most comfortable with, and which fits their working style best. Allow for multiple independent top-level document windows (either in one application instance or in multiple) as well. It can be as easy as creating frame classes for your documents, and deciding at runtime whether to embed them into a tab control, into a MDI child window, or into a top-level window.

like image 42
mghie Avatar answered Sep 22 '22 06:09

mghie