Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Problem with autohide docking pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with autohide docking pane

 Post Reply Post Reply
Author
Message
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Topic: Problem with autohide docking pane
    Posted: 22 May 2008 at 4:47pm

In my app, I use the following code in CMainFrame::OnCreate to create two docking bars with dialogs in them:


PaneManager.InstallDockingPanes(this);

TreePane = PaneManager.CreatePane (IDS_TREE_TOOLBAR, CRect(0, 0,200, 120), xtpPaneDockLeft);
Tree.Create (this);
Tree.ModifyStyle(0, TBSTYLE_FLAT);

MiniMonPane = PaneManager.CreatePane(IDS_MINIMON_TOOLBAR, CRect(0, 0,160, 180), xtpPaneDockTop);
MiniMon.Create (this);
MiniMonPane->SetOptions (xtpPaneNoCaption);

CSize size;
size.SetSize (100, 180);
MiniMonPane->SetMinTrackSize (size);
size.SetSize (5000, 180);
MiniMonPane->SetMaxTrackSize (size);

TreePane->Attach (&Tree);
MiniMonPane->Attach (&MiniMon);


This causes the "Tree" pane to come up docked to the left below the "MiniMon" pane which is docked to the top and occupies the full width of the application.

This is what it want it to do and it works well except for one problem. If the user clicks the push-pin on the "Tree" pane to auto-hide it (which most do), then it can no longer be undocked or have auto-hide turned off. Double clicking on the border does nothing, nor does clicking on the push-pin to cancel the auto-hide.

I assume I am just doing something stupid, can anyone advise?
Thanks,
Don

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 1:37am
Hi,
I guess you have NotifyHandler and reurn 1 always. or maybe disable some actions.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 8:29am
Oleg,
 
Thanks for the reply. I don't think I am doing either of those things. But I did find some more information. Perhaps I need to look somewhere else in my code.
 
I found that if I comment out the line
 
TreePane->Attach (&Tree);
 
So that the docking pane is not attached to a child dialog, it all works fine.
 
I then tried replacing the Tree child with a simple, unmodified CDialog, and the problem came back. So I know the problem can't be in the Tree code anywhere since it is no longer in use. I think this means it must be a CMainFrame problem, but that seems strange since it works when the Pane has no child.
 
I am still trying to track this down, I would appreciate any ideas.
 
Thanks
 
Don
 
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 8:47am
For what it is worth, I thought I might attach a stack trace that shows where the code goes when I click on the PushPin to try to un-autohide the window.
 
When I click on the PushPin, the Docked Window immediately disappears and then slides back out again from the side.
 
Don
 
CXTPDockingPaneTabbedContainer::RemovePane(CXTPDockingPaneBase * pPane=0x081c47c8)  Line 395 C++
CXTPDockingPaneManager::_RemovePane(CXTPDockingPaneBase * pPane=0x081c47c8)  Line 469 + 0x19 bytes C++
CXTPDockingPaneManager::_AttachPane(CXTPDockingPaneBase * pPane=0x081c47c8, CXTPDockingPaneBase * pNeighbour=0x0bb8c4a4)  Line 496 C++
CXTPDockingPaneManager::AttachPane(CXTPDockingPaneBase * pPane=0x081c47c8, CXTPDockingPaneBase * pNeighbour=0x0bb8c4a4)  Line 475 C++
CXTPDockingPaneManager::_ToggleDocking(CXTPDockingPane * pPane=0x081c47a8, CXTPDockingPaneBase * pHolder=0x0bb8c4a4)  Line 760 C++
CXTPDockingPaneManager::ToggleDocking(CXTPDockingPaneBase * pPane=0x0bb8c4a4)  Line 709 + 0x5d bytes C++
CXTPDockingPaneTabbedContainer::OnCaptionButtonClick(CXTPDockingPaneCaptionButton * pButton=0x0bb8c820)  Line 725 C++
CXTPDockingPaneTabbedContainer::OnLButtonDown(unsigned int __formal=1, CPoint point={...})  Line 798 + 0x16 bytes C++
CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=852144, long * pResult=0x0012f8b4)  Line 2169 C++
CXTPDockingPaneTabbedContainer::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=852144, long * pResult=0x0012f8b4)  Line 1356 C++
CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=852144)  Line 1741 + 0x20 bytes C++
AfxCallWndProc(CWnd * pWnd=0x0bb8c450, HWND__ * hWnd=0x003d0f76, unsigned int nMsg=513, unsigned int wParam=1, long lParam=852144)  Line 240 + 0x1c bytes C++
AfxWndProc(HWND__ * hWnd=0x003d0f76, unsigned int nMsg=513, unsigned int wParam=1, long lParam=852144)  Line 389 C++
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 9:58am
Hi,
 
Actaully you have call Attach only in Handler. See how our sample work.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 10:35am
Hi,
 
I moved the creation of the Dialogs and the Attach calls to the OnDockingPaneNotify function as the samples do.
 
This resulted in no changes, the pushpin still doesn't work.
 
Don
 
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 12:09pm
Hi,
 
I found another piece of information.
 
Calling the PaneManger.ToggleAutoHide for this pane doesn't work either. It works the first time to hide it, but won't work subsequent times to unhide it.
 
Don
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 3:45pm
Hello,
 
I need some sample to see what you do :-(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 3:55pm
Oleg,
 
This problem is much more complex that I thought.
 
The docking panes work fine until I open a document in my application. Then the push pin problem that I described starts happening.
 
I guess that something in my Document / View is causing this, but I don't know what it is yet.
 
I am using the CXTPDockingPaneLayout code to save the position of the panes in the registry.
 
One repeatable symptom happens if I open the app and then open a document (which breaks the pushpin) and then exit the app which causes the docking state to be written to the registry.
 
After doing that, the pushpin will always be broken, even if I close the app and reopen it and don't open a document. So whatever is being written to the registry "persists" the broken pushpin.
 
Would it be useful for me to send a pair of .reg files, one good and one bad?
 
Other than that, I think maybe you shouldn't worry about this until I figure out better what my document might be doing.
 
Thanks,
 
Don
 
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 5:12pm

Hi,

Here is some information that I hope might be useful. I added some code to save the Docking Pane layout as a file using CXTPDockingPaneLayout::SaveToFile.

The following file was generated when the dock pane was working properly:


<?xml version="1.0" encoding="UTF-8"?>
<DockingPaneLayouts CompactMode="1">
 <Common>
  <Summary Panes="9" TopContainer="3" Client="7"/>
  <Pane-1 Type="0" DockingCX="200" DockingCY="120" Title="Tree View" ID="50161" DockingHolder="6" LastHolder="6"/>
  <Pane-2 Type="0" DockingCX="160" DockingCY="180" Title="Mini Monitors" ID="50160" Options="8" DockingHolder="4" LastHolder="4" MinTrackX="100" MinTrackY="180" MaxTrackX="5000" MaxTrackY="180"/>
  <Pane-3 Type="2" Panes="2" Pane-1="4" Pane-2="5"/>
  <Pane-4 Type="1" DockingCX="160" DockingCY="180" Panes="1" Selected="2" Pane-1="2"/>
  <Pane-5 Type="2" DockingCY="870" Horiz="1" Panes="2" Pane-1="6" Pane-2="7"/>
  <Pane-6 Type="1" DockingCX="200" DockingCY="120" Panes="0"/>
  <Pane-7 Type="4" DockingCX="1716"/>
  <Pane-8 Type="5" Direction="0" Panes="1" Pane-1="9"/>
  <Pane-9 Type="1" DockingCX="200" DockingCY="120" Panes="1" Selected="1" Pane-1="1"/>
 </Common>
</DockingPaneLayouts>

The file below was generated after opening and the closing a document.


<?xml version="1.0" encoding="UTF-8"?>
<DockingPaneLayouts CompactMode="1">
 <Common>
  <Summary Panes="8" TopContainer="3" Client="6"/>
  <Pane-1 Type="0" DockingCX="200" DockingCY="120" Title="Tree View" ID="50161" DockingHolder="8" LastHolder="8"/>
  <Pane-2 Type="0" DockingCX="160" DockingCY="180" Title="Mini Monitors" ID="50160" Options="8" DockingHolder="4" LastHolder="4" MinTrackX="100" MinTrackY="180" MaxTrackX="5000" MaxTrackY="180"/>
  <Pane-3 Type="2" Panes="2" Pane-1="4" Pane-2="5"/>
  <Pane-4 Type="1" DockingCX="160" DockingCY="180" Panes="1" Selected="2" Pane-1="2"/>
  <Pane-5 Type="2" DockingCY="870" Horiz="1" Panes="1" Pane-1="6"/>
  <Pane-6 Type="4" DockingCX="1716"/>
  <Pane-7 Type="5" Direction="0" Panes="1" Pane-1="8"/>
  <Pane-8 Type="1" DockingCX="200" DockingCY="120" Panes="1" Selected="1" Pane-1="1"/>
 </Common>
</DockingPaneLayouts>

As you can see, the lower one has one less pane than the upper one. Both of them result in the same visual appearance when loaded, but when I load the upper one, the pushpin still works. When I load the lower one it doesn't.

Thanks,

Don

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2008 at 1:33pm
Hi,
 
Sorry, I have to debug your project. I sure its some code inside.  Try to create smaller version of project and send to support@codejock.com.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.