Print Page | Close Window

Change order of docking pane tabs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=5971
Printed Date: 06 May 2024 at 11:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change order of docking pane tabs
Posted By: akur
Subject: Change order of docking pane tabs
Date Posted: 03 January 2007 at 6:03am
Hello,

I have several panes attached into the same floating holder and I need to move my 2nd tab to the left (so that it would be the 1st tab).
How do you do this from code?



Also, how do I get the position of my tab (2nd out of 3 tabs in the floating holder)?

Thanks a lot, in advance!




Replies:
Posted By: Oleg
Date Posted: 03 January 2007 at 6:41am
Hi,
 
Check soruces of CXTPDockingPaneTabbedContainer::OnMouseMove
 
you need get parent tabbbedcontainer:
 
pPaneFileView->GetParentContainer().
 
get list of panes in tabbedcontainer:
 
pContainer->GetPanes();
 
and switch panes:
 
void CXTPDockingPaneTabbedContainer::_Swap(CXTPDockingPane* p1, CXTPDockingPane* p2)
{
 POSITION pos1 = m_lstPanes.Find(p1);
 POSITION pos2 = m_lstPanes.Find(p2);
 ASSERT(pos1 && pos2);
 m_lstPanes.SetAt(pos1, p2);
 m_lstPanes.SetAt(pos2, p1);
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: akur
Date Posted: 04 January 2007 at 4:19am
Thank you, oleg, it works!


Posted By: joecasa
Date Posted: 26 March 2007 at 4:49pm
This is sort of off topic, but how did you programatically attach three panes like that?
 
I've tried but after I attach two frames together, if I try to attach a third pane, it essentially de tatches the the first pane.
 
I want to attach four panes together across the bottom of my form so I have 4 tabs but so far the closest I've been able to get is two sets of two tabs.
 
Thanks in advance for your help.


Posted By: akur
Date Posted: 27 March 2007 at 1:24am
Actually, the original layout in the screenshot above was not achieved programatically, but I think CXTPDockingPaneManager::AttachPane() is the right method to use for what you want to do.
If you have problems with using it (as you say you have), you might found a bug. Or maybe a version update may help.


Posted By: Barto
Date Posted: 27 March 2007 at 4:59am
here's a sample code from my application where 4 panes are attached programmatically (as seen in your screenshot):

CXTPDockingPane* pPaneObjFsm = m_paneManager.CreatePane(IDR_PANE_OBJ_FSM, CRect(0, 0, 200, 400), xtpPaneDockBottom);

CXTPDockingPane* pPaneObjScript = m_paneManager.CreatePane(IDR_PANE_OBJ_SCRIPT, CRect(0, 0, 200, 400), xtpPaneDockBottom);

CXTPDockingPane* pPaneObjCollision = m_paneManager.CreatePane(IDR_PANE_OBJ_COLLISION, CRect(0, 0, 200, 400), xtpPaneDockBottom);

CXTPDockingPane* pPaneObjParticles = m_paneManager.CreatePane(IDR_PANE_OBJ_PARTICLES, CRect(0, 0, 200, 400), xtpPaneDockBottom);

CXTPDockingPane* pPaneObjSearch = m_paneManager.CreatePane(IDR_PANE_OBJ_SEARCH, CRect(0, 0, 200, 400), xtpPaneDockBottom);

m_paneManager.AttachPane(pPaneObjScript, pPaneObjFsm);

m_paneManager.AttachPane(pPaneObjCollision, pPaneObjFsm);

m_paneManager.AttachPane(pPaneObjParticles, pPaneObjFsm);

m_paneManager.AttachPane(pPaneObjSearch, pPaneObjFsm);



Posted By: joecasa
Date Posted: 27 March 2007 at 1:55pm
Brilliant, that worked!!!
 
The problem was I was trying to do something like
 
b.AttachFrame(a)
c.AttachFrame(b)
d.AttachFrame(c)
 
but if you do:
 
b.AttachFrame(a)
c.AttachFrame(a)
d.AttachFrame(a)
 
Then it works as desired. Otherwise, when I tried to attach c to b, a would become detached and then attach d to c, b would become detached.
 
I'm using the active x controls in .NET but seeing your example gave me the correct hint to solve this issue.
 
Thank you Barto!!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net