MFC:“粘合”两个窗口/对话框在一起

发布于 2024-08-29 01:11:58 字数 348 浏览 9 评论 0原文

我正在尝试进行一些设置,以便我的主对话框具有一个或多个子对话框,并且这些子对话框被粘合/停靠在主对话框的外部 - 当主对话框最小化时,子对话框将同样,当主对话框移动时,孩子们也会随之移动。

我尝试将子对话框设置为以主对话框 CWnd 作为父对话框,并采用 CHILD 样式。但随后他们就会被父母的边界所限制。如果我将它们设置为 POPUP,它们可以在外面,但不会与父级一起移动。

我正在考虑在父对话框上放置一个 OnMove 处理程序,但是有内置的东西吗?而且,子对话框是否仍然是主对话框的子对话框......我认为它们应该?

这是VS2005(我认为VS2008有一些相关的功能所以我提到这一点)。

I'm trying to set something up so my main dialog has one or more child dialogs, and these are glued/docked to the outside of the main dialog - when the main dialog is minimised, the children are too, when main dialog moves, children move with it.

I'd tried setting child dialogs as having main dialog CWnd as parent, with CHILD style. But then they get clipped by the parent's boundary. If I set them as POPUP, they can be outside but then don't move with the parent.

I'm looking at putting an OnMove handler on the parent dialog, but is there something built-in? And, should child dialogs still be children of the main dialog... I assume they should?

This is VS2005 (I think VS2008 has some related functionality so I mention this).

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

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

发布评论

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

评论(3

爱,才寂寞 2024-09-05 01:11:58

当它们是弹出窗口时,您需要手动实现移动,是的,它们应该是弹出窗口,否则它们将被剪掉。

You need to implement the movement manually when they are popups, and yes they should be popups otherwise they will be clipped out.

孤檠 2024-09-05 01:11:58

我是新来的。不确定是否可以参考外部文章。
我想 就是您正在寻找的。

我开始写这个类是因为
我经常需要弹出额外的
围绕主要对话的对话。经常
这些对话框可能会给您带来一些麻烦
用户;例如,他必须
将它们一一移动/关闭... A
解决方案可以给
应用更扎实的方面和
这可以使管理
各种窗户可能更容易
并排停靠所有对话框(例如
例如,Winamp 就是这样做的)。

I'm new to SO. Not sure if I can refer to an external article.
I guess this is what you are looking for.

I started to write this class because
I'm often in need to popup additional
dialogs around the main one. Often
these dialogs can give some trouble to
the user; for example, he must
move/close them one by one... A
solution that could give the
application a more solid aspect and
that could make the management of the
various windows easier could be, to
dock all dialogs side by side (like
Winamp does, for example).

悲凉≈ 2024-09-05 01:11:58

正如 Roel 所说,额外的对话框需要是弹出窗口。我感兴趣的是:这是什么样的用户界面?是 WinAmp 风格吗?窗口彼此对齐?

或者你正在做某种扩展对话?如果它是一个扩展对话框(例如,上面有一个 More>> 按钮),那么您可以将所有控件放在同一个对话框上,并在显示/隐藏附加内容时使用窗口矩形。

As Roel says, your extra dialogs will need to be popups. I'm interested: what kind of UI is this? Is it WinAmp-style, where the windows snap to eachother?

Or are you doing some kind of expanding dialog? If it's an expanding dialog (with a More>> button on it, e.g.), then you can put all of the controls on the same dialog and play with the window rect when showing/hiding the extras.

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