Delphi、MDI 与多文档界面的选​​项卡

发布于 2024-08-05 16:57:35 字数 290 浏览 8 评论 0原文

我正在开发一个多文档应用程序。目前它使用 MDI,这对我(作为开发人员)以及我相信的用户来说都非常方便。然而,有一个“反对” - 我还没有找到一种解决方案来快速加载许多子窗口(每次创建窗口并最大化以填充父窗口区域时,到目前为止,有一个调整大小的“动画”,需要花费很多时间),因此我正在考虑切换回选项卡式界面(这需要更多的工作,我需要将表单“嵌入”到页面表中,因为有有很多“种类”的表单可用,一些用于编辑文本文档,一些用于其他对象)...

那么,您的意见是什么?我应该使用 MDI 还是选项卡式界面?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

知你几分 2024-08-12 16:57:35

为了避免新 MDI 子窗口的调整大小动画(从而延迟),请在创建子窗口之前向父 TForm 的 ClientHandle 属性发送 WM_SETREDRAW 消息,然后在完成后再次发送该消息,即:

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);

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);
木森分化 2024-08-12 16:57:35

MDI 是在 Windows 3 天(或者可能更早?)中开发的,并且现在没有得到很好的支持。如果您需要不同形式的多个文档,我建议使用选项卡式界面。使用框架而不是表单,创建新选项卡并在其上放置一个框架,与 alClient 对齐。

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.

初吻给了烟 2024-08-12 16:57:35

MDI 的负面影响肯定比你提到的还要多。您可以在 Wikipedia 甚至 Windows 界面指南中找到有关此问题的讨论。 MDI 现已弃用多年。 Microsoft 本身不再将 MDI 以其“标准”形式用于其任何大型应用程序,他们通常仅提供 MDI 模拟以及其他 UI 样式。

如果您的程序适用于具有多个屏幕的用户,则 MDI 和基于选项卡的 UI 都存在将文档窗口限制在父窗口内部的问题。

通过正确的应用程序设计,您实际上不必在 MDI 和基于选项卡的 UI 之间做出选择。让您的用户决定他们最舒服的 UI,以及最适合他们的工作风格的 UI。还允许多个独立的顶级文档窗口(在一个应用程序实例中或在多个应用程序实例中)。它可以像为文档创建框架类一样简单,并在运行时决定是否将它们嵌入到选项卡控件、MDI 子窗口或顶级窗口中。

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.

小巷里的女流氓 2024-08-12 16:57:35

问题:用户一次能够看到多个嵌入的表单或框架重要吗?如果没有,当然要选择标签。

选项卡使导航和查看可用内容变得更加容易。但使用标准 PageControl 时,您一次只能看到一个选项卡 - 没有“平铺”或“级联”。例如,当用户需要将内容从一个选项卡拖到另一个选项卡时,就会出现问题。当然可以做到,但不太方便 - 因为这次用户看不到他们将某些东西拖到哪里。

为了克服这个限制,您必须查看对接 UI,这会增加复杂性,但可以为您提供选项卡并能够平铺它们。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文