LONG CvReplicationPageCollisionViewRight::OnUpdateData (WPARAM wParam, LPARAM lParam) { HTREEITEM hSelected = (HTREEITEM)wParam; CaCollisionItem* pItem = (CaCollisionItem*)lParam; if (!pItem) { if (m_pDlg && IsWindow (m_pDlg->m_hWnd)) m_pDlg->ShowWindow (SW_HIDE); m_pDlg2->DisplayData (NULL); m_pDlg2->ShowWindow (SW_SHOW); return 0; } m_bTransaction = pItem->IsTransaction(); if (m_bTransaction) { if (m_pDlg && IsWindow (m_pDlg->m_hWnd)) m_pDlg->ShowWindow (SW_HIDE); m_pDlg2->DisplayData ((CaCollisionTransaction*)pItem); m_pDlg2->ShowWindow (SW_SHOW); } else { if (m_pDlg2 && IsWindow (m_pDlg2->m_hWnd)) m_pDlg2->ShowWindow (SW_HIDE); m_pDlg->DisplayData ((CaCollisionSequence*)pItem); m_pDlg->ShowWindow (SW_SHOW); } return 0; }
void CvReplicationPageCollisionViewLeft::ResolveCurrentTransaction() { CTreeCtrl& treectrl = GetTreeCtrl(); HTREEITEM hCurrentSelected = treectrl.GetSelectedItem(); if (!hCurrentSelected) return; HTREEITEM hSaveSelected = hCurrentSelected; CaCollisionItem* pItem = (CaCollisionItem*)treectrl.GetItemData(hCurrentSelected); if (!pItem) return; if (!pItem->IsTransaction()) { hCurrentSelected = treectrl.GetParentItem(hCurrentSelected); pItem = (CaCollisionItem*)treectrl.GetItemData(hCurrentSelected); } if (pItem && pItem->IsTransaction()) { CFrameWnd* pParent = (CFrameWnd*)GetParentFrame(); CfIpmFrame* pFrame = (CfIpmFrame*)pParent->GetParentFrame(); ASSERT(pFrame); if (!pFrame) return; CdIpmDoc* pDoc = pFrame->GetIpmDoc(); CaCollisionTransaction* pTrans = (CaCollisionTransaction*)pItem; IPM_ResolveCurrentTransaction(pDoc, pItem); treectrl.SetItemImage (hCurrentSelected, pTrans->GetImageType(), pTrans->GetImageType()); } CfReplicationPageCollision* pFrame = (CfReplicationPageCollision*)GetParentFrame(); ASSERT (pFrame); if (pFrame) { CvReplicationPageCollisionViewRight* pViewR = (CvReplicationPageCollisionViewRight*)pFrame->GetRightPane(); ASSERT (pViewR); if (pViewR) { CaCollisionItem* pItem = (CaCollisionItem*)treectrl.GetItemData (hSaveSelected); pViewR->SendMessage (WM_USER_IPMPAGE_UPDATEING, (WPARAM)hSaveSelected, (LPARAM)pItem); } } }
BOOL CvReplicationPageCollisionViewLeft::CheckResolveCurrentTransaction() { CTreeCtrl& treectrl = GetTreeCtrl(); HTREEITEM hCurrentSelected = treectrl.GetSelectedItem(); if (!hCurrentSelected) return FALSE; HTREEITEM hSaveSelected = hCurrentSelected; CaCollisionItem* pItem = (CaCollisionItem*)treectrl.GetItemData(hCurrentSelected); if (!pItem) return FALSE; if (!pItem->IsTransaction()) { hCurrentSelected = treectrl.GetParentItem(hCurrentSelected); pItem = (CaCollisionItem*)treectrl.GetItemData(hCurrentSelected); } if (pItem && pItem->IsTransaction()) { CaCollisionTransaction* pTrans = (CaCollisionTransaction*)pItem; CTypedPtrList<CObList, CaCollisionSequence*>& listSeq = pTrans->GetListCollisionSequence(); POSITION pos = listSeq.GetHeadPosition(); while (pos != NULL) { CaCollisionSequence* pSeq = listSeq.GetNext (pos); switch (pSeq->GetImageType()) { case CaCollisionItem::PREVAIL_SOURCE: case CaCollisionItem::PREVAIL_TARGET: break; default: return FALSE; } } return TRUE; } return FALSE; }