[GME-commit] GMESRC/GME/MgaUtil GmeDlg.cpp,1.12,1.13 GmeDlg.h,1.10,1.11 MgaRegistrar.cpp,1.42,1.43 MgaRegistrar.h,1.19,1.20 MgaUtil.rc,1.50,1.51 resource.h,1.31,1.32

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Tue Nov 15 20:10:53 CST 2005


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

Modified Files:
	GmeDlg.cpp GmeDlg.h MgaRegistrar.cpp MgaRegistrar.h MgaUtil.rc 
	resource.h 
Log Message:
Options added:
SEND MOUSE OVER NOTIFICATION
DOUBLE ATTRIBUTE FORMAT


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaUtil.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/MgaUtil.rc,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** MgaUtil.rc	21 Jul 2005 16:56:44 -0000	1.50
--- MgaUtil.rc	15 Nov 2005 20:10:51 -0000	1.51
***************
*** 65,73 ****
  END
  
! IDD_GMEDLG DIALOGEX 0, 0, 247, 386
  STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  CAPTION "GME properties"
  FONT 8, "MS Sans Serif", 0, 0, 0x0
  BEGIN
      EDITTEXT        IDC_ICONPATH,10,15,190,15,ES_AUTOHSCROLL
      PUSHBUTTON      "Add...",IDC_ADDICONPATH,205,15,30,15
--- 65,74 ----
  END
  
! IDD_GMEDLG DIALOGEX 0, 0, 247, 406
  STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  CAPTION "GME properties"
  FONT 8, "MS Sans Serif", 0, 0, 0x0
  BEGIN
+     DEFPUSHBUTTON   "OK",IDOK,48,386,50,15
      EDITTEXT        IDC_ICONPATH,10,15,190,15,ES_AUTOHSCROLL
      PUSHBUTTON      "Add...",IDC_ADDICONPATH,205,15,30,15
***************
*** 94,103 ****
                      LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | 
                      WS_BORDER | WS_TABSTOP,84,240,152,74
      CONTROL         "Open model in multiple views",IDC_MULTIPLE_OPEN,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,10,351,107,10
      CONTROL         "Enable Event Logging",IDC_EVENT_LOGGING,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,125,351,86,10
!     DEFPUSHBUTTON   "OK",IDOK,48,370,50,15
!     PUSHBUTTON      "Cancel",IDCANCEL,139,370,50,15
      GROUPBOX        "User Icon Path",IDC_STATIC,5,5,235,30
      GROUPBOX        "System Icon Path",IDC_STATIC,5,40,235,30
--- 95,109 ----
                      LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | 
                      WS_BORDER | WS_TABSTOP,84,240,152,74
+     COMBOBOX        IDC_ZOOMS,87,329,50,272,CBS_DROPDOWN | WS_VSCROLL | 
+                     WS_TABSTOP
+     COMBOBOX        IDC_CMBFMTSTRS,87,342,50,52,CBS_DROPDOWN | WS_VSCROLL | 
+                     WS_TABSTOP
      CONTROL         "Open model in multiple views",IDC_MULTIPLE_OPEN,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,15,358,107,10
!     CONTROL         "Mouse Over Object Notify",IDC_SENDOVEROBJECT,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,15,369,97,10
      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
***************
*** 109,117 ****
      GROUPBOX        "Scripting",IDC_STATIC,6,230,235,90
      LTEXT           "Current script engine:",IDC_STATIC,11,241,72,11
!     COMBOBOX        IDC_ZOOMS,174,329,50,272,CBS_DROPDOWN | WS_VSCROLL | 
!                     WS_TABSTOP
!     LTEXT           "Use this Zooming value when opening models:",IDC_STATIC,
!                     12,332,152,9
!     GROUPBOX        "Zooming",IDC_STATIC,7,321,233,23
  END
  
--- 115,121 ----
      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
  END
  
***************
*** 708,712 ****
          RIGHTMARGIN, 240
          TOPMARGIN, 7
!         BOTTOMMARGIN, 385
      END
  
--- 712,716 ----
          RIGHTMARGIN, 240
          TOPMARGIN, 7
!         BOTTOMMARGIN, 405
      END
  

Index: GmeDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/GmeDlg.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** GmeDlg.cpp	9 Aug 2005 18:27:48 -0000	1.12
--- GmeDlg.cpp	15 Nov 2005 20:10:51 -0000	1.13
***************
*** 8,11 ****
--- 8,12 ----
  #include "DirDialog.h"
  #include "comcat.h"
+ #include ".\gmedlg.h"
  //#include "basetyps.h"
  const GUID CATID_ActiveScript = { 0xf0b7a1a1, 0x9847, 0x11cf, { 0x8f, 0x20, 0x0, 0x80, 0x5f, 0x2c, 0xd0, 0x64} };
***************
*** 21,24 ****
--- 22,32 ----
  /*static*/ const char * CGmeDlg::m_strZAll     = "Fit All";
  
+ /*static*/ const char * CGmeDlg::m_strFmtStrg  = "%g";
+ /*static*/ const char * CGmeDlg::m_strFmtStrf  = "%f";
+ /*static*/ const char * CGmeDlg::m_strFmtStrE  = "%E";
+ /*static*/ const char * CGmeDlg::m_strFmtStre  = "%e";
+ /*static*/ const char * CGmeDlg::m_strFmtStrg2  = "%.12g"; // the default one
+ /*static*/ const char * CGmeDlg::m_strFmtStrf2  = "%lf";
+ 
  /////////////////////////////////////////////////////////////////////////////
  // CGmeDlg dialog
***************
*** 40,43 ****
--- 48,52 ----
  	m_ext_editor = _T("");
  	m_labelavoidance = FALSE;
+ 	m_sendOverObj = FALSE;
  	//}}AFX_DATA_INIT
  	m_scriptEngine = _T("JScript");
***************
*** 61,64 ****
--- 70,74 ----
  	DDX_Text(pDX, IDC_EXT_EDITOR, m_ext_editor);
  	DDX_Check(pDX, IDC_LABELAVOIDANCE, m_labelavoidance);
+ 	DDX_Check(pDX, IDC_SENDOVEROBJECT, m_sendOverObj);
  	//}}AFX_DATA_MAP
  }
***************
*** 76,79 ****
--- 86,90 ----
  	ON_BN_CLICKED(IDC_EXT_ENABLE, OnExtEnable)
  	//}}AFX_MSG_MAP
+ 	ON_CBN_SELCHANGE(IDC_ZOOMS, OnCbnSelchangeZooms)
  END_MESSAGE_MAP()
  
***************
*** 304,307 ****
--- 315,326 ----
  		CString set_val = getZoomValueFromReg();
  		setZoomValue( set_val);
+ 
+ 		// Send OverObject Notification?
+ 		VARIANT_BOOL send_over_obj;
+ 		COMTHROW( registrar->GetMouseOverNotify(REGACCESS_USER, &send_over_obj) );
+ 		m_sendOverObj = (send_over_obj == VARIANT_FALSE) ? FALSE : TRUE;
+ 
+ 		// format string pref
+ 		fillFmtStrComboBox();
  	}
  	MSGCATCH("Error while initializing GmeDlg",;)
***************
*** 368,371 ****
--- 387,398 ----
  	CString val_sel = getZoomValue();
  	COMTHROW( registrar->SetDefZoomLevel( REGACCESS_USER, PutInBstr(val_sel)));
+ 
+ 	// Send Mouse Over Object Notification
+ 	VARIANT_BOOL send_over_obj = (m_sendOverObj == FALSE) ? VARIANT_FALSE : VARIANT_TRUE;
+ 	COMTHROW( registrar->SetMouseOverNotify(REGACCESS_USER, send_over_obj) );
+ 
+ 	// format string
+ 	CString fmt_sel = getFmtStrValue();
+ 	COMTHROW( registrar->SetRealNmbFmtStr(REGACCESS_USER, PutInBstr(fmt_sel)));
  }
  
***************
*** 599,601 ****
  		str = "100%";
  	return str;
! }
\ No newline at end of file
--- 626,684 ----
  		str = "100%";
  	return str;
! }
! void CGmeDlg::OnCbnSelchangeZooms()
! {
! 	// TODO: Add your control notification handler code here
! }
! 
! CString CGmeDlg::getFmtStrFromReg()
! {
! 	CString fmt_str;
! 	CComBSTR bs_fmt_str;
! 	COMTHROW( registrar->GetRealNmbFmtStr( REGACCESS_USER, &bs_fmt_str));
! 	if( bs_fmt_str) 
! 		CopyTo( bs_fmt_str, fmt_str);
! 
! 	if( fmt_str.IsEmpty())
! 		fmt_str = m_strFmtStrg2;
! 
! 	return fmt_str;
! }
! 
! CString CGmeDlg::getFmtStrValue()
! {
! 	CString res( m_strFmtStrg2);
! 	CWnd* combo = 0;
! 	combo = GetDlgItem(IDC_CMBFMTSTRS);
! 	if( combo)
! 	{
! 		CEdit* edit = 0;
! 		edit = (CEdit*)( combo->GetDlgItem(1001));
! 		if( edit)
! 		{
! 			char buff[100];
! 			edit->GetLine(0, buff, sizeof(buff)-1);
! 			res = buff;
! 		}
! 	}
! 	return res;
! }
! 
! void CGmeDlg::fillFmtStrComboBox()
! {
! 	CComboBox*  fmtBox = 0;
! 	fmtBox = (CComboBox*)GetDlgItem(IDC_CMBFMTSTRS);
! 	fmtBox->AddString( m_strFmtStrg);
! 	fmtBox->AddString( m_strFmtStrf);
! 	fmtBox->AddString( m_strFmtStre);
! 	fmtBox->AddString( m_strFmtStrE);
! 	fmtBox->AddString( m_strFmtStrg2);
! 	fmtBox->AddString( m_strFmtStrf2);
! 
! 	CString regv = getFmtStrFromReg();
! 	int pos = fmtBox->FindStringExact( -1, regv);
! 	if( pos == CB_ERR)
! 		fmtBox->InsertString( -1, regv);
! 	fmtBox->SelectString( -1, regv);
! }
! 

Index: MgaRegistrar.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/MgaRegistrar.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** MgaRegistrar.cpp	21 Jun 2005 19:40:38 -0000	1.42
--- MgaRegistrar.cpp	15 Nov 2005 20:10:51 -0000	1.43
***************
*** 655,658 ****
--- 655,759 ----
  }
  
+ 
+ STDMETHODIMP CMgaRegistrar::GetMouseOverNotify(regaccessmode_enum mode, VARIANT_BOOL *enabled)
+ {
+ 	COMTRY
+ 	{
+ 		LONG res;
+ 		CString str;
+ 		if(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, "MouseOverNotify");
+ 				if(!str.IsEmpty()) {
+ 					REVOKE_SYS2(mode);
+ 				}
+ 			}
+ 		}
+ 		if(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, "MouseOverNotify");
+ 			}
+ 		}
+ 		*enabled = (str == "1") ? VARIANT_TRUE : VARIANT_FALSE; // Default value: false
+ 	}
+ 	COMCATCH(;)
+ }
+ 
+ 
+ STDMETHODIMP CMgaRegistrar::SetMouseOverNotify(regaccessmode_enum mode, VARIANT_BOOL enabled)
+ {
+ 	COMTRY
+ 	{
+ 		CString str = (enabled == VARIANT_FALSE) ? "0" : "1";
+ 		if(mode & RM_USER) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_CURRENT_USER, rootreg) );
+ 			ERRTHROW( mga.SetStringValue( "MouseOverNotify", str));
+ 		}
+ 		if(mode & (RM_SYS | RM_TEST)) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_LOCAL_MACHINE, rootreg) );
+ 			if(mode & RM_SYS) ERRTHROW( mga.SetStringValue( "MouseOverNotify", str));
+ 		}
+ 	}
+ 	COMCATCH(;)
+ }
+ 
+ STDMETHODIMP CMgaRegistrar::GetRealNmbFmtStr(regaccessmode_enum p_mode, BSTR *p_fmtStr)
+ {
+ 	CHECK_OUT(p_fmtStr);
+ 	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, "RealNmbFmtStr");
+ 				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, "RealNmbFmtStr");
+ 			}
+ 		}
+ 		CopyTo(str, p_fmtStr);
+ 	}
+ 	COMCATCH(;)
+ 
+ }
+ 
+ STDMETHODIMP CMgaRegistrar::SetRealNmbFmtStr(regaccessmode_enum p_mode, BSTR p_fmtStr)
+ {
+ 	COMTRY
+ 	{
+ 		CString str;
+ 		CopyTo(p_fmtStr, str);
+ 		if(p_mode & RM_USER) {
+ 			CRegKey mga;
+ 			ERRTHROW( mga.Create(HKEY_CURRENT_USER, rootreg) );
+ 			ERRTHROW( mga.SetStringValue( "RealNmbFmtStr", 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( "RealNmbFmtStr", 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.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** MgaRegistrar.h	21 Jun 2005 19:40:38 -0000	1.19
--- MgaRegistrar.h	15 Nov 2005 20:10:51 -0000	1.20
***************
*** 51,54 ****
--- 51,58 ----
  	STDMETHOD(GetDefZoomLevel)(regaccessmode_enum mode, BSTR *zlevel);
  	STDMETHOD(SetDefZoomLevel)(regaccessmode_enum mode, BSTR zlevel);
+ 	STDMETHOD(GetMouseOverNotify)(regaccessmode_enum mode, VARIANT_BOOL *enabled);
+ 	STDMETHOD(SetMouseOverNotify)(regaccessmode_enum mode, VARIANT_BOOL enabled);
+ 	STDMETHOD(GetRealNmbFmtStr)(regaccessmode_enum mode, BSTR *fmtStr);
+ 	STDMETHOD(SetRealNmbFmtStr)(regaccessmode_enum mode, BSTR fmtStr);
  
  	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.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** resource.h	21 Jul 2005 16:56:44 -0000	1.31
--- resource.h	15 Nov 2005 20:10:51 -0000	1.32
***************
*** 201,204 ****
--- 201,206 ----
  #define IDC_EXATOM                      2264
  #define IDC_EXSET                       2265
+ #define IDC_SENDOVEROBJECT              2266
+ #define IDC_CMBFMTSTRS                  2268
  #define ID_CNTX_ADDNODE                 32774
  #define ID_CNTX_CLEARNODE               32775
***************
*** 212,216 ****
  #define _APS_NEXT_RESOURCE_VALUE        2071
  #define _APS_NEXT_COMMAND_VALUE         32778
! #define _APS_NEXT_CONTROL_VALUE         2266
  #define _APS_NEXT_SYMED_VALUE           2091
  #endif
--- 214,218 ----
  #define _APS_NEXT_RESOURCE_VALUE        2071
  #define _APS_NEXT_COMMAND_VALUE         32778
! #define _APS_NEXT_CONTROL_VALUE         2269
  #define _APS_NEXT_SYMED_VALUE           2091
  #endif

Index: GmeDlg.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/MgaUtil/GmeDlg.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** GmeDlg.h	21 Jun 2005 19:40:38 -0000	1.10
--- GmeDlg.h	15 Nov 2005 20:10:51 -0000	1.11
***************
*** 44,47 ****
--- 44,48 ----
  	CString	m_ext_editor;
  	BOOL	m_labelavoidance;
+ 	BOOL	m_sendOverObj;
  	//}}AFX_DATA
  
***************
*** 91,94 ****
--- 92,108 ----
  	static const char * m_strZAll;     // "Fit All";
  
+ 	void fillFmtStrComboBox();
+ 	CString getFmtStrFromReg();
+ 	CString getFmtStrValue();
+ 	
+ 	static const char * m_strFmtStrg;
+ 	static const char * m_strFmtStrf;
+ 	static const char * m_strFmtStre;
+ 	static const char * m_strFmtStrE;
+ 	static const char * m_strFmtStrg2;
+ 	static const char * m_strFmtStrf2;
+ 
+ public:
+ 	afx_msg void OnCbnSelchangeZooms();
  };
  



More information about the GME-commit mailing list