[GME-commit] GMESRC/GME/Gme GMEPanningWindow.cpp, NONE, 1.1 ChildFrm.cpp, 1.10, 1.11 GMEOLEApp.cpp, 1.16, 1.17 GMEPartBrowser.cpp, 1.2, 1.3 GMEView.cpp, 1.201, 1.202 MainFrm.cpp, 1.44, 1.45 PannButton.cpp, 1.10, NONE PanningWindow.cpp, 1.4, NONE

Log messages of CVS commits gme-commit at list.isis.vanderbilt.edu
Mon Jun 2 12:40:56 CDT 2008


Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv30015/GME/Gme

Modified Files:
	ChildFrm.cpp GMEOLEApp.cpp GMEPartBrowser.cpp GMEView.cpp 
	MainFrm.cpp 
Added Files:
	GMEPanningWindow.cpp 
Removed Files:
	PannButton.cpp PanningWindow.cpp 
Log Message:
PanningView ActiveX control2

CVS User:  (csaba)

Index: ChildFrm.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/ChildFrm.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ChildFrm.cpp	7 May 2008 16:24:42 -0000	1.10
--- ChildFrm.cpp	2 Jun 2008 17:40:54 -0000	1.11
***************
*** 102,109 ****
  		}
  		// terge 
! 		int zoomvals[] = {ZOOM_MIN, 10, 25, 50, 75, ZOOM_NO, 150, 200, 300, ZOOM_MAX,ZOOM_WIDTH,ZOOM_HEIGHT,ZOOM_ALL,0};
! //		int zoomvals[] = {ZOOM_NO,150,200,250,300,350,400,0}; // for test
  		propBar.SetZoomList(zoomvals);
- 		propBar.GetDlgItem(IDI_INSTANCEMARK_ICON);
  	}
  
--- 102,108 ----
  		}
  		// terge 
! 		int zoomvals[] = {ZOOM_MIN, 10, 25, 50, 75, ZOOM_NO, 150, 200, 300, ZOOM_MAX, ZOOM_WIDTH, ZOOM_HEIGHT, ZOOM_ALL, 0};
! //		int zoomvals[] = {ZOOM_NO, 150, 200, 250, 300, 350, 400, 0}; // for test
  		propBar.SetZoomList(zoomvals);
  	}
  

--- PanningWindow.cpp DELETED ---

Index: GMEView.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -C2 -d -r1.201 -r1.202
*** GMEView.cpp	11 Apr 2008 23:45:24 -0000	1.201
--- GMEView.cpp	2 Jun 2008 17:40:54 -0000	1.202
***************
*** 591,595 ****
  	CMainFrame* main = (CMainFrame*)theApp.m_pMainWnd;
  
! 	if (!main  ||  !main->m_pannWin.IsVisible())
  		return;
  
--- 591,595 ----
  	CMainFrame* main = (CMainFrame*)theApp.m_pMainWnd;
  
! 	if (!main || !main->m_panningWindow.IsVisible())
  		return;
  
***************
*** 662,666 ****
  
  	// force CPanningWindow to reset the DC 
! 	main->m_pannWin.SetBitmapDC(this, pannDC, extent, target, bgColor);
  	notifyPanning(GetDeviceScrollPosition());
  }
--- 662,666 ----
  
  	// force CPanningWindow to reset the DC 
! 	main->m_panningWindow.SetBitmapDC(this, pannDC, extent, target, bgColor);
  	notifyPanning(GetDeviceScrollPosition());
  }
***************
*** 1291,1295 ****
  	{
  		CRect extent(0,0,0,0), target(0,0,0,0); // terge
! 		main->m_pannWin.SetBitmapDC(this, NULL, extent, target, bgColor);
  	}
  
--- 1291,1295 ----
  	{
  		CRect extent(0,0,0,0), target(0,0,0,0); // terge
! 		main->m_panningWindow.SetBitmapDC(this, NULL, extent, target, bgColor);
  	}
  

Index: GMEOLEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEOLEApp.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** GMEOLEApp.cpp	7 Mar 2007 23:25:56 -0000	1.16
--- GMEOLEApp.cpp	2 Jun 2008 17:40:54 -0000	1.17
***************
*** 615,619 ****
  	// terge 
  	panel = new CGMEOLEPanel();
! 	panel->SetParams( &CMainFrame::theInstance->m_pannWin, _T("Panning Window"));
  	coll->Add(panel->GetIDispatch(FALSE));
  	panel->GetIDispatch(FALSE)->Release();	// We do not hold reference, hopefully the collection will hold one
--- 615,619 ----
  	// terge 
  	panel = new CGMEOLEPanel();
! 	panel->SetParams( &CMainFrame::theInstance->m_panningWindow, _T("Panning Window"));
  	coll->Add(panel->GetIDispatch(FALSE));
  	panel->GetIDispatch(FALSE)->Release();	// We do not hold reference, hopefully the collection will hold one

Index: MainFrm.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MainFrm.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** MainFrm.cpp	18 Apr 2008 17:06:22 -0000	1.44
--- MainFrm.cpp	2 Jun 2008 17:40:54 -0000	1.45
***************
*** 27,42 ****
  	UINT nID =pNMHDR->idFrom;
  
!     if(nID >= ID_FILE_RUNPLUGIN1 && nID <= ID_FILE_RUNPLUGIN8) {
!         strncpy(pTTT->szText, theApp.pluginTooltips[nID-ID_FILE_RUNPLUGIN1], 79);
  	}
!     if(nID >= ID_FILE_INTERPRET1 && nID <= ID_FILE_INTERPRET18) {
!         strncpy(pTTT->szText, theApp.interpreterTooltips[nID-ID_FILE_INTERPRET1], 79);
  	}
  	if (pTTT->uFlags & TTF_IDISHWND) {
!     // idFrom is actually the HWND of the tool
  		nID = ::GetDlgCtrlID((HWND)nID);
  		if(nID) {
! 	        pTTT->lpszText = "Ajaj"; //theApp.plugins[0];
! 		    pTTT->hinst = AfxGetResourceHandle();
  			return(TRUE);
  		}
--- 27,42 ----
  	UINT nID =pNMHDR->idFrom;
  
! 	if(nID >= ID_FILE_RUNPLUGIN1 && nID <= ID_FILE_RUNPLUGIN8) {
! 		strncpy(pTTT->szText, theApp.pluginTooltips[nID-ID_FILE_RUNPLUGIN1], 79);
  	}
! 	if(nID >= ID_FILE_INTERPRET1 && nID <= ID_FILE_INTERPRET18) {
! 		strncpy(pTTT->szText, theApp.interpreterTooltips[nID-ID_FILE_INTERPRET1], 79);
  	}
  	if (pTTT->uFlags & TTF_IDISHWND) {
! 	// idFrom is actually the HWND of the tool
  		nID = ::GetDlgCtrlID((HWND)nID);
  		if(nID) {
! 			pTTT->lpszText = "Ajaj"; //theApp.plugins[0];
! 			pTTT->hinst = AfxGetResourceHandle();
  			return(TRUE);
  		}
***************
*** 276,280 ****
  	}
  
!     
  
  	// PART BROWSER
--- 276,280 ----
  	}
  
! 
  
  	// PART BROWSER
***************
*** 282,287 ****
  		TRUE, ID_PARTBROWSER))
  	{
!         	TRACE0("Failed to create part browser\n");
!         	return -1;      // fail to create
  	}
  	m_partBrowser.SetBarStyle(m_partBrowser.GetBarStyle() |
--- 282,287 ----
  		TRUE, ID_PARTBROWSER))
  	{
! 			TRACE0("Failed to create part browser\n");
! 			return -1;	// fail to create
  	}
  	m_partBrowser.SetBarStyle(m_partBrowser.GetBarStyle() |
***************
*** 293,306 ****
  	// terge 
  	// PANNING WINDOW
! 	if (!m_pannWin.Create(_T("Panning Window"), this, CSize(80, 80),
!         	TRUE, ID_PANNWIN))
  	{
  		TRACE0("Failed to create panning Window\n");
  		return -1;      // fail to create
  	}
! 	m_pannWin.SetBarStyle(m_pannWin.GetBarStyle() |
!         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  
! 	m_pannWin.EnableDocking(CBRS_ALIGN_ANY);
  
  
--- 293,306 ----
  	// terge 
  	// PANNING WINDOW
! 	if (!m_panningWindow.Create(_T("Panning Window"), this, CSize(80, 80),
! 		TRUE, ID_PANNWIN))
  	{
  		TRACE0("Failed to create panning Window\n");
  		return -1;      // fail to create
  	}
! 	m_panningWindow.SetBarStyle(m_panningWindow.GetBarStyle() |
! 		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  
! 	m_panningWindow.EnableDocking(CBRS_ALIGN_ANY);
  
  
***************
*** 392,398 ****
  	m_partBrowser.GetWindowRect(rc);
  	rc.OffsetRect(rc.Width(), 0);
! 	DockControlBar(&m_pannWin, AFX_IDW_DOCKBAR_BOTTOM, rc);
  	RecalcLayout(TRUE);
! 	m_pannWin.GetWindowRect(rc);
  	rc.OffsetRect(rc.Width(), 0);
  	DockControlBar(&m_objectInspector,AFX_IDW_DOCKBAR_BOTTOM,rc);
--- 392,398 ----
  	m_partBrowser.GetWindowRect(rc);
  	rc.OffsetRect(rc.Width(), 0);
! 	DockControlBar(&m_panningWindow, AFX_IDW_DOCKBAR_BOTTOM, rc);
  	RecalcLayout(TRUE);
! 	m_panningWindow.GetWindowRect(rc);
  	rc.OffsetRect(rc.Width(), 0);
  	DockControlBar(&m_objectInspector,AFX_IDW_DOCKBAR_BOTTOM,rc);
***************
*** 587,591 ****
  void CMainFrame::OnViewPannWin() 
  {
! 	ShowControlBar(&m_pannWin, !m_pannWin.IsVisible(), FALSE);
  	CMDIChildWnd* fwin = MDIGetActive(NULL);
  	if (!fwin)
--- 587,591 ----
  void CMainFrame::OnViewPannWin() 
  {
! 	ShowControlBar(&m_panningWindow, !m_panningWindow.IsVisible(), FALSE);
  	CMDIChildWnd* fwin = MDIGetActive(NULL);
  	if (!fwin)
***************
*** 606,610 ****
  {
  	pCmdUI->Enable();
! 	pCmdUI->SetCheck(m_pannWin.IsVisible());
  }
  
--- 606,610 ----
  {
  	pCmdUI->Enable();
! 	pCmdUI->SetCheck(m_panningWindow.IsVisible());
  }
  
***************
*** 700,703 ****
--- 700,714 ----
  
      return TRUE;
+ }
+ 
+ void CMainFrame::OnDeleteDCForPanningVindowCtrl(CDC* bCDC)
+ {
+ 	// TODO: forward to view control later
+ 	if (bCDC != NULL) {
+ 		CBitmap* bmp = bCDC->GetCurrentBitmap();
+ 		delete bCDC;
+ 		if (bmp)
+ 			delete bmp;
+ 	}
  }
  

--- NEW FILE: GMEPanningWindow.cpp ---
// GMEPanningWindow.cpp: implementation of the CGMEPanningWindow class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "GMEPanningWindow.h"
#include "sizecbar.h"
#include "GMEApp.h"
#include "MainFrm.h"


/////////////////////////////////////////////////////////////////////////////
// CGMEPanningWindow

CGMEPanningWindow* CGMEPanningWindow::theInstance = 0;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CGMEPanningWindow::CGMEPanningWindow()
{
	//{{AFX_DATA_INIT(CGMEPanningWindow)
	//}}AFX_DATA_INIT

	VERIFY(theInstance == 0);
	theInstance = this;
}


BEGIN_MESSAGE_MAP(CGMEPanningWindow, CSizingControlBar)
	//{{AFX_MSG_MAP(CGMEPanningWindow)
	ON_WM_CREATE()
	ON_WM_SIZE()
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


BEGIN_EVENTSINK_MAP(CGMEPanningWindow, CSizingControlBar)
	//{{AFX_EVENTSINK_MAP(CGMEPanningWindow)
	ON_EVENT(CGMEPanningWindow, IDC_PANNINGWINDOWCTRL1, 1 /* DeleteDeviceContext */, OnDeleteDeviceContextGmePanningVindowCtrl, VTS_UI8)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGMEPanningWindow message handlers

int CGMEPanningWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	lpCreateStruct->cx = lpCreateStruct->cy = 150;
	if (CSizingControlBar::OnCreate(lpCreateStruct) == -1)
		return -1;

	if (!m_PanningWindowWrapper.Create("PanningWindow", WS_CHILD | WS_VISIBLE, CRect(0, 0, 150, 150), this, IDC_PANNINGWINDOWCTRL1))
		return -1;

	m_szMin = CSize(120,120);
    m_szFloat = CSize(250,250); 
	m_szHorz = CSize(170,170);
    m_szVert = CSize(170,170);

	return 0;
}


void CGMEPanningWindow::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
{
	CSizingControlBar::OnUpdateCmdUI(pTarget, bDisableIfNoHndler);

	UpdateDialogControls(pTarget, bDisableIfNoHndler);
}


void CGMEPanningWindow::OnSize(UINT nType, int cx, int cy)
{
	cx = cy = 100;
	CSizingControlBar::OnSize(nType, cx, cy);

	CRect rc;
	GetClientRect(rc);

	m_PanningWindowWrapper.MoveWindow(rc);
}


void CGMEPanningWindow::DoDataExchange(CDataExchange* pDX)
{
	//{{AFX_DATA_MAP(CGMEPanningWindow)
	DDX_Control(pDX, IDC_PANNINGWINDOWCTRL1, m_PanningWindowWrapper);
	//}}AFX_DATA_MAP
}


/* 
ActiveX controls do not have their message pump, it is owned by their containers.
The container in case of GME is a kind of control bar, which is treated as a dialog.
Dialog box messages are filtered by ::IsDialogMessage, which does not allow the 
default dialog kestroke messages (ESC - close dialog, ENTER - push default button
TAB - next item in the tab order etc...) to be propagated to the controls placed on 
the dialog.

Here we avoid calling the default PreTranslateMessage which filtered by 
::IsDialogMessage, dispatch it directly to the controls.

Tihamer

*/

BOOL CGMEPanningWindow::PreTranslateMessage(MSG* pMsg)
{
	if (pMsg->message == WM_KEYDOWN) {
		switch (pMsg->wParam) {
			case VK_RETURN:
			case VK_ESCAPE:
			case VK_DELETE:
			// Modification by Volgyesi (undo problems)
			case VK_CONTROL:
			case 'z':
			case 'Z':
			// Modification End
				::TranslateMessage(pMsg);
				::DispatchMessage(pMsg);
				return TRUE;
		}
	}

	return CSizingControlBar::PreTranslateMessage(pMsg);
}


void CGMEPanningWindow::SetBitmapDC(CWnd* owner, CDC* bdc, CRect& ori, CRect& rect, COLORREF& bkgrnd)
{
	m_PanningWindowWrapper.SetBitmapDC((ULONGLONG)owner, (ULONGLONG)bdc, ori.left, ori.top, ori.Width(), ori.Height(),
										rect.left, rect.top, rect.Width(), rect.Height(), (OLE_COLOR)bkgrnd);
}


void CGMEPanningWindow::SetViewRect(CRect vrect)
{
	m_PanningWindowWrapper.SetViewRect(vrect.left, vrect.top, vrect.Width(), vrect.Height());
}


void CGMEPanningWindow::OnDeleteDeviceContextGmePanningVindowCtrl(ULONGLONG bCDC)
{
	CMainFrame::theInstance->OnDeleteDCForPanningVindowCtrl((CDC*) bCDC);
}

Index: GMEPartBrowser.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEPartBrowser.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GMEPartBrowser.cpp	30 Apr 2008 16:01:24 -0000	1.2
--- GMEPartBrowser.cpp	2 Jun 2008 17:40:54 -0000	1.3
***************
*** 49,60 ****
  
  /////////////////////////////////////////////////////////////////////////////
! // CPartBrowser message handlers
  
! int CGMEPartBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  {
  	if (CSizingControlBar::OnCreate(lpCreateStruct) == -1)
  		return -1;
  
! 	if (!m_PartBrowser.Create("PartBrowser", WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_PARTBROWSERCTRL1))
  		return -1;
  
--- 49,60 ----
  
  /////////////////////////////////////////////////////////////////////////////
! // CGMEPartBrowser message handlers
  
! int CGMEPartBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct)
  {
  	if (CSizingControlBar::OnCreate(lpCreateStruct) == -1)
  		return -1;
  
! 	if (!m_PartBrowserWrapper.Create("PartBrowser", WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_PARTBROWSERCTRL1))
  		return -1;
  
***************
*** 63,71 ****
  		if (!m_font.CreatePointFont(80, "MS Sans Serif"))
  			return -1;
! 	m_PartBrowser.SetFont(&m_font);
  
!     m_szFloat = CSize(500,165); 
  	m_szHorz = CSize(100,165);
!     m_szVert = CSize(120,400);
  
  	return 0;
--- 63,71 ----
  		if (!m_font.CreatePointFont(80, "MS Sans Serif"))
  			return -1;
! 	m_PartBrowserWrapper.SetFont(&m_font);
  
! 	m_szFloat = CSize(500,165); 
  	m_szHorz = CSize(100,165);
! 	m_szVert = CSize(120,400);
  
  	return 0;
***************
*** 81,85 ****
  
  
! void CGMEPartBrowser::OnSize(UINT nType, int cx, int cy) 
  {
  	CSizingControlBar::OnSize(nType, cx, cy);
--- 81,85 ----
  
  
! void CGMEPartBrowser::OnSize(UINT nType, int cx, int cy)
  {
  	CSizingControlBar::OnSize(nType, cx, cy);
***************
*** 88,92 ****
  	GetClientRect(rc);
  
! 	m_PartBrowser.MoveWindow(rc);
  }
  
--- 88,92 ----
  	GetClientRect(rc);
  
! 	m_PartBrowserWrapper.MoveWindow(rc);
  }
  
***************
*** 94,99 ****
  void CGMEPartBrowser::DoDataExchange(CDataExchange* pDX)
  {
! 	//{{AFX_DATA_MAP(CGMEPartBrowser)	
! 	DDX_Control(pDX, IDC_PARTBROWSERCTRL1, m_PartBrowser);
  	//}}AFX_DATA_MAP
  }
--- 94,99 ----
  void CGMEPartBrowser::DoDataExchange(CDataExchange* pDX)
  {
! 	//{{AFX_DATA_MAP(CGMEPartBrowser)
! 	DDX_Control(pDX, IDC_PARTBROWSERCTRL1, m_PartBrowserWrapper);
  	//}}AFX_DATA_MAP
  }
***************
*** 115,119 ****
  */
  
! BOOL CGMEPartBrowser::PreTranslateMessage(MSG* pMsg) 
  {
  	if (pMsg->message == WM_KEYDOWN) {
--- 115,119 ----
  */
  
! BOOL CGMEPartBrowser::PreTranslateMessage(MSG* pMsg)
  {
  	if (pMsg->message == WM_KEYDOWN) {
***************
*** 139,143 ****
  void CGMEPartBrowser::SetProject(CComPtr<IMgaProject> mgaProject)
  {
! 	m_PartBrowser.SetCurrentProject(mgaProject);
  }
  
--- 139,143 ----
  void CGMEPartBrowser::SetProject(CComPtr<IMgaProject> mgaProject)
  {
! 	m_PartBrowserWrapper.SetCurrentProject(mgaProject);
  }
  
***************
*** 153,157 ****
  			pMeta = iMeta;
  	}
! 	m_PartBrowser.SetMetaModel(pMeta);
  }
  
--- 153,157 ----
  			pMeta = iMeta;
  	}
! 	m_PartBrowserWrapper.SetMetaModel(pMeta);
  }
  
***************
*** 159,163 ****
  void CGMEPartBrowser::SetBgColor(COLORREF bgColor)
  {
! 	m_PartBrowser.SetBgColor((OLE_COLOR)bgColor);
  }
  
--- 159,163 ----
  void CGMEPartBrowser::SetBgColor(COLORREF bgColor)
  {
! 	m_PartBrowserWrapper.SetBgColor((OLE_COLOR)bgColor);
  }
  
***************
*** 165,169 ****
  void CGMEPartBrowser::ChangeAspect(int ind)
  {
! 	m_PartBrowser.ChangeAspect(ind);
  }
  
--- 165,169 ----
  void CGMEPartBrowser::ChangeAspect(int ind)
  {
! 	m_PartBrowserWrapper.ChangeAspect(ind);
  }
  
***************
*** 171,175 ****
  void CGMEPartBrowser::CycleAspect()
  {
! 	m_PartBrowser.CycleAspect();
  }
  
--- 171,175 ----
  void CGMEPartBrowser::CycleAspect()
  {
! 	m_PartBrowserWrapper.CycleAspect();
  }
  
***************
*** 177,181 ****
  void CGMEPartBrowser::RePaint(void)
  {
! 	m_PartBrowser.RePaint();
  	CSizingControlBar::PostMessage(WM_PAINT);
  }
--- 177,181 ----
  void CGMEPartBrowser::RePaint(void)
  {
! 	m_PartBrowserWrapper.RePaint();
  	CSizingControlBar::PostMessage(WM_PAINT);
  }
***************
*** 185,189 ****
  {
  	if (CGMEDoc::theInstance && guiMetaModel) {
! 		CGuiMetaAspect *am = guiMetaModel->FindAspect(index);
  		VERIFY(am);
  		CString aspName = am->name;
--- 185,189 ----
  {
  	if (CGMEDoc::theInstance && guiMetaModel) {
! 		CGuiMetaAspect* am = guiMetaModel->FindAspect(index);
  		VERIFY(am);
  		CString aspName = am->name;

--- PannButton.cpp DELETED ---



More information about the GME-commit mailing list