Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Change order of docking pane tabs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change order of docking pane tabs

 Post Reply Post Reply
Author
Message
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Topic: Change order of docking pane tabs
    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!

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 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
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 04 January 2007 at 4:19am
Thank you, oleg, it works!
Back to Top
joecasa View Drop Down
Newbie
Newbie
Avatar

Joined: 13 March 2007
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote joecasa Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post 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);

Back to Top
joecasa View Drop Down
Newbie
Newbie
Avatar

Joined: 13 March 2007
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote joecasa Quote  Post ReplyReply Direct Link To This Post 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!!
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.