How to control which panes a pane can attach to? |
Post Reply |
Author | |
BenW
Newbie Joined: 29 March 2010 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 31 March 2010 at 9:45am |
I am trying to keep a set of panes from attaching to a specific pane (IDR_PANE_OUTPUT_BAR). I know this is handled by setting the bCancel member of the XTP_DOCKINGPANE_ACTION to false in the OnDockingPaneNotify message handler when wParam is XTP_DPN_ACTION, and the action member of the XPT_DOCKINGPANE_ACTION is xtpPaneActionAttaching. The problem I am having is determining if the pane that is going to have the new pane added already contains the IDR_PANE_OUTPUT_BAR pane. I have the following OnDockingPaneNotify message handler:
Pane ID's
#define IDR_PANE_PROJECT 4000
#define IDR_PANE_BACKGROUND 4001 #define IDR_PANE_COORDINATES 4002 #define IDR_PANE_STACKER 4003 #define IDR_PANE_LEGEND 4004 #define IDR_PANE_VIEW_EXTENTS 4005 #define IDR_PANE_OUTPUT_BAR 4006
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam) { switch (wParam) { case XTP_DPN_SHOWWINDOW: if (!pPane->IsValid()) { switch (pPane->GetID()) { case IDR_PANE_PROJECT: if (NULL == m_pMapObjectView) { this,RUNTIME_CLASS(CMapObjectView))); } else {
} break; case IDR_PANE_BACKGROUND:if (NULL == m_pBackgroundCtrl) {
} else {
} break; case IDR_PANE_LEGEND:if (NULL == m_pLegendCtrl) { this,RUNTIME_CLASS(CLegendCtrl))); } else {
} break; case IDR_PANE_STACKER:if (NULL == m_pStackerCtrl) { this,RUNTIME_CLASS(CStackerCtrl))); } else {
} break; case IDR_PANE_COORDINATES:if (NULL == m_pCoordinateCtrl) { this,RUNTIME_CLASS(CCoordinateCtrl))); } else {
} break; case IDR_PANE_VIEW_EXTENTS:if (NULL == m_pViewExtentsCtrl) { this,RUNTIME_CLASS(CViewExtentsCtrl))); } else {
} break; case IDR_PANE_OUTPUT_BAR:if (NULL == m_pOutputBar) { new COutputBarD(this); } if (0 == m_pOutputBar->GetSafeHwnd()) {this); } pPane->Attach(m_pOutputBar); break;} } return true;} break; case XTP_DPN_ACTION:switch (pAction->action) { case xtpPaneActionAttaching: "Action Pane %d\n",nID); TRACE( "Dock Container Type %s\n",strPaneType[pAction->pDockContainer->GetType()]); if (IDR_PANE_OUTPUT_BAR == nID) {true; return true; } else if ((IDR_PANE_PROJECT <= nID) && (IDR_PANE_VIEW_EXTENTS >= nID)) {if (xtpPaneTypeTabbedContainer == pAction->pDockContainer->GetType()) {
}
} else {
}
pAction->bCancel=FALSE;
return true;
} break;} return true;} break;} return false;} |
|
Product: Xtreme ToolkitPro (MFC) version 13.3.1
Platform: Windows XP (32bit) - SP 3 Visual Studio: 2008 Language: Visual C++ Unmanaged |
|
BenW
Newbie Joined: 29 March 2010 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
I Figured it out, here's the code
case XTP_DPN_ACTION:
{ XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lParam; UINT nID = pAction->pPane->GetID(); if (xtpPaneActionAttaching == pAction->action) { if ((IDR_PANE_PROJECT <= nID) && (IDR_PANE_VIEW_EXTENTS >= nID)) { if (xtpPaneTypeTabbedContainer == pAction->pDockContainer->GetType()) {CXTPDockingPaneTabbedContainer *tc = (CXTPDockingPaneTabbedContainer*)pAction->pDockContainer; CXTPDockingPane *fp = (CXTPDockingPane*)tc->GetFirstPane(); UINT pID = fp->GetID(); if ((IDR_PANE_PROJECT <= pID) && (IDR_PANE_VIEW_EXTENTS >= pID)) {pAction->bCancel = false;} else {pAction->bCancel = true;} } } else {pAction->bCancel = true;} return true;} } break; |
|
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 |