ImgEdit_UI/ImgEdit_UI/ScrollWnd.cpp
void CScrollWnd::SetScaleToFitSize(SIZE sizeTotal)
{
	// Note: It is possible to set sizeTotal members to negative values to
	//  effectively invert either the X or Y axis.
	
	ASSERT(m_hWnd != NULL);
	m_nMapMode = MM_SCALETOFIT;     // special internal value
	m_totalLog = sizeTotal;
	
	// reset and turn any scroll bars off
	if (m_hWnd != NULL && (GetStyle() & (WS_HSCROLL|WS_VSCROLL)))
	{
		SetScrollPos(SB_HORZ, 0);
		SetScrollPos(SB_VERT, 0);
		EnableScrollBarCtrl(SB_BOTH, FALSE);
		ASSERT((GetStyle() & (WS_HSCROLL|WS_VSCROLL)) == 0);
	}
	
	CRect rectT;
	GetClientRect(rectT);
	m_totalDev = rectT.Size();
	
	if (m_hWnd != NULL)
	{
		// window has been created, invalidate
		UpdateBars();
		Invalidate(TRUE);
	}
}
/////////////////////////////////////////////////////////////////////////////
// Set mode and scaling/scrolling sizes
Set mode and scaling/scrolling sizes
Set mode and scaling / scrolling sizes
void CScrollWnd::SetScaleToFitSize(SIZE sizeTotal)
{
	ASSERT(m_hWnd != NULL);
	m_nMapMode = MM_SCALETOFIT;     
	m_totalLog = sizeTotal;
	if (m_hWnd != NULL && (GetStyle() & (WS_HSCROLL|WS_VSCROLL)))
	{
		SetScrollPos(SB_HORZ, 0);
		SetScrollPos(SB_VERT, 0);
		EnableScrollBarCtrl(SB_BOTH, FALSE);
		ASSERT((GetStyle() & (WS_HSCROLL|WS_VSCROLL)) == 0);
	}
	CRect rectT;
	GetClientRect(rectT);
	m_totalDev = rectT.Size();
	if (m_hWnd != NULL)
	{
		UpdateBars();
		Invalidate(TRUE);
	}
}
void CScrollWnd :: SetScaleToFitSize ( SIZE sizeTotal ) { ASSERT ( m_hWnd != NULL ) ; m_nMapMode = MM_SCALETOFIT ; m_totalLog = sizeTotal ; if ( m_hWnd != NULL && ( GetStyle ( ) & ( WS_HSCROLL | WS_VSCROLL ) ) ) { SetScrollPos ( SB_HORZ , 0 ) ; SetScrollPos ( SB_VERT , 0 ) ; EnableScrollBarCtrl ( SB_BOTH , FALSE ) ; ASSERT ( ( GetStyle ( ) & ( WS_HSCROLL | WS_VSCROLL ) ) == 0 ) ; } CRect rectT ; GetClientRect ( rectT ) ; m_totalDev = rectT . Size ( ) ; if ( m_hWnd != NULL ) { UpdateBars ( ) ; Invalidate ( TRUE ) ; } }
Set mode and scaling/scrolling sizes
Set mode and scaling / scrolling sizes
// Note: It is possible to set sizeTotal members to negative values to //  effectively invert either the X or Y axis. // special internal value // reset and turn any scroll bars off // window has been created, invalidate