Change order of docking pane tabs |
Post Reply |
Author | |
akur
Senior Member Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
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! |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
akur
Senior Member Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
|
Thank you, oleg, it works!
|
|
joecasa
Newbie Joined: 13 March 2007 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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.
|
|
akur
Senior Member Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
|
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. |
|
Barto
Groupie Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
|
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); |
|
joecasa
Newbie Joined: 13 March 2007 Location: United States Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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!!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |