[GME-commit] GMESRC/GME/Gme GMEView.h, 1.75, 1.76 GMEView.cpp, 1.189, 1.190 GMEDoc.h, 1.16, 1.17 GMEDoc.cpp, 1.36, 1.37

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Tue Mar 13 08:55:08 CST 2007


Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv18455

Modified Files:
	GMEView.h GMEView.cpp GMEDoc.h GMEDoc.cpp 
Log Message:
1.CLOSEMODEL events were not sent in case of the new buttons.

2.Crashed in OnActivateView if add-ons popped up some messageboxes.
Now OnActivateView calls tellHistorian method with providing the object id, thus transactions are not opened for historian's sake. Each GMEView stores its own object id, corresponding to currentModel.




CVS User: Zoltan Molnar, ISIS (zolmol)

Index: GMEView.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -C2 -d -r1.189 -r1.190
*** GMEView.cpp	7 Mar 2007 22:41:26 -0000	1.189
--- GMEView.cpp	13 Mar 2007 14:55:05 -0000	1.190
***************
*** 499,502 ****
--- 499,505 ----
  CGMEView::~CGMEView()
  {
+ 	// a good idea to release ptrs
+ 	baseType.Release();parent.Release();currentModel.Release();
+ 
  	if(--instanceCount <= 0) {
  		// update & disable some components
***************
*** 868,871 ****
--- 871,879 ----
  			CopyTo(bstr,kindDisplayedName);
  		}
+ 
+ 		CComBSTR modid;
+ 		COMTHROW( currentModel->get_ID( &modid));
+ 		currentModId = modid;
+ 
  		metaref_type mt;
  		COMTHROW(meta->get_MetaRef(&mt));
***************
*** 5385,5389 ****
  		if( theApp.isHistoryEnabled())
  		{
! 			GetDocument()->tellHistorian( currentModel, currentAspect?currentAspect->name:"");
  		}
  
--- 5393,5397 ----
  		if( theApp.isHistoryEnabled())
  		{
! 			GetDocument()->tellHistorian( currentModId, currentAspect?currentAspect->name:"");
  		}
  

Index: GMEView.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** GMEView.h	7 Mar 2007 22:41:26 -0000	1.75
--- GMEView.h	13 Mar 2007 14:55:05 -0000	1.76
***************
*** 93,96 ****
--- 93,97 ----
  	CComPtr<IMgaTerritory> terry;
  	CComPtr<IMgaModel> currentModel;
+ 	CComBSTR           currentModId;
  	CComPtr<IMgaFCO> baseType;			// currentModel's baseType (or type in case of an instance)
  	CComPtr<IMgaModel> parent;

Index: GMEDoc.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** GMEDoc.cpp	7 Mar 2007 22:41:26 -0000	1.36
--- GMEDoc.cpp	13 Mar 2007 14:55:05 -0000	1.37
***************
*** 659,663 ****
  			SetNextToView(model,"", fco);
  		}
! 
  		CMainFrame::theInstance->CreateNewView(view);
  		// PETER: This is needed to get the focus (SetFocus does not work, since it uses SendMessage())
--- 659,663 ----
  			SetNextToView(model,"", fco);
  		}
! 		
  		CMainFrame::theInstance->CreateNewView(view);
  		// PETER: This is needed to get the focus (SetFocus does not work, since it uses SendMessage())
***************
*** 1028,1032 ****
  	if( !v) return;
  	v->alive = false;
! 	v->frame->sendEvent = false;
  	v->frame->PostMessage(WM_CLOSE);
  }
--- 1028,1032 ----
  	if( !v) return;
  	v->alive = false;
! 	v->frame->sendEvent = true;
  	v->frame->PostMessage(WM_CLOSE);
  }
***************
*** 1038,1043 ****
  		CGMEView* v = (CGMEView *) GetNextView( pos);
  		v->alive = false;
! 		v->frame->sendEvent = false;
! 		v->frame->PostMessage(WM_CLOSE);
  	}
  }
--- 1038,1043 ----
  		CGMEView* v = (CGMEView *) GetNextView( pos);
  		v->alive = false;
! 		v->frame->sendEvent = true;
! 		v->frame->SendMessage(WM_CLOSE);
  	}
  }
***************
*** 1053,1058 ****
  		{
  			v->alive = false;
! 			v->frame->sendEvent = false;
! 			v->frame->PostMessage(WM_CLOSE);
  		}
  	}
--- 1053,1058 ----
  		{
  			v->alive = false;
! 			v->frame->sendEvent = true;
! 			v->frame->SendMessage(WM_CLOSE);
  		}
  	}
***************
*** 1097,1100 ****
--- 1097,1113 ----
  }
  
+ void CGMEDoc::tellHistorian( CComBSTR& modid, CString asp)
+ {
+ 	if( !theApp.isHistoryEnabled()) return;
+ 	if( theApp.multipleView) return; // do not bother with history in this scenario
+ 	if( !modid || modid.Length() == 0) return;
+ 
+ 	CGMEEventLogger::LogGMEEvent("CGMEDoc::tellHistorian(str,asp)\r\n");
+ 
+ 	Historian::HistoryElem e( (LPCTSTR) PutInCString( modid), (LPCTSTR) asp);
+ 	m_historian.erasePrevOccurencesB( e);
+ 	m_historian.pushB( e);
+ }
+ 
  void CGMEDoc::tellHistorian( CComPtr<IMgaModel>& model, CString asp)
  { 
***************
*** 1102,1105 ****
--- 1115,1120 ----
  	if( theApp.multipleView) return; // do not bother with history in this scenario
  	if( !model)              return;
+ 
+ 	CGMEEventLogger::LogGMEEvent("CGMEDoc::tellHistorian(ptr,asp)\r\n");
  
  	try	{

Index: GMEDoc.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEDoc.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** GMEDoc.h	7 Mar 2007 22:41:26 -0000	1.16
--- GMEDoc.h	13 Mar 2007 14:55:05 -0000	1.17
***************
*** 166,169 ****
--- 166,170 ----
  	void clearTotalHistory();
  	void clearForwHistory();
+ 	void tellHistorian( CComBSTR&           modid, CString asp);
  	void tellHistorian( CComPtr<IMgaModel>& model, CString asp);
  	void presentModel( LPCTSTR objectID, LPCTSTR aspectNM);



More information about the GME-commit mailing list