[GME-commit] GMESRC/GME/MgaUtil GmeDlg.cpp, 1.14, 1.15 GmeDlg.h, 1.12, 1.13 MgaRegistrar.cpp, 1.46, 1.47 MgaRegistrar.h, 1.23, 1.24 MgaUtil.rc, 1.56, 1.57 resource.h, 1.36, 1.37

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Mar 7 15:11:59 CST 2007


Update of /project/gme-repository/GMESRC/GME/MgaUtil
In directory escher:/tmp/cvs-serv23229

Modified Files:
	GmeDlg.cpp GmeDlg.h MgaRegistrar.cpp MgaRegistrar.h MgaUtil.rc 
	resource.h 
Log Message:
Undosize, Navigation preference in Settings dialog and in MgaRegistrar.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaUtil.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/MgaUtil.rc,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** MgaUtil.rc	1 Nov 2006 17:48:42 -0000	1.56
--- MgaUtil.rc	7 Mar 2007 21:11:57 -0000	1.57
***************
*** 72,75 ****
--- 72,76 ----
  BEGIN
      DEFPUSHBUTTON   "OK",IDOK,48,386,50,15
+     PUSHBUTTON      "Cancel",IDCANCEL,139,386,50,15
      EDITTEXT        IDC_ICONPATH,10,15,190,15,ES_AUTOHSCROLL
      PUSHBUTTON      "Add...",IDC_ADDICONPATH,205,15,30,15
***************
*** 100,103 ****
--- 101,108 ----
      COMBOBOX        IDC_CMBFMTSTRS,87,342,50,52,CBS_DROPDOWN | WS_VSCROLL | 
                      WS_TABSTOP
+     COMBOBOX        IDC_UNDOSIZE,203,329,27,272,CBS_DROPDOWN | WS_VSCROLL | 
+                     WS_TABSTOP
+     CONTROL         "Navigation History",IDC_NAVIGATIONHISTORY,"Button",
+                     BS_AUTOCHECKBOX | WS_TABSTOP,143,344,73,8
      CONTROL         "Open model in multiple views",IDC_MULTIPLE_OPEN,"Button",
                      BS_AUTOCHECKBOX | WS_TABSTOP,15,358,107,10
***************
*** 106,110 ****
      CONTROL         "Enable Event Logging",IDC_EVENT_LOGGING,"Button",
                      BS_AUTOCHECKBOX | WS_TABSTOP,143,358,86,10
!     PUSHBUTTON      "Cancel",IDCANCEL,139,386,50,15
      GROUPBOX        "User Icon Path",IDC_STATIC,5,5,235,30
      GROUPBOX        "System Icon Path",IDC_STATIC,5,40,235,30
--- 111,116 ----
      CONTROL         "Enable Event Logging",IDC_EVENT_LOGGING,"Button",
                      BS_AUTOCHECKBOX | WS_TABSTOP,143,358,86,10
!     CONTROL         "Console Timestamping",IDC_TIMESTAMPING,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,143,369,87,10
      GROUPBOX        "User Icon Path",IDC_STATIC,5,5,235,30
      GROUPBOX        "System Icon Path",IDC_STATIC,5,40,235,30
***************
*** 114,124 ****
      LTEXT           "seconds",IDC_STATIC,200,136,28,8
      GROUPBOX        "Autorouter",IDC_STATIC,5,200,235,25
!     GROUPBOX        "Scripting",IDC_STATIC,6,230,235,90
      LTEXT           "Current script engine:",IDC_STATIC,11,241,72,11
!     LTEXT           "Default zoom value:",IDC_STATIC,12,329,66,9
      GROUPBOX        "Misc",IDC_STATIC,7,321,233,59
!     LTEXT           "Double attribute format:",IDC_STATIC,12,343,75,8
!     CONTROL         "Console Timestamping",IDC_TIMESTAMPING,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,143,369,87,10
  END
  
--- 120,129 ----
      LTEXT           "seconds",IDC_STATIC,200,136,28,8
      GROUPBOX        "Autorouter",IDC_STATIC,5,200,235,25
!     GROUPBOX        "Scripting",IDC_STATIC,6,230,234,90
      LTEXT           "Current script engine:",IDC_STATIC,11,241,72,11
!     LTEXT           "Default zoom value:",IDC_STATIC,12,331,66,9
      GROUPBOX        "Misc",IDC_STATIC,7,321,233,59
!     LTEXT           "Double attribute format:",IDC_STATIC,12,344,75,8
!     LTEXT           "Undo queue size:",IDC_STATIC,145,331,57,9
  END
  

Index: GmeDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/GmeDlg.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** GmeDlg.cpp	12 Jan 2006 22:43:54 -0000	1.14
--- GmeDlg.cpp	7 Mar 2007 21:11:57 -0000	1.15
***************
*** 50,53 ****
--- 50,54 ----
  	m_sendOverObj = FALSE;
  	m_timeStamps = FALSE;
+ 	m_navigationHistory = FALSE;
  	//}}AFX_DATA_INIT
  	m_scriptEngine = _T("JScript");
***************
*** 73,76 ****
--- 74,78 ----
  	DDX_Check(pDX, IDC_SENDOVEROBJECT, m_sendOverObj);
  	DDX_Check(pDX, IDC_TIMESTAMPING, m_timeStamps);
+ 	DDX_Check(pDX, IDC_NAVIGATIONHISTORY, m_navigationHistory);
  	//}}AFX_DATA_MAP
  }
***************
*** 330,333 ****
--- 332,343 ----
  		COMTHROW( registrar->GetTimeStamping( REGACCESS_USER, &console_timestamps));
  		m_timeStamps = ( console_timestamps == VARIANT_FALSE) ? FALSE : TRUE;
+ 
+ 		// History maintained
+ 		VARIANT_BOOL history_maintained;
+ 		COMTHROW( registrar->GetNavigation( REGACCESS_USER, &history_maintained));
+ 		m_navigationHistory = ( history_maintained == VARIANT_FALSE) ? FALSE : TRUE;
+ 
+ 		// Undo queue size
+ 		fillUndoComboBox();
  	}
  	MSGCATCH("Error while initializing GmeDlg",;)
***************
*** 406,409 ****
--- 416,427 ----
  	VARIANT_BOOL console_timestamping = ( m_timeStamps == FALSE) ? VARIANT_FALSE : VARIANT_TRUE;
  	COMTHROW( registrar->SetTimeStamping( REGACCESS_USER, console_timestamping) );
+ 
+ 	// History maintained
+ 	VARIANT_BOOL enable_navigation = ( m_navigationHistory == FALSE) ? VARIANT_FALSE : VARIANT_TRUE;
+ 	COMTHROW( registrar->SetNavigation( REGACCESS_USER, enable_navigation) );
+ 
+ 	// Undo queue size
+ 	CString undo_queue_size = getUndoQueueSizeValue();
+ 	COMTHROW( registrar->SetUndoQueueSize( REGACCESS_USER, PutInBstr( undo_queue_size)) );
  }
  
***************
*** 491,494 ****
--- 509,558 ----
  	UpdateData(TRUE);
  	ExtControlManager();
+ }
+ 
+ CString CGmeDlg::getUndoQueueSizeValue()
+ {
+ 	CString res( "10");
+ 	CWnd* combo = 0;
+ 	combo = GetDlgItem(IDC_UNDOSIZE);
+ 	if( combo)
+ 	{
+ 		CEdit* edit = 0;
+ 		edit = (CEdit*)( combo->GetDlgItem(1001));
+ 		if( edit)
+ 		{
+ 			char buff[100];
+ 			edit->GetLine(0, buff, sizeof(buff)-1);
+ 			int value = atoi( buff);
+ 			if( value > 0 && value < 100) // above 0 and below 100
+ 				res = buff;
+ 		}
+ 	}
+ 	return res;
+ }
+ 
+ CString CGmeDlg::getUndoQueueSizeFromReg()
+ {
+ 	CString queuesize;
+ 	COMTHROW( registrar->GetUndoQueueSize( REGACCESS_USER, PutOut( queuesize)) );
+ 	if( queuesize.IsEmpty())
+ 		queuesize = "10";
+ 
+ 	return queuesize;
+ }
+ 
+ void CGmeDlg::fillUndoComboBox()
+ {
+ 	CComboBox* sz_list = 0;
+ 	sz_list = (CComboBox*)GetDlgItem(IDC_UNDOSIZE);
+ 	sz_list->AddString("1");
+ 	sz_list->AddString("10");
+ 
+ 	CString regv = getUndoQueueSizeFromReg();
+ 	int pos = sz_list->FindStringExact( -1, regv);
+ 	if( pos == CB_ERR)
+ 		sz_list->InsertString( -1, regv);
+ 	sz_list->SelectString( -1, regv);
+ 
  }
  

Index: MgaRegistrar.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/MgaRegistrar.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** MgaRegistrar.cpp	9 Oct 2006 16:39:17 -0000	1.46
--- MgaRegistrar.cpp	7 Mar 2007 21:11:57 -0000	1.47
***************
*** 805,808 ****
--- 805,907 ----
  }
  
+ STDMETHODIMP CMgaRegistrar::GetNavigation(regaccessmode_enum p_mode, VARIANT_BOOL *p_enabled)
+ {
+ 	COMTRY
+ 	{
+ 		LONG res;
+ 		CString str;
+ 		if(p_mode & RM_USER) {
+ 			CRegKey mga;
+ 			res = mga.Open(HKEY_CURRENT_USER, rootreg, KEY_READ);
+ 			if(res != ERROR_SUCCESS && res != ERROR_ACCESS_DENIED && res != ERROR_FILE_NOT_FOUND) ERRTHROW(res);
+ 			if(res == ERROR_SUCCESS) {
+ 				str	= QueryValue(mga, "Navigation");
+ 				if(!str.IsEmpty()) {
+ 					REVOKE_SYS2(p_mode);
+ 				}
+ 			}
+ 		}
+ 		if(p_mode & (RM_SYSDOREAD)) {
+ 			CRegKey mga;
+ 			res = mga.Open(HKEY_LOCAL_MACHINE, rootreg, KEY_READ);
+ 			if(res != ERROR_SUCCESS && res != ERROR_ACCESS_DENIED && res != ERROR_FILE_NOT_FOUND) ERRTHROW(res);
+ 			if(res == ERROR_SUCCESS) {
+ 				str = QueryValue(mga, "Navigation");
+ 			}
+ 		}
+ 		*p_enabled = (str == "0") ? VARIANT_FALSE : VARIANT_TRUE; // Default value: true
+ 	}
+ 	COMCATCH(;)
+ }
+ 
+ STDMETHODIMP CMgaRegistrar::SetNavigation(regaccessmode_enum p_mode, VARIANT_BOOL p_enabled)
+ {
+ 	COMTRY
+ 	{
+ 		CString str = (p_enabled == VARIANT_FALSE) ? "0" : "1";
+ 		if(p_mode & RM_USER) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_CURRENT_USER, rootreg) );
+ 			ERRTHROW( mga.SetStringValue( "Navigation", str));
+ 		}
+ 		if(p_mode & (RM_SYS | RM_TEST)) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_LOCAL_MACHINE, rootreg) );
+ 			if(p_mode & RM_SYS) ERRTHROW( mga.SetStringValue( "Navigation", str));
+ 		}
+ 	}
+ 	COMCATCH(;)
+ }
+ 
+ STDMETHODIMP CMgaRegistrar::GetUndoQueueSize(regaccessmode_enum p_mode, BSTR *p_qusz)
+ {
+ 	CHECK_OUT(p_qusz);
+ 	COMTRY
+ 	{
+ 		LONG res;
+ 		CString str;
+ 		if(p_mode & RM_USER) {
+ 			CRegKey mga;
+ 			res = mga.Open(HKEY_CURRENT_USER, rootreg, KEY_READ);
+ 			if(res != ERROR_SUCCESS && res != ERROR_ACCESS_DENIED && res != ERROR_FILE_NOT_FOUND) ERRTHROW(res);
+ 			if(res == ERROR_SUCCESS) {
+ 				str	= QueryValue(mga, "UndoQueueSize");
+ 				if(!str.IsEmpty()) REVOKE_SYS2(p_mode);
+ 			}
+ 		}
+ 		if(p_mode & (RM_SYSDOREAD)) {
+ 			CRegKey mga;
+ 			res = mga.Open(HKEY_LOCAL_MACHINE, rootreg, KEY_READ);
+ 			if(res != ERROR_SUCCESS && res != ERROR_ACCESS_DENIED && res != ERROR_FILE_NOT_FOUND) ERRTHROW(res);
+ 			if(res == ERROR_SUCCESS) {
+ 				str = QueryValue(mga, "UndoQueueSize");
+ 			}
+ 		}
+ 		CopyTo(str, p_qusz);
+ 	}
+ 	COMCATCH(;)
+ 
+ }
+ 
+ STDMETHODIMP CMgaRegistrar::SetUndoQueueSize(regaccessmode_enum p_mode, BSTR p_qusz)
+ {
+ 	COMTRY
+ 	{
+ 		CString str;
+ 		CopyTo(p_qusz, str);
+ 		if(p_mode & RM_USER) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_CURRENT_USER, rootreg) );
+ 			ERRTHROW( mga.SetStringValue( "UndoQueueSize", str));
+ 		}
+ 		if(p_mode & (RM_SYS | RM_TEST)) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_LOCAL_MACHINE, rootreg) );
+ 			if(p_mode & RM_SYS) ERRTHROW( mga.SetStringValue( "UndoQueueSize", str));
+ 		}
+ 	}
+ 	COMCATCH(;)
+ }
+ 
  STDMETHODIMP CMgaRegistrar::get_Paradigms(regaccessmode_enum mode, VARIANT *names)
  {

Index: MgaRegistrar.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/MgaRegistrar.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** MgaRegistrar.h	14 Mar 2006 20:10:04 -0000	1.23
--- MgaRegistrar.h	7 Mar 2007 21:11:57 -0000	1.24
***************
*** 79,82 ****
--- 79,86 ----
  	STDMETHOD(GetTimeStamping)(regaccessmode_enum mode, VARIANT_BOOL *enabled);
  	STDMETHOD(SetTimeStamping)(regaccessmode_enum mode, VARIANT_BOOL enabled);
+ 	STDMETHOD(GetNavigation)(regaccessmode_enum mode, VARIANT_BOOL *enabled);
+ 	STDMETHOD(SetNavigation)(regaccessmode_enum mode, VARIANT_BOOL enabled);
+ 	STDMETHOD(GetUndoQueueSize)(regaccessmode_enum mode, BSTR *queuesz);
+ 	STDMETHOD(SetUndoQueueSize)(regaccessmode_enum mode, BSTR queuesz);
  
  	STDMETHOD(get_Paradigms)(regaccessmode_enum mode, VARIANT *names);

Index: resource.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/resource.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** resource.h	1 Nov 2006 17:45:28 -0000	1.36
--- resource.h	7 Mar 2007 21:11:57 -0000	1.37
***************
*** 8,11 ****
--- 8,12 ----
  #define IDD_REGISTRY_BROWSER            169
  #define IDC_ZOOMS                       1008
+ #define IDC_UNDOSIZE                    1009
  #define IDC_OBJECTID                    1016
  #define IDC_LIBRARY                     1017
***************
*** 215,218 ****
--- 216,220 ----
  #define IDC_CHECKMARK                   2278
  #define IDC_EDITMARK                    2279
+ #define IDC_NAVIGATIONHISTORY           2280
  #define ID_CNTX_ADDNODE                 32774
  #define ID_CNTX_CLEARNODE               32775
***************
*** 227,231 ****
  #define _APS_NEXT_RESOURCE_VALUE        2072
  #define _APS_NEXT_COMMAND_VALUE         32779
! #define _APS_NEXT_CONTROL_VALUE         2280
  #define _APS_NEXT_SYMED_VALUE           2091
  #endif
--- 229,233 ----
  #define _APS_NEXT_RESOURCE_VALUE        2072
  #define _APS_NEXT_COMMAND_VALUE         32779
! #define _APS_NEXT_CONTROL_VALUE         2281
  #define _APS_NEXT_SYMED_VALUE           2091
  #endif

Index: GmeDlg.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/GmeDlg.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** GmeDlg.h	12 Jan 2006 22:43:54 -0000	1.12
--- GmeDlg.h	7 Mar 2007 21:11:57 -0000	1.13
***************
*** 46,49 ****
--- 46,50 ----
  	BOOL	m_sendOverObj;
  	BOOL	m_timeStamps;
+ 	BOOL	m_navigationHistory;
  	//}}AFX_DATA
  
***************
*** 96,100 ****
  	CString getFmtStrFromReg();
  	CString getFmtStrValue();
! 	
  	static const char * m_strFmtStrg;
  	static const char * m_strFmtStrf;
--- 97,105 ----
  	CString getFmtStrFromReg();
  	CString getFmtStrValue();
! 
! 	void fillUndoComboBox();
! 	CString getUndoQueueSizeFromReg();
! 	CString getUndoQueueSizeValue();
! 
  	static const char * m_strFmtStrg;
  	static const char * m_strFmtStrf;



More information about the GME-commit mailing list