Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Where am I docked?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Where am I docked?

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Where am I docked?
    Posted: 28 September 2007 at 10:19am

How do I find out where my docking pane is docked? I am looking for how to tell if a window I have in a docking pane is docked on the left or right side of our frame. So for instance with a bar docked the MFC way, I can find out if I am docked using AFX_IDW_DOCKBAR_LEFT or AFX_IDW_DOCKBAR_RIGHT.

I found IsFloating() but if I am not floating, how do I tell where I am docked?
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: 29 September 2007 at 2:00am
Hi,
 
You can call
m_pantManager.GetPaneDirection(pPane);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2007 at 11:50am
I am calling GetPaneDirection now and mostly it works. However while doing some docking I see that sometimes the value returned is 0xffffffff, which is not listed in the enumeration. I am listening to the WM_WINDOWPOSCHANGED method that is fired a number of times when I let release the mouse over one of the docking arrows and I saw the 0xffffffff value during one of the pos changed notifications. I plan to change my code and look for XTP_DPN_ACTION notifications to avoid all the pos changing "noise".
 
Also, we just moved to the latest release and while I was playing around with docking, I ended up with my bar docked on both the right side and left side of the application!
 
I have an OnSize method implemenation and I resized both locations and when OnSize is called I looked at "this" and I see that both are the same.
 
I also dumped out the list of docking panes and my bar is only listed one time.
 
Also, all the groups that I added fail to display in either pane that I now see. When this happened I was docked on the right and grabbed the caption and moved the window and chose the left arrow that showed up on the screen to dock on the left. When I start a command I update the docking pane title/caption and only the one on the left updates immediately. But if I resize the docking pane on the right, the title does update. So it appears that the same window is docked in two different places and the actual display of the code jock groups and items I have added (I have a XTPTaskPanel on my dialog) is failing completely.
 
Any idea how I ended up with two docking sites each of which contains the same docking pane?
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: 03 October 2007 at 2:21pm
Hi,
 
 
GetPaneDirection  can return -1 if Pane is floating.
 
Do you use DockingPane in some dialog or View instead of CFrameWnd ? if so what code you have in OnSize method ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2007 at 2:28pm
Oleg,
 
Since my previous reply I did some more work and this is what I found:
 
I found that if I floated the pane, my task groups displayed. Redocking caused their display to go away. Also after double-clicking to float and redock a couple of times the extra pane docked on the right side finally "disappeared".
 
Odd though (before the extra one went away) is that I could double click either the left or right pane and my pane would float but only the one on the left (where I docked it when the right side failed to disappear) would undisplay in the docking pane to float. That is, if I double-clicked on the superfluous pane on the right, the one on the left undocked and floated. It would always redock on the right irreguardless of whether I double-clicked the one on the right or left to effect the floating.
 
It is almost as if there were two docking pane managers each of which were connected to the same pane. I don't think that would explain why the task panel group items did not display unless floated. Eventually when the extra one disappeared, all my groups now display fine.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2007 at 2:50pm
I hate to keep replying but I now found that even though the display corrected itself, I grabbed the pane and docked it on the left. Once again I have two panes docked. So I floated it. This time though I decided to double-click the extra pane (this time it is on the left). What happens is that each time I double-click the extra pane on the left (that should not be there), my floating docking pane gets another copy of my pane added to it.
 
I now have a floating pane with 4 tabs. However only one of the tabs works. That is if I click on any of the other tabs nothing happens. From the display I can see that the same tab is "active".
 
I also just grabbed the extra one on the left again and floated it too. It floats but the display is bad. Not only that, but when it floated, the "real" floating pane's active tab (the only one that can be selected) reacted and now none of my groups show up. The entire background is the orange color of the tab and the thin surrounding edge that allows one to "see which tab is active". In case you want to see this I uploaded an image.
 
After uploading the image I continued to double click my floating pane and each time it added a tab. As I resized and double clicked, I eventually got an access violation during a click. The crash is in the code snippet below. The "m_pParentContainer" is NULL. I also dumped a call stack here in case you are interested.
 

void CXTPDockingPaneTabbedContainer::RemovePane(CXTPDockingPaneBase* pPane)

{

ASSERT(pPane->GetContainer() == this);

POSITION pos = m_lstPanes.Find((CXTPDockingPane*)pPane);

ASSERT(pos);

m_lstPanes.RemoveAt(pos);

OnTabsChanged();

pPane->SetParentContainer(NULL);

m_pParentContainer->OnChildContainerChanged(this);

> ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::RemovePane(CXTPDockingPaneBase * pPane=0x21e3bd48)  Line 357 + 0x32 bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::Copy(CXTPDockingPaneTabbedContainer * pClone=0x220f6ce8, CMap<CXTPDockingPaneBase *,CXTPDockingPaneBase *,CXTPDockingPaneBase *,CXTPDockingPaneBase *> * pMap=0x00000000, unsigned long dwIgnoredOptions=0x00000000)  Line 1006 + 0x3a bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::Clone(CXTPDockingPaneLayout * pLayout=0x0b187098, CMap<CXTPDockingPaneBase *,CXTPDockingPaneBase *,CXTPDockingPaneBase *,CXTPDockingPaneBase *> * pMap=0x00000000, unsigned long dwIgnoredOptions=0x00000000)  Line 1021 + 0x21 bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneManager::FloatPane(CXTPDockingPaneBase * pPane=0x220f6d3c, CRect rc={...})  Line 344 + 0x1d bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneContext::Track()  Line 1444 C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneContext::Drag(CXTPDockingPaneBase * pPane=0x220f6d3c, CPoint pt={...})  Line 443 + 0xf bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::OnCaptionLButtonDown(CPoint point={...})  Line 596 + 0x3c bytes C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::OnLButtonDown(unsigned int __formal=0x00000001, CPoint point={...})  Line 770 + 0x1a bytes C++
  mfc80d.dll!CWnd::OnWndMsg(unsigned int message=0x00000201, unsigned int wParam=0x00000001, long lParam=0x0008007f, long * pResult=0x00e3e5f8)  Line 2169 C++
  ToolkitPro1120vc80D.dll!CXTPDockingPaneTabbedContainer::OnWndMsg(unsigned int message=0x00000201, unsigned int wParam=0x00000001, long lParam=0x0008007f, long * pResult=0x00e3e5f8)  Line 1309 C++
  mfc80d.dll!CWnd::WindowProc(unsigned int message=0x00000201, unsigned int wParam=0x00000001, long lParam=0x0008007f)  Line 1741 + 0x20 bytes 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: 04 October 2007 at 3:16am
Hi,
 
Sorry I have no idea how to help you - I don't understand what you do/what you need/how to reproduce it/etc.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2007 at 8:30am
How do I keep any UI updates from bleeding thru when my pane is not the selected/active/top pane? How do I know when my pane is viewable by the user?

Right now I just need to be able to keep taskpanel items from displaying thru the pane that is "on top" in a docking pane. I have a docking pane with 5 tabs/panes docked in it. One has a task panel that gets groups added or removed when a new command starts. It is not always the top pane in the docking pane. The user can select/click another pane's tab and put that pane on top of the one with the taskpanel.

But when I modify the taskpanel, the groups display right on top of whatever pane happens to be the one the user selected to be on top.
 
Since this appears to be a bug in code jock I am trying to work around the problem by hiding all the windows on my pane when it is not the top pane in the docking pane. So I tried using the event notifications to control when I call ShowWindow to hide and show the taskpanel.
 
Trying to show and hide the child windows by monitoring xtp_dpn events is not a very robust way to prevent the bleed thru.
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.141 seconds.