MainFrame仅包含可停靠窗格 [英] MainFrame consists only Dockable Panes

查看:88
本文介绍了MainFrame仅包含可停靠窗格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我遇到了问题,不得不寻求帮助.

我想创建一个仅具有可停靠窗格的应用程序(MSVC 2008,基于MFC的C ++项目).创建不带文档/视图架构的单个文档(以使其尽可能简单,但具有可停靠的窗格的支持),我几乎得到了我想要的(可停靠的窗格).问题是如何摆脱没有可停靠窗格的MainFrame客户区?
让我通过一个例子澄清我的问题.当我移动一个可停靠窗格时,它不适合客户区域,因此完全留出了我不想要的虚构CChildView的空间.我想要的是MainFrame始终只填充可停靠的窗格.可能吗?我曾考虑过重写大小调整事件并扩展其中一个窗格以适合客户区域,但是我认为这不是一个好主意.

在此先感谢

Hi there,

I''m stuck with a problem and have to ask for the help.

I want to create an application that has only dockable panes (MSVC 2008, MFC based C++ project). Creating Single document w/o Document/View architecture (to keep it as simple as possible, but with support of dockable panes) I get almost what I want (dockable panes). The question is how to get rid of client area of MainFrame where there are no dockable panes left?
Let me clarify my question on an example. When I move one of my dockable panes it does not fit the client area entirely leaving space for imaginary CChildView which I don’t want to have. All I want is MainFrame always filled in with only dockable panes. Is it possible? I thought about rewriting resize event and expand one of the panes to fit client area, but I don''t think it''s a good idea.

Thanks in advance

推荐答案

您需要调整其中一个的大小,要么是子级填充主窗口,要么是主窗口包围子级.
You need to resize one of them, either the child to fill the main window, or the main window to surround the child.


谢谢理查德的建议.让我解释一下为什么我不热衷于调整大小.我的应用程序是SDI,因此据我所知,我无法调整大小或移动客户区域.因此,我有一个唯一的选项来移动/调整仅可停靠窗格的大小,只要用户释放鼠标,该窗格就会填充客户区.我不喜欢Windows无法正确突出显示可停靠窗格所要粘贴的位置(仅是客户端区域的一部分),并且只有我的代码才能缩放窗格以适合客户端.希望我的解释不会引起混淆:)

实际上,我找到了另一种解决方案,虽然不是理想的方法,但却可以正常工作.这是创建MDI选项卡式应用程序.由于用户可以将不同的选项卡分组/重新分组(因此可以查看框架),这就是我想要的.这样的缺点是,不可能同时进行垂直和水平分组.但我可以忍受.

还是谢谢你.
Thank you Richard for your suggestion. Let me explain why I''m not keen to do resize. My application is SDI and therefore as far as I know I cannot resize or move client area. So, I have a sole option to move/size only dockable pane that will fill in the client area as soon as the user release the mouse. What I don''t like is Windows will not highlight correctly the place where dockable pane will stick to (only part of client area) and only my code will zoom the pane to fit the client. I hope my explanation is not confusing :)

Actually I found another solution, not ideal but seams like working. It is to create MDI tabbed app. Since the user can group/regroup different tabs into groups (and therefore view frames) that''s what I was looking for. The cons of this way, it''s impossible to have vertical and horizontal groupping at the same time. But I can live with it.

Thank you anyway.


这篇关于MainFrame仅包含可停靠窗格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆