[GME-commit] GMESRC/GME/Gme ScrollZoomView.cpp,1.14,1.15 ModelPropertiesDlgBar.cpp,1.6,1.7 MainFrm.h,1.17,1.18 MainFrm.cpp,1.23,1.24

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Jun 14 16:32:55 CDT 2004


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

Modified Files:
	ScrollZoomView.cpp ModelPropertiesDlgBar.cpp MainFrm.h 
	MainFrm.cpp 
Log Message:
jump to the violating object from CM violations dialog

CVS User: bogyom

Index: ScrollZoomView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/ScrollZoomView.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ScrollZoomView.cpp	3 Jun 2004 19:14:48 -0000	1.14
--- ScrollZoomView.cpp	14 Jun 2004 20:32:46 -0000	1.15
***************
*** 443,448 ****
  	int yOrig = GetScrollPos(SB_VERT);
  	SetScrollPos(SB_VERT, ptDev.y);
! 	ptDev.x = min(maxh, ptDev.x);
! 	ptDev.y = min(maxv, ptDev.y);
  	TRACE("notifyPanning from ScrollToDevicePosition\n");
  	notifyPanning(ptDev);
--- 443,448 ----
  	int yOrig = GetScrollPos(SB_VERT);
  	SetScrollPos(SB_VERT, ptDev.y);
! 	ptDev.x = (maxh<ptDev.x)? maxh: ptDev.x; 
! 	ptDev.y = (maxv<ptDev.y)? maxv: ptDev.y;
  	TRACE("notifyPanning from ScrollToDevicePosition\n");
  	notifyPanning(ptDev);
***************
*** 963,967 ****
  		{
  			nDisplacement = nToScroll * m_lineDev.cy;
! 			nDisplacement = min(nDisplacement, m_pageDev.cy);
  		}
  		bResult = OnScrollBy(CSize(0, nDisplacement), TRUE);
--- 963,967 ----
  		{
  			nDisplacement = nToScroll * m_lineDev.cy;
! 			nDisplacement = (nDisplacement<m_pageDev.cy)? nDisplacement: m_pageDev.cy;
  		}
  		bResult = OnScrollBy(CSize(0, nDisplacement), TRUE);
***************
*** 979,983 ****
  		{
  			nDisplacement = nToScroll * m_lineDev.cx;
! 			nDisplacement = min(nDisplacement, m_pageDev.cx);
  		}
  		bResult = OnScrollBy(CSize(nDisplacement, 0), TRUE);
--- 979,983 ----
  		{
  			nDisplacement = nToScroll * m_lineDev.cx;
! 			nDisplacement = (nDisplacement<m_pageDev.cx)? nDisplacement: m_pageDev.cx;
  		}
  		bResult = OnScrollBy(CSize(nDisplacement, 0), TRUE);

Index: ModelPropertiesDlgBar.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/ModelPropertiesDlgBar.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ModelPropertiesDlgBar.cpp	18 May 2004 20:08:09 -0000	1.6
--- ModelPropertiesDlgBar.cpp	14 Jun 2004 20:32:46 -0000	1.7
***************
*** 75,79 ****
  	{
  		char buff[100];
! 		int len = edit->GetLine(0, buff, sizeof(buff)-1);
  		int kk = atoi(buff);
  		kk = abs(kk);
--- 75,79 ----
  	{
  		char buff[100];
! 		edit->GetLine(0, buff, sizeof(buff)-1);
  		int kk = atoi(buff);
  		kk = abs(kk);
***************
*** 160,164 ****
  		return;
  	char buff[100];
! 	int len = edit->GetLine(0, buff, sizeof(buff)-1);
  	kk = atoi(buff);
  	if (!kk)
--- 160,164 ----
  		return;
  	char buff[100];
! 	edit->GetLine(0, buff, sizeof(buff)-1);
  	kk = atoi(buff);
  	if (!kk)
***************
*** 182,186 ****
  		return;
  	char buff[100];
! 	int len = edit->GetLine(0, buff, sizeof(buff)-1);
  	kk = atoi(buff);
  	if (!kk)
--- 182,186 ----
  		return;
  	char buff[100];
! 	edit->GetLine(0, buff, sizeof(buff)-1);
  	kk = atoi(buff);
  	if (!kk)

Index: MainFrm.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/MainFrm.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** MainFrm.h	7 May 2004 20:58:25 -0000	1.17
--- MainFrm.h	14 Jun 2004 20:32:46 -0000	1.18
***************
*** 15,18 ****
--- 15,21 ----
  #include "GMESearch.h"
  #include "PanningWindow.h"
+ #include "..\include\stl\string"
+ //#include <string>
+ 
  
  // Tooltip helper for components
***************
*** 113,116 ****
--- 116,122 ----
  private:
  	BOOL InitStatusBar(UINT *pIndicators, int nSize, int nSeconds);
+ //	IMgaObject*	modelFindByPath(IMgaModel *model,  const wstring& strPath);
+ //	IMgaObject*	folderFindByPath(IMgaFolder* folder, const wstring& strPath);
+ 
  };
  

Index: MainFrm.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/MainFrm.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** MainFrm.cpp	17 May 2004 17:50:33 -0000	1.23
--- MainFrm.cpp	14 Jun 2004 20:32:46 -0000	1.24
***************
*** 16,20 ****
  #endif
  
- 
  /////////////////////////////////////////////////////////////////////////////
  // Tooltip helper for components
--- 16,19 ----
***************
*** 97,100 ****
--- 96,100 ----
  }
  
+ 
  int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  {
***************
*** 102,108 ****
  		return -1;
  
- 	
- 	
- 
  	// TOOLBAR and STATUSBAR
  	
--- 102,105 ----
***************
*** 343,348 ****
  	sprintf(txt,"%d%%",zoomPct);
  	WriteStatusText(zoomPaneNo,txt);
- 
- //	m_wndDlgBar.SetDlgItemText(IDC_ZOOMBOX, txt);
  }
  
--- 340,343 ----
***************
*** 550,552 ****
--- 545,716 ----
  	StopAutosaveTimer();
  }
+ 
+ 
+ /*
+ IMgaObject*	CMainFrame::folderFindByPath(IMgaFolder* folder, const wstring& strPath)
+ {
+ 	wstring strPath2;
+ 	wstring strName;
+ 	wstring::size_type iPos = strPath.find( L"/" );
+ 	if ( iPos == wstring::npos ) 
+ 	{
+ 		strName = strPath;
+ 		strPath2 = L"";
+ 	}
+ 	else {
+ 		if ( iPos == 0 )
+ 			strPath2 = strPath.substr( iPos + 1);
+ 		iPos = strPath2.find( L"/" );
+ 		if ( iPos == wstring::npos ) 
+ 		{
+ 			strName = strPath2;
+ 			strPath2 = L"";
+ *		}
+ 		else 
+ 		{
+ 			strName = strPath2.substr( 0, iPos );
+ 			strPath2 = strPath2.substr( iPos );
+ 		}
+ 	}
+ 	COMTRY {
+ 		CComPtr<IMgaFolder> root;
+ 		if (!folder)
+ 		{
+ 			COMTHROW(theApp.mgaProject->get_RootFolder(&root));
+ 			if (!root)
+ 				return NULL;
+ 			CComBSTR strname;
+ 			COMTHROW(root->get_Name(&strname));
+ 			if ( strName == (wstring)(WCHAR*)(BSTR)strname) 
+ 			{
+ 				if ( strPath2.empty() )
+ 				{
+ 					CComPtr<IMgaObject> obj;
+ 					root.QueryInterface(&obj);
+ 					return obj.Detach();
+ 				}
+ 				else 
+ 				{
+ 					IMgaObject* o = folderFindByPath(root,  strPath2);
+ 					if (o)
+ 						return o;
+ 				}
+ 			}
+ 			return NULL;
+ 		}
+ 
+ 		CComPtr<IMgaObjects> iobjects;
+ 		COMTHROW(folder->get_ChildObjects(&iobjects));
+ 		CComPtr<IMgaObject> item;
+ 		long count = 0;
+ 		COMTHROW(iobjects->get_Count(&count));
+ 		for (int i=1; i<=count; i++)
+ 		{
+ 			COMTHROW(iobjects->get_Item(i, &item));
+ 			CComBSTR strname;
+ 			COMTHROW(item->get_Name(&strname));
+ 			if ( strName == (wstring)(WCHAR*)(BSTR)strname) 
+ 			{
+ 				if ( strPath2.empty() )
+ 					return item.Detach();
+ 				else 
+ 				{
+ 					CComPtr<IMgaModel> model;
+ 					CComPtr<IMgaFolder> folder;
+ 					item.QueryInterface(&model);
+ 					item.QueryInterface(&folder);
+ 					if ( model) 
+ 					{
+ 						IMgaObject *o = modelFindByPath(model,  strPath2);
+ 						if (o)
+ 							return o;
+ 					}
+ 					if ( folder) 
+ 					{
+ 						IMgaObject* o = folderFindByPath(folder,  strPath2);
+ 						if (o)
+ 							return o;
+ 					}
+ 				}
+ 			}
+ 			item.Release();
+ 		}
+ 	} 
+ 	catch(hresult_exception &e) 
+ 	{ 
+ 		// SetErrorInfo(e.hr); 
+ 		return NULL; 
+ 	} 
+ 
+ 	return NULL;
+ }
+ 
+ 
+ IMgaObject*	CMainFrame::modelFindByPath(IMgaModel *model,  const wstring& strPath)
+ {
+ 	wstring strPath2;
+ 	wstring strName;
+ 	wstring::size_type iPos = strPath.find( L"/" );
+ 	if ( iPos == wstring::npos ) 
+ 	{
+ 		strName = strPath;
+ 		strPath2 = L"";
+ 	}
+ 	else 
+ 	{
+ 		if ( iPos == 0 )
+ 			strPath2 = strPath.substr( iPos + 1);
+ 		iPos = strPath2.find( L"/" );
+ 		if ( iPos == wstring::npos ) 
+ 		{
+ 			strName = strPath2;
+ 			strPath2 = L"";
+ 		}
+ 		else 
+ 		{
+ 			strName = strPath2.substr( 0, iPos );
+ 			strPath2 = strPath2.substr( iPos );
+ 		}
+ 	}
+ 
+ 	COMTRY {
+ 		CComPtr<IMgaFCOs> fcos;
+ 		COMTHROW(model->get_ChildFCOs(&fcos));
+ 		CComPtr<IMgaFCO> item;
+ 		long count = 0;
+ 		COMTHROW(fcos->get_Count(&count));
+ 		for (int i=1; i<=count; i++)
+ 		{
+ 			COMTHROW(fcos->get_Item(i, &item));
+ 			CComBSTR strname;
+ 			COMTHROW(item->get_Name(&strname));
+ 			if ( strName == (wstring)(WCHAR*)(BSTR)strname) 
+ 			{
+ 				if ( strPath2.empty() )
+ 					return item.Detach();
+ 				else 
+ 				{
+ 					CComPtr<IMgaModel> model;
+ 					item.QueryInterface(&model);
+ 					if (model )
+ 					{
+ 						IMgaObject* o = modelFindByPath(model,  strPath2);
+ 						if (o)
+ 							return o;
+ 					}
+ 
+ 				}
+ 			}
+ 			item.Release();
+ 		}
+ 	} 
+ 	catch(hresult_exception &e) 
+ 	{ 
+ 		// SetErrorInfo(e.hr); 
+ 		return NULL; 
+ 	} 
+ 
+ 	return NULL;
+ }
+ */
  



More information about the GME-commit mailing list