[GME-commit] GMESRC/GME/Gme ScrollZoomView.h,1.5,1.6 ScrollZoomView.cpp,1.11,1.12

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 27 12:46:39 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv17262

Modified Files:
	ScrollZoomView.h ScrollZoomView.cpp 
Log Message:
GetScrollRange - does not work, framework error, hacked

CVS User: bogyom

Index: ScrollZoomView.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/ScrollZoomView.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ScrollZoomView.h	7 May 2004 20:58:24 -0000	1.5
--- ScrollZoomView.h	27 May 2004 16:46:35 -0000	1.6
***************
*** 58,61 ****
--- 58,63 ----
  	bool m_zoomScroll;
  	CPoint m_zoomP;
+ 	bool m_noHscroll; // hack terge
+ 	bool m_noVscroll; // hack terge
  
  	int m_nMapMode;

Index: ScrollZoomView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/ScrollZoomView.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ScrollZoomView.cpp	13 May 2004 16:11:50 -0000	1.11
--- ScrollZoomView.cpp	27 May 2004 16:46:35 -0000	1.12
***************
*** 121,124 ****
--- 121,127 ----
  	m_zoomP.x = m_zoomP.y = 0;
  	m_zoomScroll = false;
+ 	m_noHscroll = true; // hack terge
+ 	m_noVscroll = true; // hack terge
+ 
  }
  
***************
*** 210,213 ****
--- 213,218 ----
  		SetScrollPos(SB_VERT, 0);
  		EnableScrollBarCtrl(SB_BOTH, FALSE);
+ 		m_noHscroll = true; // hack terge
+ 		m_noVscroll = true; // hack terge
  		SetScrollRange(SB_HORZ, 0, 0, TRUE);
  		SetScrollRange(SB_VERT, 0, 0, TRUE);
***************
*** 329,334 ****
  
  	// now in device coordinates - limit if out of range
! 	int xMax = GetScrollLimit(SB_HORZ);
! 	int yMax = GetScrollLimit(SB_VERT);
  	if (pt.x < 0)
  		pt.x = 0;
--- 334,353 ----
  
  	// now in device coordinates - limit if out of range
! //	int xMax = GetScrollLimit(SB_HORZ);
! //	int yMax = GetScrollLimit(SB_VERT);
! 	int xMin, xMax, yMin, yMax;
! 	GetScrollRange(SB_HORZ, &xMin, &xMax); // it does not work correctly ?? !!
! 	GetScrollRange(SB_VERT, &yMin, &yMax);
! 	if (m_noHscroll)   // hack terge
! 	{
! 		xMin = xMax = 0;
! 	}
! 	if (m_noVscroll)   // hack terge
! 	{
! 		yMin = yMax = 0;
! 	}
! 
! 	// terge ?? szar van
! 
  	if (pt.x < 0)
  		pt.x = 0;
***************
*** 403,408 ****
  	ASSERT(ptDev.x >= 0);
  	ASSERT(ptDev.y >= 0);
! 	int maxh = GetScrollLimit(SB_HORZ);
! 	int maxv = GetScrollLimit(SB_VERT);
  	if (maxh == 0  &&  maxv == 0)
  	{
--- 422,430 ----
  	ASSERT(ptDev.x >= 0);
  	ASSERT(ptDev.y >= 0);
! 	int maxh; // = GetScrollLimit(SB_HORZ);
! 	int maxv; // = GetScrollLimit(SB_VERT);
! 	int xMin, yMin;
! 	GetScrollRange(SB_HORZ, &xMin, &maxh);
! 	GetScrollRange(SB_VERT, &yMin, &maxv);
  	if (maxh == 0  &&  maxv == 0)
  	{
***************
*** 534,538 ****
  	else
  	{
! 		int xMax = GetScrollLimit(SB_HORZ);
  		if (xDesired > xMax)
  			xDesired = xMax;
--- 556,562 ----
  	else
  	{
! 		int xMin, xMax;
! 		GetScrollRange(SB_HORZ, &xMin, &xMax);
! //		int xMax = GetScrollLimit(SB_HORZ);
  		if (xDesired > xMax)
  			xDesired = xMax;
***************
*** 545,549 ****
  	else
  	{
! 		int yMax = GetScrollLimit(SB_VERT);
  		if (yDesired > yMax)
  			yDesired = yMax;
--- 569,575 ----
  	else
  	{
! 		int yMin, yMax;
! 		GetScrollRange(SB_VERT, &yMin, &yMax);
! //		int yMax = GetScrollLimit(SB_VERT);
  		if (yDesired > yMax)
  			yDesired = yMax;
***************
*** 708,711 ****
--- 734,739 ----
  				SetScrollPos(SB_VERT, 0);
  				EnableScrollBarCtrl(SB_BOTH, FALSE);
+ 				m_noHscroll = true; // hack terge
+ 				m_noVscroll = true; // hack terge
  				SetScrollRange(SB_HORZ, 0, 0, TRUE);
  				SetScrollRange(SB_VERT, 0, 0, TRUE);
***************
*** 751,767 ****
  	if (needSb.cx)
  	{
  		info.nPage = sizeClient.cx;
  		info.nMax = m_totalDev.cx-1;
! 		if (!SetScrollInfo(SB_HORZ, &info, TRUE))
  			SetScrollRange(SB_HORZ, 0, sizeRange.cx, TRUE);
  	}
  	else
  	{
  		SetScrollPos(SB_HORZ, 0);
  		SetScrollRange(SB_HORZ, 0, 0, TRUE);
  	}
  	EnableScrollBarCtrl(SB_VERT, needSb.cy);
  	if (needSb.cy)
  	{
  		info.nPage = sizeClient.cy;
  		info.nMax = m_totalDev.cy-1;
--- 779,813 ----
  	if (needSb.cx)
  	{
+ 		m_noHscroll = false; // hack terge
  		info.nPage = sizeClient.cx;
  		info.nMax = m_totalDev.cx-1;
! 		if (!SetScrollInfo(SB_HORZ, &info, TRUE)) ///dsfsd fds
  			SetScrollRange(SB_HORZ, 0, sizeRange.cx, TRUE);
  	}
  	else
  	{
+ 		m_noHscroll = true; // hack terge
+ //		DWORD err = 0;
+ //		BOOL ret = TRUE;
  		SetScrollPos(SB_HORZ, 0);
  		SetScrollRange(SB_HORZ, 0, 0, TRUE);
+ /*		CScrollBar* pScrollBar;
+ 		if ((pScrollBar = GetScrollBarCtrl(SB_HORZ)) != NULL)
+ 			pScrollBar->SetScrollRange(0, 0, TRUE);
+ 		else
+ 		{
+ 			ret = ::SetScrollRange(m_hWnd, SB_HORZ, 0, 0, TRUE);
+ 			if (!ret)
+ 				err = GetLastError();
+ 		}*/
+ //		int lxMin, lxMax;
+ //		GetScrollRange(SB_HORZ, &lxMin, &lxMax);
  	}
  	EnableScrollBarCtrl(SB_VERT, needSb.cy);
+ //	int ixMin, ixMax;
+ //	GetScrollRange(SB_HORZ, &ixMin, &ixMax);
  	if (needSb.cy)
  	{
+ 		m_noVscroll = false; // hack terge
  		info.nPage = sizeClient.cy;
  		info.nMax = m_totalDev.cy-1;
***************
*** 771,777 ****
--- 817,829 ----
  	else
  	{
+ 		m_noVscroll = true; // hack terge
  		SetScrollPos(SB_VERT, 0);
+ //		int jxMin, jxMax;
+ //		GetScrollRange(SB_HORZ, &jxMin, &jxMax);
  		SetScrollRange(SB_VERT, 0, 0, TRUE);
  	}
+ //	int pxMin, pxMax, pyMin, pyMax;
+ ///	GetScrollRange(SB_HORZ, &pxMin, &pxMax); // pxMax == 100 after setting it 0 - framework error
+ //	GetScrollRange(SB_VERT, &pyMin, &pyMax);
  	if (m_zoomScroll)
  	{
***************
*** 1029,1033 ****
  	// adjust current x position
  	xOrig = x = GetScrollPos(SB_HORZ);
! 	int xMax = GetScrollLimit(SB_HORZ);
  	x += sizeScroll.cx;
  	if (x < 0)
--- 1081,1087 ----
  	// adjust current x position
  	xOrig = x = GetScrollPos(SB_HORZ);
! 	int xMax, xMin;
! 	GetScrollRange(SB_HORZ, &xMin, &xMax);
! //	int xMax = GetScrollLimit(SB_HORZ);
  	x += sizeScroll.cx;
  	if (x < 0)
***************
*** 1038,1042 ****
  	// adjust current y position
  	yOrig = y = GetScrollPos(SB_VERT);
! 	int yMax = GetScrollLimit(SB_VERT);
  	y += sizeScroll.cy;
  	if (y < 0)
--- 1092,1098 ----
  	// adjust current y position
  	yOrig = y = GetScrollPos(SB_VERT);
! 	int yMin, yMax;
! 	GetScrollRange(SB_VERT, &yMin, &yMax);
! //	int yMax = GetScrollLimit(SB_VERT);
  	y += sizeScroll.cy;
  	if (y < 0)



More information about the GME-commit mailing list