如何在单独的面板中打开带有视图的文档/视图? [英] how to open a doc/view with the view in a separate panel?
问题描述
我有一个MFC MDI应用程序.通常打开一个新文档会创建一个新视图,该视图作为选项卡添加到框架窗口中.这对于普通文档来说很好.
但是我要添加一些特殊的库文档,这些文档要在视图中打开并与法线文档并排放置(右侧的库文档)
打开文档后,我可以用鼠标将其拖动,然后从视图选项卡栏中取消停放"它,它将放到我想要的位置,在单独的滚动视图区域中选项卡式视图的右侧.
我只需要知道如何以编程方式进行操作即可,因此默认情况下它作为一个单独的面板出现
在此先感谢您的帮助
i have a MFC MDI app. normally opening a new doc creates a new view which is added as a tab the the frame window. this is fine for normal docs.
but i am adding some special library docs which i want to open in a view and have it sit side by side with the normals docs (library doc on the right)
once the doc is opened, i can drag it with the mouse and "undock" it from the view tab bar and it will drop where i want it, to the right of the tabbed views in a separate scrollview area
i just need to know how to do that programatically so it comes up by default as a separate panels
thanks in advance for your help
推荐答案
常规嵌套模式:):
YourDockPane<-YourFrameWnd<-(YourToolBar,Your(Scroll)View,YourStatusBar)
YourDockPane::OnCreate(..)
-创建子框架
YourDockPane::OnSize(..)
-调整整个工作区的边框
YourFrameWnd::OnCreate(..)
-创建工具栏,视图和状态栏
YourFrameWnd::OnSize(..)
-调整创建的子代
该视图可能具有YourDoc类的实例成员,
可以序列化(通过收费栏->框架->视图链)并绘制(通过视图).
整个窗格也可以停靠到全局应用程序的客户区域.
(可选)
您还可以在最后两个嵌套组之间放置一个YourTabCtrl层,
为YourDocPane制作自己的MDI幻觉:)
The general nesting schema :) :
YourDockPane <- YourFrameWnd <- (YourToolBar, Your(Scroll)View, YourStatusBar)
YourDockPane::OnCreate(..)
- creates the child frame
YourDockPane::OnSize(..)
- adjusts the frame at the full client area
YourFrameWnd::OnCreate(..)
- creates the toolbar, view and statusbar
YourFrameWnd::OnSize(..)
- adjusts the created children
The view could have an instance member of YourDoc class,
that can be serialized (by tollbar->frame->view chain) and drawn (by view).
The whole pane can be docked to the global app''s client area as well.
Optionally,
you can also place a YourTabCtrl layer between the last two nesting groups,
to make an own MDI-illusion for YourDocPane :)
这篇关于如何在单独的面板中打开带有视图的文档/视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!