Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Get Active Pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Get Active Pane

 Post Reply Post Reply
Author
Message
developer View Drop Down
Newbie
Newbie


Joined: 05 August 2004
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote developer Quote  Post ReplyReply Direct Link To This Post Topic: Get Active Pane
    Posted: 05 August 2004 at 10:50am
I am trying to determine what pane is currently selected/active, regardless of whether it is docked or hidden or floating. I have a custom Theme that changes the selected/active Panes title bars color to orange when it is selected/active. I want the function to return a ptr to that Pane. I didn't find a function that did what I was looking for so I tried to write one but it is not working. I need this so that I can set focus back to what last had focus during certain situations. This is what my current function looks like. Any suggestions or does anyone know of any other function that already does what I am looking for?


CXTPDockingPane* CMyManager::GetActivePane()
{
CXTPDockingPaneInfoList& paneList = m_paneManager.GetPaneList();
POSITION pos = paneList.GetHeadPosition();

CXTPDockingPaneTabbedContainer* pContainer = NULL;
CXTPDockingPane* pPane = NULL;
while (pos)
{
    pPane = paneList.GetNext(pos);
    pContainer = ((CXTPDockingPaneTabbedContainer*)pPane->GetContainer());
    if (pContainer && pContainer->IsActive())
    {
      return pPane;
    }
}
return NULL;
}


Edited by developer
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2004 at 7:25am
I believe you can use the IsSelected and Select methods defined in XTPDockingPane.h or IsPaneSelected defined in XTPDockingPaneManager.h.
Back to Top
developer View Drop Down
Newbie
Newbie


Joined: 05 August 2004
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote developer Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2004 at 9:34am
I tried that. Every pane seems to return true for IsPaneSelected. I think IsPaneSelected tells you which pane is selected if the tabs are showing (meaning, more then one pane is attached to another.) I also tried IsSelected but IsPaneSelected calls IsSelected on the 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: 10 August 2004 at 5:29am

In your method replace:

if (pContainer && pContainer->IsActive())
    {
      return pPane;
    }

to

if (pContainer && pContainer->IsActive())
    {
      return pContainer->GetSelected();
    }

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
developer View Drop Down
Newbie
Newbie


Joined: 05 August 2004
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote developer Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2004 at 9:47am
When the item is floating. GetContainer() returns NULL. How do I find the selected pane at that point? Thanks.
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: 11 August 2004 at 2:20am
It can't be truth. Container for DockingPane is always CXTPDockingPaneTabbedContainer if it visible.
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.172 seconds.