[GME-commit]
GMESRC/GME/GMEActiveBrowser ActiveBrowserPropertyPage.cpp,1.32,1.33
ActiveBrowserPropertyPage.h,1.7,1.8
AggregateContextMenu.cpp,1.15,1.16 AggregateContextMenu.h,1.2,1.3
AggregateTreeCtrl.cpp,1.16,1.17 GMEActiveBrowser.rc,1.7,1.8
GMEActiveBrowserDropTarget.cpp,1.3,1.4
MgaMappedTreeCtrl.cpp,1.4,1.5 resource.h,1.4,1.5
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Jun 2 18:15:50 CDT 2004
- Previous message: [GME-commit] GMESRC/GME/Interfaces Gme.idl,1.12,1.13
InterfaceVersion.h,1.40,1.41 Mga.idl,1.37,1.38
MgaUtil.idl,1.32,1.33 Parser.idl,1.6,1.7
- Next message: [GME-commit] GMESRC/GME/Gme GME.rc,1.120,1.121 GMEDoc.cpp,1.20,1.21
GMEDoc.h,1.7,1.8 GMEOLEData.cpp,1.15,1.16 GMEOLEData.h,1.6,1.7
GMEView.cpp,1.150,1.151 GMEView.h,1.60,1.61 resource.h,1.54,1.55
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/gme/GMESRC/GME/GMEActiveBrowser
In directory braindrain:/tmp/cvs-serv31878
Modified Files:
ActiveBrowserPropertyPage.cpp ActiveBrowserPropertyPage.h
AggregateContextMenu.cpp AggregateContextMenu.h
AggregateTreeCtrl.cpp GMEActiveBrowser.rc
GMEActiveBrowserDropTarget.cpp MgaMappedTreeCtrl.cpp
resource.h
Log Message:
1.Copy closure menu introduced
2.Folder copy and move
3.Bug corrected when model/folder moved in expanded state
CVS User: zolmol
Index: ActiveBrowserPropertyPage.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** ActiveBrowserPropertyPage.cpp 18 May 2004 13:30:59 -0000 1.32
--- ActiveBrowserPropertyPage.cpp 2 Jun 2004 22:15:47 -0000 1.33
***************
*** 362,366 ****
{
// Recursive call for each children
! reqBuildAggregateTree(hItem,MGACOLL_ITER,nDepthLevel-1, nCounter-1,bWithUpdate);
} MGACOLL_ITERATE_END;
--- 362,366 ----
{
// Recursive call for each children
! reqBuildAggregateTree(hItem,MGACOLL_ITER,nDepthLevel-1, nCounter-1,bWithUpdate);
} MGACOLL_ITERATE_END;
***************
*** 753,757 ****
CComObjPtr<IMgaFCOs> ccpSelectedFCOs;
! COMTHROW(ccpSelectedFCOs.CoCreateInstance(L"Mga.MgaFCOs"));
typedef CTypedPtrList<CPtrList, CRect *> CRectList;
--- 753,759 ----
CComObjPtr<IMgaFCOs> ccpSelectedFCOs;
! COMTHROW( ccpSelectedFCOs.CoCreateInstance( L"Mga.MgaFCOs"));
! CComObjPtr<IMgaFolders> ccpSelectedFolders;
! COMTHROW( ccpSelectedFolders.CoCreateInstance( L"Mga.MgaFolders"));
typedef CTypedPtrList<CPtrList, CRect *> CRectList;
***************
*** 767,805 ****
if(m_TreeAggregate.m_MgaMap.LookupObjectProxy(hItem, ObjectProxy))
{
! if(ObjectProxy.m_TypeInfo==OBJTYPE_MODEL|| // FCOs except connection
! ObjectProxy.m_TypeInfo==OBJTYPE_ATOM||
! ObjectProxy.m_TypeInfo==OBJTYPE_REFERENCE||
! ObjectProxy.m_TypeInfo==OBJTYPE_SET)
{
! CComQIPtr<IMgaFCO>ccpMgaFCO(ObjectProxy.m_pMgaObject);
! if(ccpMgaFCO)
{
// Finding the rectangle of the selected item
! m_TreeAggregate.GetItemRect(hItem,rectItem,TRUE);
// Computing the frame of all rectangles
! rectFrame.UnionRect(rectFrame,rectItem);
// Adding to the selected rectangle list to create the image
! rectSelectedList.AddTail(new CRect(rectItem));
!
// Append to the selected FCO list
! ccpSelectedFCOs->Append(ccpMgaFCO);
}
}
! else
{
! m_TreeAggregate.SelectItemEx(hItem,FALSE);
}
}
}
! if(rectSelectedList.GetCount()!=0)
{
CRectList dummyAnnList;
! CGMEDataDescriptor GMEDataDescriptor(rectSelectedList, dummyAnnList,rectFrame.TopLeft(),CPoint(0,0));
! CGMEDataSource *pGMEDataSource=new CGMEDataSource(pMgaContext->m_ccpProject);
! pGMEDataSource->SetNodes( CComPtr<IMgaFCOs>(ccpSelectedFCOs.Detach()));
pGMEDataSource->CacheDescriptor(&GMEDataDescriptor);
--- 769,823 ----
if(m_TreeAggregate.m_MgaMap.LookupObjectProxy(hItem, ObjectProxy))
{
! if ( ObjectProxy.m_TypeInfo == OBJTYPE_MODEL || // FCOs except connection
! ObjectProxy.m_TypeInfo == OBJTYPE_ATOM ||
! ObjectProxy.m_TypeInfo == OBJTYPE_REFERENCE ||
! ObjectProxy.m_TypeInfo == OBJTYPE_SET)
{
! CComQIPtr<IMgaFCO> ccpMgaFCO( ObjectProxy.m_pMgaObject);
! if( ccpMgaFCO)
{
// Finding the rectangle of the selected item
! m_TreeAggregate.GetItemRect( hItem, rectItem, TRUE);
// Computing the frame of all rectangles
! rectFrame.UnionRect( rectFrame, rectItem);
// Adding to the selected rectangle list to create the image
! rectSelectedList.AddTail(new CRect( rectItem));
!
// Append to the selected FCO list
! ccpSelectedFCOs->Append( ccpMgaFCO);
}
}
! else if ( ObjectProxy.m_TypeInfo == OBJTYPE_FOLDER )
{
! CComQIPtr<IMgaFolder> ccpMgaFolder( ObjectProxy.m_pMgaObject);
! if( ccpMgaFolder)
! {
! // Finding the rectangle of the selected item
! m_TreeAggregate.GetItemRect( hItem, rectItem, TRUE);
! // Computing the frame of all rectangles
! rectFrame.UnionRect( rectFrame, rectItem);
!
! // Adding to the selected rectangle list to create the image
! rectSelectedList.AddTail( new CRect( rectItem));
!
! // Append to the selected FCO list
! ccpSelectedFolders->Append( ccpMgaFolder);
! }
}
}
}
! if( rectSelectedList.GetCount() != 0)
{
CRectList dummyAnnList;
! CGMEDataDescriptor GMEDataDescriptor( rectSelectedList, dummyAnnList, rectFrame.TopLeft(), CPoint( 0, 0));
! CGMEDataSource *pGMEDataSource = new CGMEDataSource( pMgaContext->m_ccpProject);
!
! if ( ccpSelectedFCOs) pGMEDataSource->SetNodes( CComPtr<IMgaFCOs>( ccpSelectedFCOs.Detach()));
! if ( ccpSelectedFolders) pGMEDataSource->SetFolders( CComPtr<IMgaFolders>( ccpSelectedFolders.Detach()));
!
pGMEDataSource->CacheDescriptor(&GMEDataDescriptor);
***************
*** 811,818 ****
else
{
! MessageBox("Folders and connections cannot be copied.","Copy Error", MB_ICONERROR);
}
}
void CAggregatePropertyPage::DoDrag( CPoint ptDrag)
{
--- 829,948 ----
else
{
! MessageBox("Connections cannot be copied.","Copy Error", MB_ICONERROR);
! }
! }
!
! void CAggregatePropertyPage::DoCopyClosure()
! {
!
! bool is_any_folder_selected = false;
! CGMEActiveBrowserApp * pApp = (CGMEActiveBrowserApp*) AfxGetApp();
! CMgaContext * pMgaContext = &pApp->m_CurrentProject.m_MgaContext;
!
! CComObjPtr<IMgaFCOs> ccpSelectedFCOs;
! CComObjPtr<IMgaFolders> ccpSelectedFolders;
! COMTHROW( ccpSelectedFCOs.CoCreateInstance( L"Mga.MgaFCOs"));
! COMTHROW( ccpSelectedFolders.CoCreateInstance( L"Mga.MgaFolders"));
!
! typedef CTypedPtrList< CPtrList, CRect *> CRectList;
! CRectList rectSelectedList;
! CRect rectItem;
! CRect rectFrame(0,0,0,0);
!
!
! for( HTREEITEM hItem = m_TreeAggregate.GetFirstSelectedItem();
! hItem;
! hItem = m_TreeAggregate.GetNextSelectedItem( hItem))
! {
! CMgaObjectProxy ObjectProxy;
! if( m_TreeAggregate.m_MgaMap.LookupObjectProxy( hItem, ObjectProxy))
! {
! if ( ObjectProxy.m_TypeInfo == OBJTYPE_MODEL // FCOs: connection too
! || ObjectProxy.m_TypeInfo == OBJTYPE_ATOM
! || ObjectProxy.m_TypeInfo == OBJTYPE_REFERENCE
! || ObjectProxy.m_TypeInfo == OBJTYPE_SET
! || ObjectProxy.m_TypeInfo == OBJTYPE_CONNECTION)
! {
! CComQIPtr<IMgaFCO> ccpMgaFCO( ObjectProxy.m_pMgaObject);
! if( ccpMgaFCO)
! {
! // Finding the rectangle of the selected item
! m_TreeAggregate.GetItemRect( hItem, rectItem, TRUE);
! // Computing the frame of all rectangles
! rectFrame.UnionRect( rectFrame, rectItem);
!
! // Adding to the selected rectangle list to create the image
! rectSelectedList.AddTail( new CRect( rectItem));
!
! // Append to the selected FCO list
! ccpSelectedFCOs->Append( ccpMgaFCO);
! }
! }
! else if ( ObjectProxy.m_TypeInfo == OBJTYPE_FOLDER )
! {
! CComQIPtr<IMgaFolder> ccpMgaFolder( ObjectProxy.m_pMgaObject);
! if( ccpMgaFolder)
! {
! {
! // Finding the rectangle of the selected item
! m_TreeAggregate.GetItemRect( hItem, rectItem, TRUE);
! // Computing the frame of all rectangles
! rectFrame.UnionRect( rectFrame, rectItem);
!
! // Adding to the selected rectangle list to create the image
! rectSelectedList.AddTail( new CRect( rectItem));
!
! // Append to the selected FCO list
! ccpSelectedFolders->Append( ccpMgaFolder);
! is_any_folder_selected = true;
! }
! }
! }
! }
}
+
+ if ( rectSelectedList.GetCount()!=0)
+ {
+ CComPtr<IMgaClosure> cl; //<!>
+ CComObjPtr<IMgaFCOs> sel_fcos, top_fcos;
+ CComObjPtr<IMgaFolders> sel_folders, top_folders;
+ COMTHROW( cl.CoCreateInstance(L"Mga.MgaClosure") );
+
+ COMTHROW( cl->SelectiveClosure(
+ ccpSelectedFCOs,
+ ccpSelectedFolders,
+ PutOut( sel_fcos),
+ PutOut( sel_folders),
+ PutOut( top_fcos),
+ PutOut( top_folders),
+ is_any_folder_selected?1:0 ));
+
+ if ( sel_fcos || sel_folders) // if both null the operation is not needed (either dumped to file already or unsuccessful)
+ {
+ CRectList dummyAnnList;
+
+ CGMEDataDescriptor GMEDataDescriptor( rectSelectedList, dummyAnnList, rectFrame.TopLeft(), CPoint( 0,0));
+
+ CGMEClosureDataSource * pGMEClosureDataSource = new CGMEClosureDataSource( pMgaContext->m_ccpProject);
+
+ if ( sel_fcos) pGMEClosureDataSource->SetNodes( sel_fcos);
+ if ( sel_folders) pGMEClosureDataSource->SetFolders( sel_folders);
+
+ if ( top_fcos) pGMEClosureDataSource->SetTopNodes( top_fcos);
+ if ( top_folders) pGMEClosureDataSource->SetTopNodes( top_folders);
+
+ pGMEClosureDataSource->CacheDescriptor( &GMEDataDescriptor);
+
+ pGMEClosureDataSource->SetClipboard();
+ pGMEClosureDataSource->FlushClipboard();
+ }
+ }
+ else
+ {
+ MessageBox("No object selected","Copy Error", MB_ICONERROR);
+ }
}
+
void CAggregatePropertyPage::DoDrag( CPoint ptDrag)
{
***************
*** 824,827 ****
--- 954,959 ----
CComObjPtr<IMgaFCOs> ccpSelectedFCOs;
COMTHROW(ccpSelectedFCOs.CoCreateInstance(L"Mga.MgaFCOs"));
+ CComObjPtr<IMgaFolders> ccpSelectedFolders;
+ COMTHROW( ccpSelectedFolders.CoCreateInstance( L"Mga.MgaFolders"));
typedef CTypedPtrList<CPtrList, CRect *> CRectList;
***************
*** 857,860 ****
--- 989,1009 ----
}
}
+ else if ( ObjectProxy.m_TypeInfo == OBJTYPE_FOLDER )
+ {
+ CComQIPtr<IMgaFolder> ccpMgaFolder( ObjectProxy.m_pMgaObject);
+ if( ccpMgaFolder)
+ {
+ // Finding the rectangle of the selected item
+ m_TreeAggregate.GetItemRect( hItem, rectItem, TRUE);
+ // Computing the frame of all rectangles
+ rectFrame.UnionRect( rectFrame, rectItem);
+
+ // Adding to the selected rectangle list to create the image
+ rectSelectedList.AddTail( new CRect( rectItem));
+
+ // Append to the selected FCO list
+ ccpSelectedFolders->Append( ccpMgaFolder);
+ }
+ }
else
{
***************
*** 870,875 ****
CGMEDataDescriptor GMEDataDescriptor(rectSelectedList, dummyAnnList,rectFrame.TopLeft(),CPoint(0,0));
- GMEDataSource.SetNodes( CComPtr<IMgaFCOs>(ccpSelectedFCOs.Detach()));
GMEDataSource.CacheDescriptor(&GMEDataDescriptor);
--- 1019,1025 ----
CGMEDataDescriptor GMEDataDescriptor(rectSelectedList, dummyAnnList,rectFrame.TopLeft(),CPoint(0,0));
+ if ( ccpSelectedFCOs) GMEDataSource.SetNodes( CComPtr<IMgaFCOs>(ccpSelectedFCOs.Detach()));
+ if ( ccpSelectedFolders) GMEDataSource.SetFolders( CComPtr<IMgaFolders>(ccpSelectedFolders.Detach()));
GMEDataSource.CacheDescriptor(&GMEDataDescriptor);
***************
*** 881,885 ****
else
{
! MessageBox("Folders and connections cannot be dropped or copied.","Error", MB_ICONERROR);
}
}
--- 1031,1035 ----
else
{
! MessageBox("Connections cannot be dropped or copied.","Error", MB_ICONERROR);
}
}
***************
*** 1401,1405 ****
// Remember the parent
hParentItem=m_TreeAggregate.GetParentItem(hItem);
! // Remove item
m_TreeAggregate.DeleteItem(hItem);
}
--- 1551,1560 ----
// Remember the parent
hParentItem=m_TreeAggregate.GetParentItem(hItem);
!
! // Remove the children of the item
! if(m_Options.m_bIsDynamicLoading) // inserted by ZolMol to correct the bug when a model/folder is moved elsewhere in expanded state
! m_TreeAggregate.DeleteAllChildren( hItem);
!
! // Remove item
m_TreeAggregate.DeleteItem(hItem);
}
***************
*** 1417,1421 ****
// Setting icons
int nImage,nSelectedImage;
! m_TreeAggregate.GetItemImage(hParentItem,nImage,nSelectedImage);
if(tvItem.cChildren)
--- 1572,1576 ----
// Setting icons
int nImage,nSelectedImage;
! m_TreeAggregate.GetItemImage(hParentItem,nImage,nSelectedImage);
if(tvItem.cChildren)
***************
*** 1428,1436 ****
}
else
! { if(nImage>=ICON_NUMBER)
{
m_TreeAggregate.SetItemImage(hParentItem,nImage-ICON_NUMBER,nSelectedImage-ICON_NUMBER);
}
-
}
--- 1583,1591 ----
}
else
! {
! if(nImage>=ICON_NUMBER)
{
m_TreeAggregate.SetItemImage(hParentItem,nImage-ICON_NUMBER,nSelectedImage-ICON_NUMBER);
}
}
***************
*** 1500,1504 ****
{
bool bIsExpanded=!!(m_TreeAggregate.GetItemState(hParentItem,TVIS_EXPANDED)&TVIS_EXPANDED);
! if(!bIsExpanded) // If the parent was expanded, the whole stuff was handled by OBJECT_DESTROYED
{
TVITEM tvItem;
--- 1655,1659 ----
{
bool bIsExpanded=!!(m_TreeAggregate.GetItemState(hParentItem,TVIS_EXPANDED)&TVIS_EXPANDED);
! if(!bIsExpanded) // If the parent was expanded, the whole stuff was handled by OBJECT_DESTROYED
{
TVITEM tvItem;
***************
*** 1511,1527 ****
m_TreeAggregate.GetItemImage(hParentItem,nImage,nSelectedImage);
if(tvItem.cChildren)
{
! if(bIsExpanded && nImage<ICON_NUMBER)
{
m_TreeAggregate.SetItemImage(hParentItem,nImage+ICON_NUMBER,nSelectedImage+ICON_NUMBER);
}
}
! else
! { if(nImage>=ICON_NUMBER)
{
m_TreeAggregate.SetItemImage(hParentItem,nImage-ICON_NUMBER,nSelectedImage-ICON_NUMBER);
}
-
}
--- 1666,1683 ----
m_TreeAggregate.GetItemImage(hParentItem,nImage,nSelectedImage);
+ // NOTE: the if branch is totally useless, since bIsExpanded is false
if(tvItem.cChildren)
{
! if(bIsExpanded && nImage<ICON_NUMBER) // change to opened icon
{
m_TreeAggregate.SetItemImage(hParentItem,nImage+ICON_NUMBER,nSelectedImage+ICON_NUMBER);
}
}
! else // if no children then if opened icon used previously, change it to the closed icon
! {
! if(nImage>=ICON_NUMBER)
{
m_TreeAggregate.SetItemImage(hParentItem,nImage-ICON_NUMBER,nSelectedImage-ICON_NUMBER);
}
}
Index: ActiveBrowserPropertyPage.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ActiveBrowserPropertyPage.h 5 Jul 2002 00:47:00 -0000 1.7
--- ActiveBrowserPropertyPage.h 2 Jun 2004 22:15:47 -0000 1.8
***************
*** 32,35 ****
--- 32,36 ----
void DoDrag(CPoint ptDrag);
void DoCopy();
+ void DoCopyClosure();
CComboEdit m_ComboEditCtrl;
Index: AggregateContextMenu.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/AggregateContextMenu.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AggregateContextMenu.cpp 17 Nov 2003 17:08:02 -0000 1.15
--- AggregateContextMenu.cpp 2 Jun 2004 22:15:47 -0000 1.16
***************
*** 83,86 ****
--- 83,87 ----
case ID_EDIT_CUT: OnEditCut();break;
case ID_EDIT_COPY: OnEditCopy();break;
+ case ID_EDIT_COPYCLOSURE: OnEditCopyClosure();break;
case ID_EDIT_PASTE: OnEditPaste();break;
case ID_POPUP_EDIT_DELETE: OnEditDelete();break;
***************
*** 264,267 ****
--- 265,274 ----
}
+ void CAggregateContextMenu::OnEditCopyClosure()
+ {
+ CPoint ptDummy;
+ m_pParent->DoCopyClosure();
+ }
+
void CAggregateContextMenu::OnEditPaste()
{
***************
*** 537,541 ****
BOOL bEnable = OleDataObj.AttachClipboard() &&
( CGMEDataSource::IsGmeNativeDataAvailable(&OleDataObj,pMgaContext->m_ccpProject) ||
! CGMEDataSource::IsXMLDataAvaliable(&OleDataObj) );
if(bEnable)
{
--- 544,548 ----
BOOL bEnable = OleDataObj.AttachClipboard() &&
( CGMEDataSource::IsGmeNativeDataAvailable(&OleDataObj,pMgaContext->m_ccpProject) ||
! CGMEDataSource::IsXMLDataAvailable(&OleDataObj) );
if(bEnable)
{
Index: AggregateContextMenu.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/AggregateContextMenu.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AggregateContextMenu.h 21 Mar 2002 00:59:00 -0000 1.2
--- AggregateContextMenu.h 2 Jun 2004 22:15:47 -0000 1.3
***************
*** 49,52 ****
--- 49,53 ----
void OnEditPaste();
void OnEditCopy();
+ void OnEditCopyClosure();
void OnEditCut();
void OnEditRedo();
Index: AggregateTreeCtrl.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/AggregateTreeCtrl.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** AggregateTreeCtrl.cpp 10 Oct 2003 07:58:03 -0000 1.16
--- AggregateTreeCtrl.cpp 2 Jun 2004 22:15:47 -0000 1.17
***************
*** 122,126 ****
if(m_MgaMap.LookupTreeItem(pUnknown,hTreeItem))
{
-
return hTreeItem;
}
--- 122,125 ----
***************
*** 731,735 ****
}
-
BOOL CAggregateTreeCtrl::DoDrop(eDragOperation doDragOp, COleDataObject *pDataObject, CPoint point)
{
--- 730,733 ----
***************
*** 760,764 ****
if (!CGMEDataSource::IsGmeNativeDataAvailable(pDataObject,pMgaContext->m_ccpProject))
{
! if (!CGMEDataSource::IsXMLDataAvaliable(pDataObject)) {
MessageBox("Unknown clipboard format.","Error",MB_OK|MB_ICONERROR);
return FALSE;
--- 758,762 ----
if (!CGMEDataSource::IsGmeNativeDataAvailable(pDataObject,pMgaContext->m_ccpProject))
{
! if (!CGMEDataSource::IsXMLDataAvailable(pDataObject)) {
MessageBox("Unknown clipboard format.","Error",MB_OK|MB_ICONERROR);
return FALSE;
***************
*** 779,796 ****
CComPtr<IUnknown> ccpData;
! COMTHROW(ccpMgaDataSource->get_Data(&ccpData));
CComPtr<IMgaResolver> ccpMgaResolver;
COMTHROW( ccpMgaResolver.CoCreateInstance(L"Mga.MgaResolver") );
! CComQIPtr<IMgaFCOs> ccpDroppedFCOs(ccpData);
! if(!ccpDroppedFCOs) return FALSE;
BOOL bRetVal=FALSE;
-
-
MSGTRY{
pMgaContext->BeginTransaction(FALSE); // Read/Write Transaction
--- 777,795 ----
CComPtr<IUnknown> ccpData;
! COMTHROW(ccpMgaDataSource->get_Data( &ccpData));
+ CComPtr<IUnknown> ccpFolders;
+ COMTHROW(ccpMgaDataSource->get_Folders( &ccpFolders));
CComPtr<IMgaResolver> ccpMgaResolver;
COMTHROW( ccpMgaResolver.CoCreateInstance(L"Mga.MgaResolver") );
! CComQIPtr<IMgaFCOs> ccpDroppedFCOs( ccpData);
! CComQIPtr<IMgaFolders> ccpDroppedFolders( ccpFolders);
! if( !ccpDroppedFCOs && !ccpDroppedFolders) return FALSE;
BOOL bRetVal=FALSE;
MSGTRY{
pMgaContext->BeginTransaction(FALSE); // Read/Write Transaction
***************
*** 803,815 ****
case DRAGOP_MOVE:
{
CComPtr<IMgaFCOs> ccpNewFCOs;
- COMTHROW(ccpTargetFolder->MoveFCOs(ccpDroppedFCOs,&ccpNewFCOs));
- bRetVal=TRUE;
}break;
case DRAGOP_COPY:
{
CComPtr<IMgaFCOs> ccpNewFCOs;
COMTHROW(ccpTargetFolder->CopyFCOs(ccpDroppedFCOs,&ccpNewFCOs));
bRetVal=TRUE;
}break;
--- 802,829 ----
case DRAGOP_MOVE:
{
+ CComPtr<IMgaFolders> ccpNewFolders;
CComPtr<IMgaFCOs> ccpNewFCOs;
+ // first move the selected folders. The order matters
+ // since the NEWCHILD event must be the last one.
+ COMTHROW( ccpTargetFolder->MoveFolders( ccpDroppedFolders, &ccpNewFolders));
+
+ // then move the selected fcos
+ COMTHROW( ccpTargetFolder->MoveFCOs( ccpDroppedFCOs, &ccpNewFCOs));
+
+ // this ensures that the new parent is notified in the right time and place
+ // a NEWCHILD event is sent to the target folder
+ COMTHROW( ccpTargetFolder->RefreshParent( ccpTargetFolder));
+
+ bRetVal=TRUE;
}break;
case DRAGOP_COPY:
{
+ CComPtr<IMgaFolders> ccpNewFolders;
+ COMTHROW(ccpTargetFolder->CopyFolders(ccpDroppedFolders,&ccpNewFolders));
+
CComPtr<IMgaFCOs> ccpNewFCOs;
COMTHROW(ccpTargetFolder->CopyFCOs(ccpDroppedFCOs,&ccpNewFCOs));
+
bRetVal=TRUE;
}break;
***************
*** 846,849 ****
--- 860,868 ----
else if(MgaObjectProxy.m_TypeInfo==OBJTYPE_MODEL) // If the drop target is a model
{
+ long fol_cnt;
+ COMTHROW( ccpDroppedFolders->get_Count( &fol_cnt));
+ if ( fol_cnt > 0)
+ AfxMessageBox("Cannot insert folders into a model");
+
CComQIPtr<IMgaModel> ccpTargetModel(MgaObjectProxy.m_pMgaObject);
switch(doDragOp)
***************
*** 851,854 ****
--- 870,874 ----
case DRAGOP_MOVE:
{
+ #if(0) // plain old version
CComPtr<IMgaFCOs> ccpNewFCOs;
***************
*** 871,874 ****
--- 891,945 ----
MGACOLL_ITERATE_END;
COMTHROW( ccpTargetModel->MoveFCOs(ccpDroppedFCOs,ccpMetaRoles,&ccpNewFCOs) );
+
+ bRetVal = TRUE;
+ #else // check if the target = source
+ CComPtr<IMgaFCOs> ccpNewFCOs;
+
+ CComPtr<IMgaMetaRoles> ccpMetaRoles;
+ COMTHROW(ccpMetaRoles.CoCreateInstance(OLESTR("Mga.MgaMetaRoles")));
+
+ long fco_cnt = 0;
+ COMTHROW( ccpDroppedFCOs->get_Count( &fco_cnt));
+ if ( fco_cnt > 0)
+ {
+ bool valid = true;
+ if ( fco_cnt == 1)
+ {
+ valid = false;
+ CComPtr<IMgaFCO> one_fco;
+ MGACOLL_ITERATE(IMgaFCO, ccpDroppedFCOs) {
+ one_fco = MGACOLL_ITER;
+ } MGACOLL_ITERATE_END;
+ VARIANT_BOOL is_equal;
+ COMTHROW( one_fco->get_IsEqual( ccpTargetModel, &is_equal));
+
+ if (is_equal == VARIANT_FALSE) // not equal
+ valid = true;
+ }
+
+ if ( valid)
+ {
+ MGACOLL_ITERATE(IMgaFCO, ccpDroppedFCOs)
+ {
+ CComPtr<IMgaFCO> ccpFCO;
+ COMTHROW(pMgaContext->m_ccpTerritory->OpenFCO(MGACOLL_ITER, &ccpFCO));
+ CComPtr<IMgaMetaRole> ccpMetaRole;
+ COMTHROW(ccpFCO->get_MetaRole(&ccpMetaRole));
+ CComPtr<IMgaMetaFCO> ccpKind;
+ COMTHROW(ccpFCO->get_Meta(&ccpKind));
+ CComPtr<IMgaMetaRole> ccpNewRole;
+
+ COMTHROW(ccpMgaResolver->get_RoleByMeta(ccpTargetModel,ccpKind,OBJTYPE_NULL,ccpMetaRole,NULL,&ccpNewRole));
+ COMTHROW(ccpMetaRoles->Append(ccpNewRole));
+ }
+ MGACOLL_ITERATE_END;
+
+ COMTHROW( ccpTargetModel->MoveFCOs(ccpDroppedFCOs,ccpMetaRoles,&ccpNewFCOs) );
+ bRetVal = TRUE;
+ }
+ else bRetVal = FALSE;
+ }
+ else bRetVal=FALSE; //?
+ #endif
}break;
Index: GMEActiveBrowser.rc
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/GMEActiveBrowser.rc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** GMEActiveBrowser.rc 10 Oct 2003 07:58:03 -0000 1.7
--- GMEActiveBrowser.rc 2 Jun 2004 22:15:47 -0000 1.8
***************
*** 299,302 ****
--- 299,303 ----
MENUITEM SEPARATOR
MENUITEM "&Copy", ID_EDIT_COPY
+ MENUITEM "C&opy Closure", ID_EDIT_COPYCLOSURE
MENUITEM SEPARATOR
MENUITEM "Delete", ID_POPUP_EDIT_DELETE
***************
*** 357,360 ****
--- 358,362 ----
MENUITEM SEPARATOR
MENUITEM "&Copy", ID_EDIT_COPY
+ MENUITEM "C&opy Closure", ID_EDIT_COPYCLOSURE
MENUITEM "&Paste", ID_EDIT_PASTE
MENUITEM SEPARATOR
Index: GMEActiveBrowserDropTarget.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/GMEActiveBrowserDropTarget.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GMEActiveBrowserDropTarget.cpp 7 Feb 2003 15:11:23 -0000 1.3
--- GMEActiveBrowserDropTarget.cpp 2 Jun 2004 22:15:47 -0000 1.4
***************
*** 100,104 ****
CComPtr<IMgaProject> ccpMgaProject=pApp->m_CurrentProject.m_MgaContext.m_ccpProject;
if(!CGMEDataSource::IsGmeNativeDataAvailable(pDataObject, ccpMgaProject)) {
! if (CGMEDataSource::IsXMLDataAvaliable(pDataObject)) {
m_doDragOperation=DRAGOP_COPY;
return DROPEFFECT_COPY;
--- 100,104 ----
CComPtr<IMgaProject> ccpMgaProject=pApp->m_CurrentProject.m_MgaContext.m_ccpProject;
if(!CGMEDataSource::IsGmeNativeDataAvailable(pDataObject, ccpMgaProject)) {
! if (CGMEDataSource::IsXMLDataAvailable(pDataObject)) {
m_doDragOperation=DRAGOP_COPY;
return DROPEFFECT_COPY;
Index: MgaMappedTreeCtrl.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/MgaMappedTreeCtrl.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MgaMappedTreeCtrl.cpp 21 Jun 2002 18:49:00 -0000 1.4
--- MgaMappedTreeCtrl.cpp 2 Jun 2004 22:15:47 -0000 1.5
***************
*** 67,71 ****
void CMgaMappedTreeCtrl::DeleteAllChildren(HTREEITEM hParent)
{
! if (ItemHasChildren(hParent))
{
HTREEITEM hItem = GetChildItem(hParent);
--- 67,71 ----
void CMgaMappedTreeCtrl::DeleteAllChildren(HTREEITEM hParent)
{
! if (ItemHasChildren(hParent)) // this may indicate true and the GetChildItem may give at the same time back 0x00000000 since that children may not have htreeitem inserted for it
{
HTREEITEM hItem = GetChildItem(hParent);
Index: resource.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/GMEActiveBrowser/resource.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** resource.h 21 Mar 2002 00:59:00 -0000 1.4
--- resource.h 2 Jun 2004 22:15:47 -0000 1.5
***************
*** 63,66 ****
--- 63,67 ----
#define ID_POPUP_ATTACH_LIBRARY 32787
#define ID_POPUP_REFRESH_LIBRARY 32788
+ #define ID_EDIT_COPYCLOSURE 32789
// Next default values for new objects
***************
*** 69,73 ****
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 220
! #define _APS_NEXT_COMMAND_VALUE 32789
#define _APS_NEXT_CONTROL_VALUE 218
#define _APS_NEXT_SYMED_VALUE 104
--- 70,74 ----
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 220
! #define _APS_NEXT_COMMAND_VALUE 32790
#define _APS_NEXT_CONTROL_VALUE 218
#define _APS_NEXT_SYMED_VALUE 104
- Previous message: [GME-commit] GMESRC/GME/Interfaces Gme.idl,1.12,1.13
InterfaceVersion.h,1.40,1.41 Mga.idl,1.37,1.38
MgaUtil.idl,1.32,1.33 Parser.idl,1.6,1.7
- Next message: [GME-commit] GMESRC/GME/Gme GME.rc,1.120,1.121 GMEDoc.cpp,1.20,1.21
GMEDoc.h,1.7,1.8 GMEOLEData.cpp,1.15,1.16 GMEOLEData.h,1.6,1.7
GMEView.cpp,1.150,1.151 GMEView.h,1.60,1.61 resource.h,1.54,1.55
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the GME-commit
mailing list