Click here to Skip to main content
15,886,702 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

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
Posted

1 solution

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 :)
 
Share this answer
 
Comments
steveh2112 19-Jul-11 4:22am    
the thing is, i'm creating the doc/view with this theApp.OpenDocumentFile(path);
sorry bit i don't understand your reply at all. i was just hoping to find a simple call to force a specific doc/view to undock from the tab bar
Eugen Podsypalnikov 19-Jul-11 4:29am    
// call to force a specific doc/view to undock from the tab bar
I could find the versa-way only: a dock-pane can fly to the client area and back :)
(see the caption context menu at the "file view dock-pane" in the general wizard's example)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900