Print Page | Close Window

Get Active Pane

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=1025
Printed Date: 10 May 2024 at 6:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get Active Pane
Posted By: developer
Subject: Get Active Pane
Date 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;
}



Replies:
Posted By: SuperMario
Date 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.


Posted By: developer
Date 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.


Posted By: Oleg
Date 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


Posted By: developer
Date 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.


Posted By: Oleg
Date 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



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