[GME-commit] GMESRC/GME/Gme GME.rc,1.129,1.130 GMEDoc.cpp,1.23,1.24 GMEDoc.h,1.9,1.10 GMEOLEData.cpp,1.18,1.19 GMEOLEData.h,1.8,1.9 GMEView.cpp,1.154,1.155 GMEView.h,1.61,1.62 resource.h,1.59,1.60

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Sep 27 18:01:42 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv14049

Modified Files:
	GME.rc GMEDoc.cpp GMEDoc.h GMEOLEData.cpp GMEOLEData.h 
	GMEView.cpp GMEView.h resource.h 
Log Message:
Copy smart menu introduced.


CVS User: zolmol

Index: GME.rc
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GME.rc,v
retrieving revision 1.129
retrieving revision 1.130
diff -C2 -d -r1.129 -r1.130
*** GME.rc	14 Sep 2004 14:04:57 -0000	1.129
--- GME.rc	27 Sep 2004 22:01:39 -0000	1.130
***************
*** 253,256 ****
--- 253,257 ----
          MENUITEM "&Copy\tCtrl+C",               ID_EDIT_COPY
          MENUITEM "C&opy Closure",               ID_EDIT_COPYCLOSURE
+         MENUITEM "Cop&y Smart",                 ID_EDIT_COPYSMART
          MENUITEM "&Paste\tCtrl+V",              ID_EDIT_PASTE
          POPUP "Paste &Special"
***************
*** 353,356 ****
--- 354,358 ----
          MENUITEM "Copy",                        ID_SELFCNTX_COPY
          MENUITEM "Copy Closure",                ID_SELFCNTX_COPYCLOSURE
+         MENUITEM "Copy Smart",                  ID_SELFCNTX_COPYSMART
          MENUITEM "Paste",                       ID_SELFCNTX_PASTE
          POPUP "Paste Special"
***************
*** 471,474 ****
--- 473,477 ----
          MENUITEM "Copy",                        ID_CNTX_COPY
          MENUITEM "Copy Closure",                ID_CNTX_COPYCLOSURE
+         MENUITEM "Copy Smart",                  ID_CNTX_COPYSMART
          MENUITEM "Delete",                      ID_CNTX_DELETE
          MENUITEM SEPARATOR
***************
*** 548,552 ****
  FONT 10, "MS Sans Serif"
  BEGIN
!     CTEXT           "4.5.18",IDC_STATIC,11,65,152,8,SS_NOPREFIX
      CTEXT           "Copyright © 2000-2004 Vanderbilt University",IDC_STATIC,
                      10,75,152,8
--- 551,555 ----
  FONT 10, "MS Sans Serif"
  BEGIN
!     CTEXT           "4.7.30",IDC_STATIC,11,65,152,8,SS_NOPREFIX
      CTEXT           "Copyright © 2000-2004 Vanderbilt University",IDC_STATIC,
                      10,75,152,8

Index: GMEDoc.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEDoc.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** GMEDoc.cpp	24 Jul 2004 06:41:53 -0000	1.23
--- GMEDoc.cpp	27 Sep 2004 22:01:39 -0000	1.24
***************
*** 102,105 ****
--- 102,175 ----
  }
  
+ bool CGMEDoc::CreateFcoList2(CGuiObjectList* list,CComPtr<IMgaFCOs> &fcos,CGMEView *view, unsigned int* p_howmany, bool* array[8])
+ {
+ 	bool all_containers = *array[ 0 ];
+ 	bool all_refs		= *array[ 1 ];
+ 	bool all_sets		= *array[ 2 ];
+ 	bool all_conns      = *array[ 3 ];
+ 
+ 	bool any_container	= *array[ 4 ];
+ 	bool any_ref		= *array[ 5 ];
+ 	bool any_set		= *array[ 6 ];
+ 	bool any_conn		= *array[ 7 ];
+ 
+ 	unsigned int how_many = 0, now_how_many = 0; 
+ 	try {
+ 		view->BeginTransaction(TRANSACTION_READ_ONLY);
+ 		ASSERT(view);
+ 
+ 		CComPtr<IMgaFCOs> coll;
+ 		COMTHROW(coll.CoCreateInstance(OLESTR("Mga.MgaFCOs")));
+ 		POSITION pos = list->GetHeadPosition();
+ 		while(pos) {
+ 			CComObjPtr<IMgaFCO> one_fco = list->GetNext(pos)->mgaFco;
+ 			COMTHROW(coll->Append( one_fco));
+ 
+ 			objtype_enum type_info;
+ 			COMTHROW( one_fco->get_ObjType(&type_info)); 
+ 
+ 			all_containers &= (type_info == OBJTYPE_MODEL || type_info == OBJTYPE_FOLDER);
+ 			all_refs  &= (type_info == OBJTYPE_REFERENCE);
+ 			all_sets  &= (type_info == OBJTYPE_SET);
+ 			all_conns &= (type_info == OBJTYPE_CONNECTION);
+ 
+ 			any_container |= (type_info == OBJTYPE_MODEL || type_info == OBJTYPE_FOLDER);
+ 			any_ref  |= (type_info == OBJTYPE_REFERENCE);
+ 			any_set  |= (type_info == OBJTYPE_SET);
+ 			any_conn |= (type_info == OBJTYPE_CONNECTION);
+ 			
+ 			++how_many;
+ 		}
+ 		COMTHROW(view->currentModel->AddInternalConnections(coll,&fcos));
+ 
+ 		// some connections might have been added
+ 		MGACOLL_ITERATE( IMgaFCO, fcos){
+ 			++now_how_many;
+ 		} MGACOLL_ITERATE_END;
+ 		
+ 		if( now_how_many > how_many)
+ 			any_conn = true;
+ 
+ 		view->CommitTransaction();
+ 	}
+ 	catch(hresult_exception e) {
+ 		view->AbortTransaction(e.hr);
+ 		return false;
+ 	}
+ 	
+ 	*p_howmany = now_how_many;
+ 
+ 	*array[ 0 ] = all_containers;
+ 	*array[ 1 ] = all_refs;
+ 	*array[ 2 ] = all_sets;
+ 	*array[ 3 ] = all_conns;
+ 	*array[ 4 ] = any_container;
+ 	*array[ 5 ] = any_ref;
+ 	*array[ 6 ] = any_set;
+ 	*array[ 7 ] = any_conn;
+ 
+ 	return true;
+ }
+ 
  bool CGMEDoc::CreateAnnotationList(CGuiAnnotatorList* list,CComPtr<IMgaRegNodes> &anns,CGMEView *view)
  {
***************
*** 148,153 ****
  	CComObjPtr<IMgaFolders> sel_folders, top_folders;
  	long options;
  	COMTHROW( cl.CoCreateInstance(L"Mga.MgaClosure") );
! 	COMTHROW( cl->SelectiveClosure( fcos, 0, PutOut( sel_fcos), PutOut( sel_folders), PutOut( top_fcos), PutOut( top_folders), 0, &options ));
  
  	if ( sel_fcos || sel_folders) // if both null the operation is not needed (either dumped to file already or unsuccessful)
--- 218,225 ----
  	CComObjPtr<IMgaFolders> sel_folders, top_folders;
  	long options;
+ 	CComBstrObj acckinds;
+ 
  	COMTHROW( cl.CoCreateInstance(L"Mga.MgaClosure") );
! 	COMTHROW( cl->SelectiveClosure( fcos, 0, PutOut( sel_fcos), PutOut( sel_folders), PutOut( top_fcos), PutOut( top_folders), 0, &options, PutOut( acckinds) ));
  
  	if ( sel_fcos || sel_folders) // if both null the operation is not needed (either dumped to file already or unsuccessful)
***************
*** 160,165 ****
--- 232,327 ----
  		if ( top_fcos)		pDataSource->SetTopNodes( top_fcos);
  		if ( top_folders)	pDataSource->SetTopNodes( top_folders);
+ 
+ 		pDataSource->SetOptions( options);
+ 		pDataSource->SetAcceptingKinds( acckinds);
+ 
+ 		CComPtr<IMgaRegNodes> anns; 
+ 		CreateAnnotationList( annList, anns, view);
+ 		pDataSource->SetAnnotations( anns);
+ 		pDataSource->CacheDescriptor( desc);
+ 		pDataSource->SetClipboard();
+ 		pDataSource->FlushClipboard();
+ 	}
+ }
+ 
+ void CGMEDoc::CopySmartToClipboard( CGuiObjectList* list, CGuiAnnotatorList *annList, CGMEDataDescriptor* desc, CGMEView *view)
+ {
+ 	int k = 0;
+ 	bool all_containers = true;
+ 	bool all_refs = true;
+ 	bool all_sets = true;
+ 	bool all_conns = true;
+ 
+ 	bool any_container = false;
+ 	bool any_ref = false;
+ 	bool any_set = false;
+ 	bool any_conn = false;
+ 
+ 	ASSERT( list && desc );
+ 
+ 	CComPtr<IMgaFCOs> fcos;
+ 	bool* b_array[8] = { &all_containers, &all_refs, &all_sets, &all_conns, &any_container, &any_ref, &any_set, &any_conn };
+ 	unsigned int number_of_elems = 0;
+ 
+ 	if( !CreateFcoList2( list, fcos, view, &number_of_elems, b_array)) return;
+ 
+ 	if( number_of_elems == 0) 
+ 	{
+ 		AfxMessageBox("No object selected", MB_ICONERROR);
+ 		return;
+ 	}
+ 
+ 	
+ 	CComPtr<IMgaClosure> cl;
+ 	CComObjPtr<IMgaFCOs> sel_fcos, top_fcos;
+ 	CComObjPtr<IMgaFolders> sel_folders, top_folders;
+ 	long options;
+ 	CComBstrObj acckinds; 
+ 	CComBstrObj path; 
+ 
+ 	// if container selected then it must be lonely (no multiple selection)
+ 	// if container selected no other kinds allowed
+ 	if( any_container && !all_containers || number_of_elems > 1 && all_containers)
+ 	{
+ 		AfxMessageBox("Invalid selection for smart copy. You can select either one container or several non-containers.", MB_ICONERROR);
+ 		return;
+ 	}
+ 
+ 	if( any_container) k |= 1024;
+ 
+ 	if( any_ref) k |= 2048;
+ 	if( any_set) k |= 4096;
+ 	if( any_conn) k |= 8192;
+ 
+ 	COMTHROW( cl.CoCreateInstance(L"Mga.MgaClosure") );
+ 	
+ 	COMTHROW( cl->SmartCopy( 
+ 		fcos, 
+ 		0, 
+ 		PutOut( sel_fcos), 
+ 		PutOut( sel_folders), 
+ 		PutOut( top_fcos), 
+ 		PutOut( top_folders), 
+ 		k, 
+ 		&options, 
+ 		PutOut( acckinds),
+ 		PutOut( path)
+ 		));
+ 	
+ 	if ( sel_fcos || sel_folders) // if both null the operation is not needed (either dumped to file already or unsuccessful)
+ 	{
+ 		CRectList dummyAnnList;
+ 
+ 		CGMEClosureDataSource * pDataSource = new CGMEClosureDataSource( theApp.mgaProject);
+ 
+ 		if ( sel_fcos)		pDataSource->SetNodes( sel_fcos);
+ 		if ( sel_folders)	pDataSource->SetFolders( sel_folders);
  		
+ 		if ( top_fcos)		pDataSource->SetTopNodes( top_fcos);
+ 		if ( top_folders)	pDataSource->SetTopNodes( top_folders);
+ 
  		pDataSource->SetOptions( options);
+ 		pDataSource->SetAbsPathPart( path);
+ 		pDataSource->SetAcceptingKinds( acckinds);
  
  		CComPtr<IMgaRegNodes> anns; 

Index: GMEDoc.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEDoc.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** GMEDoc.h	24 Jul 2004 06:41:53 -0000	1.9
--- GMEDoc.h	27 Sep 2004 22:01:39 -0000	1.10
***************
*** 46,51 ****
--- 46,53 ----
  
  	static bool CreateFcoList(CGuiObjectList* list,CComPtr<IMgaFCOs> &fcos,CGMEView *view);
+ 	static bool CreateFcoList2(CGuiObjectList* list,CComPtr<IMgaFCOs> &fcos,CGMEView *view, unsigned int *hm, bool* array[8]);
  	static bool CreateAnnotationList(CGuiAnnotatorList* list,CComPtr<IMgaRegNodes> &anns,CGMEView *view);
  	static void CopyClosureToClipboard(CGuiObjectList* list,CGuiAnnotatorList *annList,CGMEDataDescriptor* desc,CGMEView *view);
+ 	static void CopySmartToClipboard(CGuiObjectList* list,CGuiAnnotatorList *annList,CGMEDataDescriptor* desc,CGMEView *view);
  	static void CopyToClipboard(CGuiObjectList* list,CGuiAnnotatorList *annList,CGMEDataDescriptor* desc,CGMEView *view);
  	static DROPEFFECT DoDragDrop(CGuiObjectList* list, CGuiAnnotatorList *annList, CGMEDataDescriptor* desc,

Index: GMEOLEData.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEOLEData.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** GMEOLEData.cpp	30 Jun 2004 17:50:46 -0000	1.18
--- GMEOLEData.cpp	27 Sep 2004 22:01:39 -0000	1.19
***************
*** 254,258 ****
  		ASSERT( parser != NULL );
  
! 		COMTHROW( parser->ParseFCOs(target, PutInBstr(filename)) );
  		CFile::Remove(filename);
  
--- 254,297 ----
  		ASSERT( parser != NULL );
  
! 		CComBstrObj acckind, version; 
! 		VARIANT_BOOL is_acc_target;
! 		COMTHROW( parser->GetClipXMLInfo( PutInBstr(filename), target, &is_acc_target, PutOut( acckind), PutOut( version)) );
! 		CString ver = "0"; // defval
! 		if( version) // clipboard main token found, otherwise use defval
! 			CopyTo( version, ver);
! 
! 
! 		CComObjPtr<IMgaProject> t_project;
! 		COMTHROW(target->get_Project( PutOut(t_project)));
! 		CComPtr<IGMEOLEApp> t_GME = CGMEDataSource::get_GME( t_project);
! 		
! 		CComBSTR msg;
! 		if( ver == "0")
! 		{
! 			msg.Append("Inserting XML data...");
! 			if( t_GME) COMTHROW( t_GME->ConsoleMessage( msg, MSG_INFO));
! 			COMTHROW( parser->ParseFCOs(target, PutInBstr(filename)) );
! 		}
! 		else if( ver == "4")
! 		{
! 			msg.Append("Inserting XML SmartCopied data...");
! 			if( t_GME) COMTHROW( t_GME->ConsoleMessage( msg, MSG_INFO));
! 			COMTHROW( parser->ParseClos4( target, PutInBstr(filename)) );
! 		}
! 		else if ( ver == "1" || ver == "")
! 		{
! 			msg.Append("Inserting XML CopyClosured data...");
! 			if( t_GME) COMTHROW( t_GME->ConsoleMessage( msg, MSG_INFO));
! 			COMTHROW( parser->ParseClos1(target, PutInBstr(filename)) );
! 		}
! 		else
! 		{
! 			msg.Append("Error: Unknown clipboard closure format");
! 			if( t_GME) COMTHROW( t_GME->ConsoleMessage( msg, MSG_INFO));
! 
! 			ASSERT(0);
! 		}
! 		
! 			
  		CFile::Remove(filename);
  
***************
*** 417,421 ****
  
  			if ( is_top_set)
! 				COMTHROW( dumper->DumpClosR( fcos, fols, PutInBstr( filename), top_fcos, top_folds, m_options) );
  			else // if top objects are not set dump starting from RootFolder
  				COMTHROW( dumper->DumpClos( fcos, fols, PutInBstr( filename), m_options) );
--- 456,460 ----
  
  			if ( is_top_set)
! 				COMTHROW( dumper->DumpClosR( fcos, fols, PutInBstr( filename), top_fcos, top_folds, m_options, m_absPathPart, m_acceptingKinds) );
  			else // if top objects are not set dump starting from RootFolder
  				COMTHROW( dumper->DumpClos( fcos, fols, PutInBstr( filename), m_options) );
***************
*** 522,523 ****
--- 561,583 ----
  
  
+ 
+ /*static*/ CComPtr<IGMEOLEApp> CGMEDataSource::get_GME(CComObjPtr<IMgaProject> project)
+ {
+ 	CComPtr<IGMEOLEApp> gme;
+ 	if ( (project != NULL)) {		
+ 		CComBSTR bstrName("GME.Application");
+ 		CComPtr<IMgaClient> pClient;
+ 		HRESULT hr = project->GetClientByName(bstrName, &pClient);
+ 		if (SUCCEEDED(hr) && pClient) {
+ 			CComPtr<IDispatch> pDispatch;
+ 			hr = pClient->get_OLEServer(&pDispatch);
+ 			if (SUCCEEDED(hr) && pDispatch) {
+ 				hr = pDispatch.QueryInterface(&gme);
+ 				if (FAILED(hr)) {
+ 					gme = NULL;
+ 				}
+ 			}
+ 		}
+ 	}
+ 	return gme;
+ } 

Index: GMEOLEData.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEOLEData.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** GMEOLEData.h	30 Jun 2004 17:50:46 -0000	1.8
--- GMEOLEData.h	27 Sep 2004 22:01:39 -0000	1.9
***************
*** 4,8 ****
  #include <afxole.h>
  
- 
  class CGMEDataDescriptor
  {
--- 4,7 ----
***************
*** 63,66 ****
--- 62,66 ----
  	static bool IsXMLDataAvailable(COleDataObject *pDataObject);
  	static bool ParseXMLData(COleDataObject *pDataObject, IMgaObject *target);
+ 	static CComPtr<IGMEOLEApp> get_GME(CComObjPtr<IMgaProject> project);
  
  protected:
***************
*** 92,95 ****
--- 92,97 ----
  	CComPtr<IUnknown>	m_topFolders;
  	long				m_options;
+ 	CComBstrObj			m_absPathPart;
+ 	CComBstrObj			m_acceptingKinds;
  
  public:
***************
*** 97,100 ****
--- 99,104 ----
  	void SetTopNodes(IMgaFolders *objs) { m_topFolders = objs; }
  	void SetOptions( long l) { m_options = l; }
+ 	void SetAbsPathPart( const CComBstrObj& path) { m_absPathPart = path; }
+ 	void SetAcceptingKinds( const CComBstrObj& acceptingkinds) { m_acceptingKinds = acceptingkinds; }
  
  protected:

Index: GMEView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -C2 -d -r1.154 -r1.155
*** GMEView.cpp	14 Sep 2004 14:02:45 -0000	1.154
--- GMEView.cpp	27 Sep 2004 22:01:39 -0000	1.155
***************
*** 274,279 ****
--- 274,281 ----
  	ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
  	ON_COMMAND(ID_EDIT_COPYCLOSURE, OnEditCopyClosure)
+ 	ON_COMMAND(ID_EDIT_COPYSMART, OnEditCopySmart)
  	ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy)
  	ON_UPDATE_COMMAND_UI(ID_EDIT_COPYCLOSURE, OnUpdateEditCopyClosure)
+ 	ON_UPDATE_COMMAND_UI(ID_EDIT_COPYSMART, OnUpdateEditCopySmart)
  	ON_COMMAND(ID_EDIT_CUT, OnEditCut)
  	ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnUpdateEditCut)
***************
*** 282,285 ****
--- 284,288 ----
  	ON_COMMAND(ID_CNTX_COPY, OnCntxCopy)
  	ON_COMMAND(ID_CNTX_COPYCLOSURE, OnCntxCopyClosure)
+ 	ON_COMMAND(ID_CNTX_COPYSMART, OnCntxCopySmart)
  	ON_COMMAND(ID_CNTX_CUT, OnCntxCut)
  	ON_COMMAND(ID_CNTX_DELETE, OnCntxDelete)
***************
*** 287,291 ****
--- 290,296 ----
  	ON_UPDATE_COMMAND_UI(ID_SELFCNTX_COPY, OnUpdateSelfcntxCopy)
  	ON_COMMAND(ID_SELFCNTX_COPYCLOSURE, OnSelfcntxCopyClosure)
+ 	ON_COMMAND(ID_SELFCNTX_COPYSMART, OnSelfcntxCopySmart)
  	ON_UPDATE_COMMAND_UI(ID_SELFCNTX_COPYCLOSURE, OnUpdateSelfcntxCopyClosure)
+ 	ON_UPDATE_COMMAND_UI(ID_SELFCNTX_COPYSMART, OnUpdateSelfcntxCopySmart)
  	ON_COMMAND(ID_SELFCNTX_CUT, OnSelfcntxCut)
  	ON_UPDATE_COMMAND_UI(ID_SELFCNTX_CUT, OnUpdateSelfcntxCut)
***************
*** 4534,4537 ****
--- 4539,4557 ----
  }
  
+ void CGMEView::OnEditCopySmart()
+ {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCopySmart in "+path+name+"\r\n");
+ 	if(selected.GetCount() > 0) {
+ 		GMEEVENTLOG_GUIOBJS(selected);
+ 		GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
+ 		CPoint pt = CPoint(0,0);
+ 		CRectList rects, annRects;
+ 		CGuiObject::GetRectList(selected,rects);
+ 		CGuiAnnotator::GetRectList(selectedAnnotations,annRects);
+ 		CGMEDataDescriptor desc(rects,annRects,pt,pt);
+ 		GetDocument()->CopySmartToClipboard( &selected, &selectedAnnotations, &desc, this);
+ 	}
+ }
+ 
  void CGMEView::OnUpdateEditCopy(CCmdUI* pCmdUI)
  {
***************
*** 4544,4547 ****
--- 4564,4572 ----
  }
  
+ void CGMEView::OnUpdateEditCopySmart(CCmdUI* pCmdUI)
+ {
+ 	OnUpdateEditCopy( pCmdUI);
+ }
+ 
  void CGMEView::OnEditCut()
  {
***************
*** 4658,4661 ****
--- 4683,4720 ----
  }
  
+ void CGMEView::OnCntxCopySmart()
+ {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCopySmart in "+path+name+"\r\n");
+ 	if(contextSelection) {
+ 		CGuiObject *guiObj = dynamic_cast<CGuiObject *>(contextSelection);
+ 		if(guiObj) {
+ 			CGMEEventLogger::LogGMEEvent("    "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ 			CGuiObjectList list;
+ 			CGuiAnnotatorList dummyList;
+ 			list.AddTail(guiObj);
+ 			CPoint pt = CPoint(0,0);
+ 			CRectList rects;
+ 			CGuiObject::GetRectList(list,rects);
+ 			CRectList dummyAnnList;
+ 			CGMEDataDescriptor desc(rects,dummyAnnList,pt,pt);
+ 			GetDocument()->CopySmartToClipboard( &list, &dummyList, &desc, this);
+ 		}
+ 		contextSelection = 0;
+ 	}
+ 	else if (contextAnnotation) {
+ 		CGMEEventLogger::LogGMEEvent("    "+contextAnnotation->GetName()+"/r/n");
+ 		CGuiObjectList dummyList;
+ 		CGuiAnnotatorList list;
+ 		list.AddTail(contextAnnotation);
+ 		CPoint pt = CPoint(0,0);
+ 		CRectList rects;
+ 		CGuiAnnotator::GetRectList(list,rects);
+ 		CRectList dummyObjList;
+ 		CGMEDataDescriptor desc(dummyObjList,rects,pt,pt);
+ 		GetDocument()->CopySmartToClipboard(&dummyList,&list,&desc,this);
+ 		contextAnnotation = 0;
+ 	}
+ }
+ 
  
  void CGMEView::OnCntxCut()
***************
*** 4744,4750 ****
--- 4803,4820 ----
  }
  
+ void CGMEView::OnSelfcntxCopySmart()
+ {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::OnSelfcntxCopySmart in "+path+name+"\r\n");
+ 	OnEditCopySmart();
+ }
+ 
  void CGMEView::OnUpdateSelfcntxCopyClosure(CCmdUI* pCmdUI)
  {
  	OnUpdateEditCopyClosure(pCmdUI);
+ }
+ 
+ void CGMEView::OnUpdateSelfcntxCopySmart(CCmdUI* pCmdUI)
+ {
+ 	OnUpdateEditCopySmart(pCmdUI);
  }
  

Index: GMEView.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** GMEView.h	2 Jun 2004 22:32:38 -0000	1.61
--- GMEView.h	27 Sep 2004 22:01:39 -0000	1.62
***************
*** 293,297 ****
--- 293,299 ----
  	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  	afx_msg void OnEditCopyClosure();
+ 	afx_msg void OnEditCopySmart();
  	afx_msg void OnUpdateEditCopyClosure(CCmdUI* pCmdUI);
+ 	afx_msg void OnUpdateEditCopySmart(CCmdUI* pCmdUI);
  	afx_msg void OnEditCut();
  	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
***************
*** 300,303 ****
--- 302,306 ----
  	afx_msg void OnCntxCopy();
  	afx_msg void OnCntxCopyClosure();
+ 	afx_msg void OnCntxCopySmart();
  	afx_msg void OnCntxCut();
  	afx_msg void OnCntxDelete();
***************
*** 305,309 ****
--- 308,314 ----
  	afx_msg void OnUpdateSelfcntxCopy(CCmdUI* pCmdUI);
  	afx_msg void OnSelfcntxCopyClosure();
+ 	afx_msg void OnSelfcntxCopySmart();
  	afx_msg void OnUpdateSelfcntxCopyClosure(CCmdUI* pCmdUI);
+ 	afx_msg void OnUpdateSelfcntxCopySmart(CCmdUI* pCmdUI);
  	afx_msg void OnSelfcntxCut();
  	afx_msg void OnUpdateSelfcntxCut(CCmdUI* pCmdUI);

Index: resource.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/resource.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** resource.h	14 Sep 2004 14:04:39 -0000	1.59
--- resource.h	27 Sep 2004 22:01:39 -0000	1.60
***************
*** 331,334 ****
--- 331,337 ----
  #define ID_EDIT_COPYCLOSURE             32962
  #define ID_VIEW_CONSOLE                 32963
+ #define ID_CNTX_COPYSMART               32965
+ #define ID_SELFCNTX_COPYSMART           32966
+ #define ID_EDIT_COPYSMART               32967
  #define IDC_BTNSELECT                   33000
  #define IDC_BTNDESELECT                 33001
***************
*** 350,354 ****
  #define _APS_3D_CONTROLS                     1
  #define _APS_NEXT_RESOURCE_VALUE        211
! #define _APS_NEXT_COMMAND_VALUE         32965
  #define _APS_NEXT_CONTROL_VALUE         1107
  #define _APS_NEXT_SYMED_VALUE           115
--- 353,357 ----
  #define _APS_3D_CONTROLS                     1
  #define _APS_NEXT_RESOURCE_VALUE        211
! #define _APS_NEXT_COMMAND_VALUE         32968
  #define _APS_NEXT_CONTROL_VALUE         1107
  #define _APS_NEXT_SYMED_VALUE           115



More information about the GME-commit mailing list