Print Page | Close Window

Tab Item Screen Rect

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


Topic: Tab Item Screen Rect
Posted By: alpine35
Subject: Tab Item Screen Rect
Date Posted: 17 July 2007 at 3:31pm
Hello,

For docking panes, is it possible to get the individual tab item screen rectangle? I need the item screen rectangle or more precise, an anchor point in order to popup a balloon help next to tab item in certain situations, when data is available for viewing but the pane is collapsed.

Thank you,





Replies:
Posted By: Oleg
Date Posted: 18 July 2007 at 1:17am
Hi,
get CXTPDockingPane pointer, get its parent as tabbed container:
 
CXTPDockingPaneTabbedContainer* pParent = (CXTPDockingPaneTabbedContainer*)pPane->GetContainer(),
 
find corresponded tab:

CXTPTabManagerItem* GetPaneTab(CXTPDockingPane* pPane) const
{
 for (int i = 0; i < pContainer->GetItemCount(); i++)
 {
  if (pContainer->GetItemPane(i) == pPane)
   return GetItem(i);
 }
 return NULL;
 
get rect using pItem->GetRect();


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


Posted By: alpine35
Date Posted: 18 July 2007 at 11:41pm
Hi Oleg,
 
I have followed your suggestion:
 
CXTPDockingPane* pPane = m_paneManager.FindPane(IDR_...);
CXTPDockingPaneTabbedContainer* pContainer = (CXTPDockingPaneTabbedContainer*)pPane->GetContainer();
 
The problem now is pContainer->GetItemCount() returns 0, although the tab item is available. Thanks for your help,


Posted By: Oleg
Date Posted: 19 July 2007 at 2:14am
Hi,
 
Sorry, didn't notice that you need tab when pane is hidden.
 
 
please add additional method  in sources and rebuild library (we will add it also)
 
in XTPDockingPaneAutoHidePanel.cpp:
 
CXTPTabManagerItem* CXTPDockingPaneAutoHidePanel::GetPaneTab(CXTPDockingPane* pPane) const
{
 for (int i = 0; i < m_pTabManagers->GetSize(); i++)
 {
  CAutoHidePanelTabManager* pTabManager = m_pTabManagers->GetAt(i);
  for (int j = 0; j < pTabManager->GetItemCount(); j++)
  {
   CXTPTabManagerItem* pItem = pTabManager->GetItem(j);
   if ((CXTPDockingPane*)pItem->GetData() == pPane)
   {
    return pItem;
   }
  }
 }
 return NULL;
}
 
 
now in you application use this code:
 
 
CXTPDockingPane* pPane = m_paneManager.FindPane(ID_VIEW_SOLUTIONEXPLORER);
 if (pPane && pPane->IsHidden())
 {
  CXTPDockingPaneAutoHidePanel* pAutoHideContainer =
   (CXTPDockingPaneAutoHidePanel*)(pPane->GetContainer()->GetContainer());
  CXTPTabManagerItem* pItem = pAutoHideContainer->GetPaneTab(pPane);
  if (pItem)
  {
   CRect rc = pItem->GetRect();
   pAutoHideContainer->ClientToScreen(rc);
  }
 }


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


Posted By: alpine35
Date Posted: 19 July 2007 at 12:25pm
Thank you Oleg,
 
Works like a charm. Assumimg this change will be integrated forward in your future product, it's the perfect solution.


Posted By: Oleg
Date Posted: 20 July 2007 at 2:40am
Thanks,
yes, it will be.


-------------
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