Delphi, MDI vs Tabs for multi-document interface

2020-02-26 00:53发布

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?

4条回答
够拽才男人
2楼-- · 2020-02-26 01:32

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);
查看更多
Rolldiameter
3楼-- · 2020-02-26 01:32

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.

查看更多
太酷不给撩
4楼-- · 2020-02-26 01:45

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.

查看更多
手持菜刀,她持情操
5楼-- · 2020-02-26 01:58

Question: is it important that users be able to see more than one of your embedded forms or frames at a time? If not, certainly go for tabs.

Tabs make it easier to navigate and to see what you have available. But with standard PageControl you can only see one tab at a time - there's no "tiling" or "cascading". Problems begin for example when users need to drag things from one tab to another. It can be done, of course, but is not as convenient - because this time users do not see where they are dragging something to.

To overcome this limitation you'd have to look at a docking UI, which adds complexity, but could give you tabs as well as being able to tile them.

查看更多
登录 后发表回答