[GME-commit] GMESRC/GME/ObjectInspector InspectorDlg.cpp,1.24,1.25 ItemData.cpp,1.22,1.23 ItemData.h,1.17,1.18

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


Update of /project/gme-repository/GMESRC/GME/ObjectInspector
In directory escher:/tmp/cvs-serv22616

Modified Files:
	InspectorDlg.cpp ItemData.cpp ItemData.h 
Log Message:
Introducing user defined double attribute format.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: ItemData.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/ObjectInspector/ItemData.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ItemData.h	23 Jul 2002 00:44:00 -0000	1.17
--- ItemData.h	15 Nov 2005 20:01:58 -0000	1.18
***************
*** 34,37 ****
--- 34,41 ----
  	void CommonInit();
  public:
+ 	static const char * m_defFMTSTR;
+ 	static CString      m_fmtStr;
+ 	static void         getRealFmtString();
+ 
  	void toString();
  	bool toString(CString &)const;

Index: ItemData.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/ObjectInspector/ItemData.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** ItemData.cpp	6 Jul 2005 20:10:10 -0000	1.22
--- ItemData.cpp	15 Nov 2005 20:01:58 -0000	1.23
***************
*** 13,20 ****
--- 13,44 ----
  #endif
  
+ /*static*/ const char * CItemData::m_defFMTSTR = "%.12g";
+ /*static*/ CString      CItemData::m_fmtStr    = "%.12g";
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
  //////////////////////////////////////////////////////////////////////
  
+ //static
+ void CItemData::getRealFmtString()
+ {
+ 	CComPtr<IMgaRegistrar> registrar;
+ 	try {
+ 		COMTHROW( registrar.CoCreateInstance(OLESTR("MGA.MgaRegistrar")) );
+ 		ASSERT( registrar != NULL );
+ 
+ 		CComBSTR bs_fmt_str;
+ 		COMTHROW( registrar->GetRealNmbFmtStr( REGACCESS_USER, &bs_fmt_str));
+ 		if( bs_fmt_str) 
+ 			CopyTo( bs_fmt_str, CItemData::m_fmtStr);
+ 
+ 		if( CItemData::m_fmtStr.IsEmpty())
+ 			CItemData::m_fmtStr = CItemData::m_defFMTSTR;
+ 	} 
+ 	catch (hresult_exception &) {
+ 		CItemData::m_fmtStr = CItemData::m_defFMTSTR;
+ 	}
+ }
+ 
+ 
  //////////// List Item ///////////////
  CListItem::CListItem()
***************
*** 388,392 ****
  	case ITEMDATA_DOUBLE:
  		{
! 			strString.Format("%.12g",doubleVal);
  			bRetVal=true;
  		}break;
--- 412,416 ----
  	case ITEMDATA_DOUBLE:
  		{
! 			strString.Format( CItemData::m_fmtStr,doubleVal);
  			bRetVal=true;
  		}break;

Index: InspectorDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/ObjectInspector/InspectorDlg.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** InspectorDlg.cpp	23 Jul 2002 20:26:00 -0000	1.24
--- InspectorDlg.cpp	15 Nov 2005 20:01:58 -0000	1.25
***************
*** 49,53 ****
--- 49,57 ----
  
  	m_currentPanel = 0;
+ 
+ 	// this method is called only once
+ 	CItemData::getRealFmtString();
  }
+ 
  
  CInspectorDlg::~CInspectorDlg()



More information about the GME-commit mailing list