[GME-commit] GMESRC/GME/GMEActiveBrowser ActiveBrowserPropertyPage.cpp,1.41,1.42

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Apr 13 00:42:18 CDT 2005


Update of /project/gme-repository/GMESRC/GME/GMEActiveBrowser
In directory escher:/tmp/cvs-serv20992

Modified Files:
	ActiveBrowserPropertyPage.cpp 
Log Message:
Closure called in two steps


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: ActiveBrowserPropertyPage.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** ActiveBrowserPropertyPage.cpp	26 Jan 2005 17:28:25 -0000	1.41
--- ActiveBrowserPropertyPage.cpp	12 Apr 2005 23:42:16 -0000	1.42
***************
*** 12,16 ****
  #include "AttachLibDlg.h"
  #include <comdef.h>
! 
  #include "CommonMfc.h"
  
--- 12,16 ----
  #include "AttachLibDlg.h"
  #include <comdef.h>
! #include "Parser.h"
  #include "CommonMfc.h"
  
***************
*** 955,997 ****
  	{
  		CComPtr<IMgaClosure> cl;
  		CComObjPtr<IMgaFCOs> sel_fcos, top_fcos;
  		CComObjPtr<IMgaFolders> sel_folders, top_folders;
! 		long options;
! 		CComBstrObj acckinds;
  
! 		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,
! 			&options,
! 			PutOut( acckinds)
  			));
  
! 		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->SetOptions( options);
! 			pGMEClosureDataSource->SetAcceptingKinds( acckinds);
  
  			pGMEClosureDataSource->CacheDescriptor( &GMEDataDescriptor);
- 
  			pGMEClosureDataSource->SetClipboard();
  			pGMEClosureDataSource->FlushClipboard();
--- 955,1054 ----
  	{
  		CComPtr<IMgaClosure> cl;
+ 		VARIANT_BOOL _refersTo           ; VARIANT_BOOL _referredBy;
+ 		VARIANT_BOOL _connections        ; VARIANT_BOOL _connsThroughRefport;
+ 		VARIANT_BOOL _setMembers         ; VARIANT_BOOL _memberOfSets;
+ 		VARIANT_BOOL _modelContainment   ; VARIANT_BOOL _partOfModels;
+ 		VARIANT_BOOL _folderContainment  ; VARIANT_BOOL _partOfFolders;
+ 		VARIANT_BOOL _baseTypeOf         ; VARIANT_BOOL _derivedTypesOf;
+ 		long _libraryElementHandling;         // 0: stubs; 1: stop; 2: continue
+ 		long _wrappingMode;                   // 0: miniproject; 1: automatic; 2: as is
+ 		long _kindFilter;                     // -1 = all; otherwise calculate the 0b000rsamf mask; where f = Folders; m = Models; a = Atoms; s = Sets; r = References
+ 		long _options;
+ 		VARIANT_BOOL _directionDown;
+ 		VARIANT_BOOL _copyToFile;             // file or clipboard
+ 		VARIANT_BOOL _okPressed;              // how ended the dialog
+ 		CComBSTR _userSelFileName;
+ 
+ 		COMTHROW( cl.CoCreateInstance(L"Mga.MgaClosure") );
+ 		COMTHROW( cl->SelectiveClosureDlg
+ 			( is_any_folder_selected ? VARIANT_TRUE : VARIANT_FALSE
+ 			, &_refersTo           , &_referredBy
+ 			, &_connections        , &_connsThroughRefport
+ 			, &_setMembers         , &_memberOfSets
+ 			, &_modelContainment   , &_partOfModels
+ 			, &_folderContainment  , &_partOfFolders
+ 			, &_baseTypeOf         , &_derivedTypesOf
+ 			, &_libraryElementHandling          // 0: stubs; 1: stop; 2: continue
+ 			, &_wrappingMode                    // 0: miniproject; 1: automatic; 2: as is
+ 			, &_kindFilter                      // -1 = all; otherwise calculate the 0b000rsamf mask; where f = Folders; m = Models; a = Atoms; s = Sets; r = References
+ 			, &_options
+ 			, &_directionDown
+ 			, &_copyToFile              // file or clipboard
+ 			, &_okPressed               // how ended the dialog
+ 			, &_userSelFileName
+ 			));
+ 		if( _okPressed == VARIANT_FALSE) return;
+ 
  		CComObjPtr<IMgaFCOs> sel_fcos, top_fcos;
  		CComObjPtr<IMgaFolders> sel_folders, top_folders;
! 		//long options;
! 		VARIANT_BOOL tops_filled = VARIANT_FALSE;
! 		CComBstrObj acc_kinds;
  
! 		COMTHROW( cl->SelectiveClosureCalc
! 			( ccpSelectedFCOs    , ccpSelectedFolders
! 			, _refersTo          , _referredBy
! 			, _connections       , _connsThroughRefport
! 			, _setMembers        , _memberOfSets
! 			, _modelContainment  , _partOfModels
! 			, _folderContainment , _partOfFolders
! 			, _baseTypeOf        , _derivedTypesOf
! 			, _libraryElementHandling          // 0: stubs, 1: stop, 2: continue
! 			, _wrappingMode                    // 0: miniproject, 1: automatic, 2: as is
! 			, _kindFilter                      // -1 = all, otherwise calculate the 0b000rsamf mask, where f = Folders, m = Models, a = Atoms, s = Sets, r = References
! 			, _directionDown
! 			, PutOut( sel_fcos), PutOut( sel_folders)
! 			, PutOut( top_fcos), PutOut( top_folders)
! 			, &tops_filled
! 			, PutOut( acc_kinds)
  			));
  
! 		if( !sel_fcos && !sel_folders) return;
! 
! 		if( _copyToFile == VARIANT_TRUE) 
  		{
! 			CComPtr<IMgaDumper> dumper;
! 			COMTHROW( dumper.CoCreateInstance(L"Mga.MgaDumper") );
  
+ 			if( _wrappingMode == 0)
+ 			{
+ 					COMTHROW( dumper->DumpClos( sel_fcos, sel_folders, _userSelFileName, _options) );
+ 			}
+ 			else if( _wrappingMode == 1 || _wrappingMode == 2)
+ 			{
+ 				if ( tops_filled == VARIANT_TRUE)
+ 					COMTHROW( dumper->DumpClosR( sel_fcos, sel_folders, _userSelFileName, top_fcos, top_folders, _options, 0, acc_kinds));
+ 				else 
+ 					// dump like in miniproject case from The RootFolder
+ 					// if the data is copied to clipboard then the DumpClosR will call the 
+ 					// DumpClos when it will realize the topfco and topfolders are empty
+ 					COMTHROW( dumper->DumpClos( sel_fcos, sel_folders, _userSelFileName, _options));
+ 			}
+ 		}
+ 		else // _copyToFile == VARIANT_FALSE 
+ 		{
  			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->SetOptions( _options);
! 			pGMEClosureDataSource->SetAcceptingKinds( acc_kinds);
  
  			pGMEClosureDataSource->CacheDescriptor( &GMEDataDescriptor);
  			pGMEClosureDataSource->SetClipboard();
  			pGMEClosureDataSource->FlushClipboard();



More information about the GME-commit mailing list