CDockablePane Autohide issue
- Hi guys,
I am developing a MDI application (VS-2008) using dockable panes. mostly things are working fine but there is a problem when the pane is set to Autohide.
As it hides, if there are more than one panes set to autohide, only the caption of one which is active, apears and the icon of all other apear. I think i did somthing wrong when creating the pane or i'll need to set its some property but have no idea.
Please help
Thanks in advance
Harsh Shankar
Answers
- Hi Harsh,
We cannot figure out what would be the reason without any code about how did you handle the multiple CDockablePane, normaly the flow to create 2 dock pane is:
if (!m_dockpane1.Create(_T("Dockpane1"), this, CRect(0, 0, 100, 100), TRUE, ID_DOCKPANE1, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI)) { TRACE0("Failed to create Dockpane1\n"); return FALSE; // fail to create } m_dockpane1.EnableDocking(CBRS_ALIGN_ANY); m_dockpane1.SetMinSize(CSize(100, 100)); HICON hDockpane1Icon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0); m_dockpane1.SetIcon(hDockpane1Icon, FALSE); DockPane(&m_dockpane1); if (!m_dockpane2.Create(_T("Dockpane2"), this, CRect(0, 0, 100, 100), TRUE, ID_DOCKPANE2, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI)) { TRACE0("Failed to create Dockpane2\n"); return FALSE; // fail to create } m_dockpane2.EnableDocking(CBRS_ALIGN_ANY); m_dockpane2.SetMinSize(CSize(100, 100)); HICON hDockpane2Icon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0); m_dockpane2.SetIcon(hDockpane2Icon, FALSE); DockPane(&m_dockpane2);
And you would like to take a look the the sample "VisualStudioDemo" which locates under the "Visual Studio Samples\1033\C++\MFC\Visual C++ 2008 Feature Pack\VisualStudioDemo" if you have Visual Studio 2008 Sample installed.
Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byHarsh Shankar Thursday, July 02, 2009 4:27 PM
- Unmarked As Answer byHarsh Shankar Friday, July 03, 2009 7:05 AM
- Marked As Answer byWesley YaoMSFT, ModeratorMonday, July 06, 2009 2:56 AM
All Replies
- Hi Harsh,
We cannot figure out what would be the reason without any code about how did you handle the multiple CDockablePane, normaly the flow to create 2 dock pane is:
if (!m_dockpane1.Create(_T("Dockpane1"), this, CRect(0, 0, 100, 100), TRUE, ID_DOCKPANE1, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI)) { TRACE0("Failed to create Dockpane1\n"); return FALSE; // fail to create } m_dockpane1.EnableDocking(CBRS_ALIGN_ANY); m_dockpane1.SetMinSize(CSize(100, 100)); HICON hDockpane1Icon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0); m_dockpane1.SetIcon(hDockpane1Icon, FALSE); DockPane(&m_dockpane1); if (!m_dockpane2.Create(_T("Dockpane2"), this, CRect(0, 0, 100, 100), TRUE, ID_DOCKPANE2, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI)) { TRACE0("Failed to create Dockpane2\n"); return FALSE; // fail to create } m_dockpane2.EnableDocking(CBRS_ALIGN_ANY); m_dockpane2.SetMinSize(CSize(100, 100)); HICON hDockpane2Icon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0); m_dockpane2.SetIcon(hDockpane2Icon, FALSE); DockPane(&m_dockpane2);
And you would like to take a look the the sample "VisualStudioDemo" which locates under the "Visual Studio Samples\1033\C++\MFC\Visual C++ 2008 Feature Pack\VisualStudioDemo" if you have Visual Studio 2008 Sample installed.
Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byHarsh Shankar Thursday, July 02, 2009 4:27 PM
- Unmarked As Answer byHarsh Shankar Friday, July 03, 2009 7:05 AM
- Marked As Answer byWesley YaoMSFT, ModeratorMonday, July 06, 2009 2:56 AM
- Hi Wesley,
Thanks alot..
It worked
what i missed was the flag "CBRS_FLOAT_MULTI".
Even you have also solved one more problem of Limiting minimum size of CDockablePane
Thanks again
--------------------------------------------------------------------------------
Regards
Harsh
VC++ Developer- Edited byHarsh Shankar Thursday, July 02, 2009 4:52 PM
- Hi Wesley,
Well i found that some problems are still there.
the Scenerio is as i tab one pane to one other and its set to auto hide, the side bar shows only the caption of the active one only and the icon of the other one and my requirement is to have both the captions and icons as well.
what code you have given, i used it "as it is".
Thanks in advanced..
Regards
Harsh
Regards Harsh VC++ Developer Hi Harsh,
I'm not very clear about your requirement, would you please give me a picture or something else that can make your requirement more clear?
My code gave the same view as Visual Studio, you want what difference from it?
And I think this is another question from your original post, opening another thread for it would be better, it's a rule that one thread for one issue, that's for the answer can be found and used by other community members having similar questions.
Thanks,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.


