[commit] r1404 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Sun Jul 17 18:10:07 CDT 2011


Author: ksmyth
Date: Sun Jul 17 18:10:07 2011
New Revision: 1404

Log:
OnDestroy isnt being called for CMainForm, so move clearing gmeoleapp to m_pMainWnd.

Modified:
   trunk/GME/Gme/   (props changed)
   trunk/GME/Gme/ChildFrm.cpp
   trunk/GME/Gme/GMEApp.cpp
   trunk/GME/Gme/GMEOLEIt.cpp
   trunk/GME/Gme/GUIObject.cpp
   trunk/GME/Gme/MainFrm.cpp
   trunk/GME/Gme/MainFrm.h
   trunk/GME/Gme/ModelPropertiesDlgBar.cpp
   trunk/GME/Gme/StdAfx.h

Modified: trunk/GME/Gme/ChildFrm.cpp
==============================================================================
--- trunk/GME/Gme/ChildFrm.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/ChildFrm.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -125,7 +125,7 @@
 //		int zoomvals[] = {ZOOM_NO, 150, 200, 250, 300, 350, 400, 0}; // for test
 		propBar.SetZoomList(zoomvals);
 		propBar.DockToFrameWindow(CBRS_ALIGN_TOP);
-		propBar.SetMinSize(CSize(10, 25));
+		propBar.SetMinSize(CSize(50, 25 * GetDC()->GetDeviceCaps(LOGPIXELSY) / 96));
 
 		ShowPane(&propBar, true, false, true);
 	}

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/GMEApp.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -1754,7 +1754,7 @@
 		long l;
 		COMTHROW(mgaProject->get_ProjectStatus(&l));
 		if (IsUndoPossible() && (l & PROJECT_STATUS_CHANGED))
-			ret = AfxMessageBox(_T("Save project '") + projectName + _T("'?"),  MB_YESNOCANCEL);
+			ret = AfxMessageBox(_T("Save project '") + projectName + _T("'?"),  MB_YESNO);
 		if (ret == IDCANCEL) {
 			return FALSE;
 		} else if (ret == IDNO) {
@@ -1762,9 +1762,10 @@
 			OnFileAbortProject();
 		} else {
 			((CMainFrame*)m_pMainWnd)->clearMgaProj();
-			return SafeCloseProject();
+			SafeCloseProject();
 		}
 	}
+    ((CMainFrame*)m_pMainWnd)->clearGmeOleApp();
 	return TRUE;
 }
 

Modified: trunk/GME/Gme/GMEOLEIt.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEIt.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/GMEOLEIt.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -795,6 +795,18 @@
 	if ( hEmf ) {
 		DeleteEnhMetaFile(hEmf);
 	}
+	// XXX DONT COMMIT this only works with Vista/7 (GDI+ 1.1)
+	/*HDC hdc = ::CreateCompatibleDC(NULL);
+	Gdiplus::Graphics g(hdc);
+	g.SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeHighQuality);
+	g.SetTextRenderingHint(Gdiplus::TextRenderingHint::TextRenderingHintAntiAlias);
+	{
+	Gdiplus::Metafile mf(filePath);
+	mf.ConvertToEmfPlus(&g, CString(filePath) + "plus");
+	}
+	MoveFile(CString(filePath) + "plus", filePath);
+	::DeleteDC(hdc);
+	*/
 }
 
 void CGMEOLEIt::CheckConstraints() 

Modified: trunk/GME/Gme/GUIObject.cpp
==============================================================================
--- trunk/GME/Gme/GUIObject.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/GUIObject.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -1914,8 +1914,16 @@
 		else
 			COMTHROW(GetCurrentAspect()->GetDecorator()->Draw((ULONG)pDC));
 	}
-	catch (hresult_exception &) {
-		AfxMessageBox(_T("Error in decorator [method Draw()]"));
+	catch (hresult_exception &e) {
+		CComQIPtr<ISupportErrorInfo> errorInfo = GetCurrentAspect()->GetDecorator();
+		_bstr_t error;
+		if (errorInfo) {
+			GetErrorInfo(error.GetAddress());
+		} else {
+			GetErrorInfo(e.hr, error.GetAddress());
+		}
+		// FIXME: KMS: won't Draw() be called after the MessageBox is dismissed?
+		AfxMessageBox(CString(_T("Error in decorator [method Draw()]: ")) + static_cast<const TCHAR*>(error));
 	}
 
 // #define _ARDEBUG

Modified: trunk/GME/Gme/MainFrm.cpp
==============================================================================
--- trunk/GME/Gme/MainFrm.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/MainFrm.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -104,7 +104,6 @@
 	MSG_MAP_VIEW_PANE(ID_VIEW_CONSOLE,			CGMEConsole,		m_console)
 	MSG_MAP_VIEW_PANE(ID_VIEW_GMEBROWSER,		CGMEBrowser,		m_browser)
 	MSG_MAP_VIEW_PANE(ID_VIEW_SEARCH,			CGMESearch,			m_search)
-	ON_WM_CLOSE()
 	ON_WM_DROPFILES()
 	ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_OFF_2007_AQUA, &CMainFrame::OnUpdateApplicationLook)
 	ON_COMMAND(ID_WINDOW_MANAGER, &CMainFrame::OnWindowManager)
@@ -220,12 +219,6 @@
 	m_console.SetGMEProj( 0 );
 }
 
-void CMainFrame::OnNcDestroy()
-{
-	clearGmeOleApp();
-	CMDIFrameWndEx::OnNcDestroy();
-}
-
 int CMainFrame::CreateToolBars()
 {
 	
@@ -916,11 +909,6 @@
     return TRUE;
 }
 
-BOOL CMainFrame::DestroyWindow()
-{
-	return CMDIFrameWndEx::DestroyWindow();
-}
-
 void CMainFrame::ShowObjectInspector()
 {
 	ShowPane(&m_objectInspector, TRUE, FALSE, TRUE);

Modified: trunk/GME/Gme/MainFrm.h
==============================================================================
--- trunk/GME/Gme/MainFrm.h	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/MainFrm.h	Sun Jul 17 18:10:07 2011	(r1404)
@@ -74,7 +74,6 @@
 	//{{AFX_VIRTUAL(CMainFrame)
 	public:
 	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-	virtual BOOL DestroyWindow();
 	virtual BOOL PreTranslateMessage(MSG* pMsg);
 	//}}AFX_VIRTUAL
 
@@ -147,7 +146,6 @@
 	}
 
 	afx_msg void OnUpdateWindowNew(CCmdUI* pCmdUI);
-	afx_msg void OnNcDestroy();
 public:
 	afx_msg void OnDropFiles(HDROP p_hDropInfo);
 protected:

Modified: trunk/GME/Gme/ModelPropertiesDlgBar.cpp
==============================================================================
--- trunk/GME/Gme/ModelPropertiesDlgBar.cpp	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/ModelPropertiesDlgBar.cpp	Sun Jul 17 18:10:07 2011	(r1404)
@@ -27,6 +27,7 @@
 
 void CModelPropertiesDlgBar::ShowType()
 {
+	// FIXME: fix for DPI
 	GetDlgItem(IDC_TYPEMARK)->MoveWindow(6,8,16,16);
 	GetDlgItem(IDC_TYPEMARK)->ShowWindow(SW_SHOW);
 	GetDlgItem(IDC_INSTANCEMARK)->ShowWindow(SW_HIDE);
@@ -35,6 +36,7 @@
 
 void CModelPropertiesDlgBar::ShowInstance()
 {
+	// FIXME: fix for DPI
 	GetDlgItem(IDC_TYPEMARK)->ShowWindow(SW_HIDE);
 	GetDlgItem(IDC_INSTANCEMARK)->MoveWindow(6,8,16,16);
 	GetDlgItem(IDC_INSTANCEMARK)->ShowWindow(SW_SHOW);

Modified: trunk/GME/Gme/StdAfx.h
==============================================================================
--- trunk/GME/Gme/StdAfx.h	Fri Jul 15 12:49:49 2011	(r1403)
+++ trunk/GME/Gme/StdAfx.h	Sun Jul 17 18:10:07 2011	(r1404)
@@ -8,6 +8,9 @@
 
 #pragma once
 
+// XXX DONT COMMIT this only works with Vista/7 (GDI+ 1.1)
+//#define GDIPVER 0x0110
+
 #ifndef _SECURE_ATL
 #define _SECURE_ATL 1
 #endif


More information about the gme-commit mailing list