亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? logscrollview.cpp

?? VC技術(shù)內(nèi)幕源程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
// LogScrollView.cpp  scrollview for Logical Twips only
#include "stdafx.h"
#include <afxpriv.h>
#include "LogScrollView.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLogScrollView

BEGIN_MESSAGE_MAP(CLogScrollView, CView)
	//{{AFX_MSG_MAP(CLogScrollView)
	ON_WM_SIZE()
	ON_WM_HSCROLL()
	ON_WM_VSCROLL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLogScrollView construction/destruction

CLogScrollView::CLogScrollView()
{
	// Init everything to zero
	AFX_ZERO_INIT_OBJECT(CView);
}

CLogScrollView::~CLogScrollView()
{
}

/////////////////////////////////////////////////////////////////////////////
// CLogScrollView painting

void CLogScrollView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
	ASSERT_VALID(pDC);
	if(pDC->IsPrinting()) {
		pDC->SetMapMode(MM_TWIPS);
	}
	else {
		ASSERT(m_totalDev.cx >= 0 && m_totalDev.cy >= 0);
		pDC->SetMapMode(MM_ANISOTROPIC);
		pDC->SetWindowExt(1440, 1440);
		pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX),
						-pDC->GetDeviceCaps(LOGPIXELSX));
		CPoint ptVpOrg(0, 0);       // assume no shift for printing
		ASSERT(pDC->GetWindowOrg() == CPoint(0,0));

		// by default shift viewport origin in negative direction of scroll
		ptVpOrg = -GetDeviceScrollPosition();

		if (m_bCenter) {
			CRect rect;
			GetClientRect(&rect);

			// if client area is larger than total device size,
			// override scroll positions to place origin such that
			// output is centered in the window
			if (m_totalDev.cx < rect.Width())
				ptVpOrg.x = (rect.Width() - m_totalDev.cx) / 2;
			if (m_totalDev.cy < rect.Height())
				ptVpOrg.y = (rect.Height() - m_totalDev.cy) / 2;
		}
		pDC->SetViewportOrg(ptVpOrg);
	}
	CView::OnPrepareDC(pDC, pInfo);     // For default Printing behavior
}

/////////////////////////////////////////////////////////////////////////////
// Set mode and scaling/scrolling sizes

void CLogScrollView::SetLogScrollSizes(SIZE sizeTotal)
{
	ASSERT(sizeTotal.cx >= 0 && sizeTotal.cy >= 0);
    CSize sizePage(sizeTotal.cx / 2,
                   sizeTotal.cy / 2);   // page scroll
    CSize sizeLine(sizeTotal.cx / 100,
                   sizeTotal.cy / 100); // line scroll
	m_totalLog = sizeTotal;

	//BLOCK: convert logical coordinate space to device coordinates
	{
		CWindowDC dc(NULL);
		dc.SetMapMode(MM_ANISOTROPIC);
		dc.SetWindowExt(1440, 1440);
		dc.SetViewportExt(dc.GetDeviceCaps(LOGPIXELSX),
						-dc.GetDeviceCaps(LOGPIXELSX));

		// total size
		m_totalDev = m_totalLog;
		dc.LPtoDP((LPPOINT)&m_totalDev);
		m_pageDev = sizePage;
		dc.LPtoDP((LPPOINT)&m_pageDev);
		m_lineDev = sizeLine;
		dc.LPtoDP((LPPOINT)&m_lineDev);
		if (m_totalDev.cy < 0)
			m_totalDev.cy = -m_totalDev.cy;
		if (m_pageDev.cy < 0)
			m_pageDev.cy = -m_pageDev.cy;
		if (m_lineDev.cy < 0)
			m_lineDev.cy = -m_lineDev.cy;
	} // release DC here

	// now adjust device specific sizes
	ASSERT(m_totalDev.cx >= 0 && m_totalDev.cy >= 0);
	if (m_pageDev.cx == 0)
		m_pageDev.cx = m_totalDev.cx / 10;
	if (m_pageDev.cy == 0)
		m_pageDev.cy = m_totalDev.cy / 10;
	if (m_lineDev.cx == 0)
		m_lineDev.cx = m_pageDev.cx / 10;
	if (m_lineDev.cy == 0)
		m_lineDev.cy = m_pageDev.cy / 10;

	if (m_hWnd != NULL)
	{
		// window has been created, invalidate now
		UpdateBars();
		Invalidate(TRUE);
	}
}

/////////////////////////////////////////////////////////////////////////////
// Getting information

CPoint CLogScrollView::GetScrollPosition() const   // logical coordinates
{
	CPoint pt = GetDeviceScrollPosition();
	// pt may be negative if m_bCenter is set

	CWindowDC dc(NULL);
	dc.SetMapMode(MM_ANISOTROPIC);
	dc.SetWindowExt(1440, 1440);
	dc.SetViewportExt(dc.GetDeviceCaps(LOGPIXELSX),
					-dc.GetDeviceCaps(LOGPIXELSX));
	dc.DPtoLP((LPPOINT)&pt);
	return pt;
}

void CLogScrollView::ScrollToPosition(POINT pt)    // logical coordinates
{
	CWindowDC dc(NULL);
	dc.SetMapMode(MM_ANISOTROPIC);
	dc.SetWindowExt(1440, 1440);
	dc.SetViewportExt(dc.GetDeviceCaps(LOGPIXELSX),
					-dc.GetDeviceCaps(LOGPIXELSX));
	dc.LPtoDP((LPPOINT)&pt);

	// 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;
	else if (pt.x > xMax)
		pt.x = xMax;
	if (pt.y < 0)
		pt.y = 0;
	else if (pt.y > yMax)
		pt.y = yMax;

	ScrollToDevicePosition(pt);
}

CPoint CLogScrollView::GetDeviceScrollPosition() const
{
	CPoint pt(GetScrollPos(SB_HORZ), GetScrollPos(SB_VERT));
	ASSERT(pt.x >= 0 && pt.y >= 0);

	if (m_bCenter)
	{
		CRect rect;
		GetClientRect(&rect);

		// if client area is larger than total device size,
		// the scroll positions are overridden to place origin such that
		// output is centered in the window
		// GetDeviceScrollPosition() must reflect this

		if (m_totalDev.cx < rect.Width())
			pt.x = -((rect.Width() - m_totalDev.cx) / 2);
		if (m_totalDev.cy < rect.Height())
			pt.y = -((rect.Height() - m_totalDev.cy) / 2);
	}

	return pt;
}

void CLogScrollView::ScrollToDevicePosition(POINT ptDev)
{
	ASSERT(ptDev.x >= 0);
	ASSERT(ptDev.y >= 0);

	// Note: ScrollToDevicePosition can and is used to scroll out-of-range
	//  areas as far as CLogScrollView is concerned -- specifically in
	//  the print-preview code.  Since OnScrollBy makes sure the range is
	//  valid, ScrollToDevicePosition does not vector through OnScrollBy.

	int xOrig = GetScrollPos(SB_HORZ);
	SetScrollPos(SB_HORZ, ptDev.x);
	int yOrig = GetScrollPos(SB_VERT);
	SetScrollPos(SB_VERT, ptDev.y);
	ScrollWindow(xOrig - ptDev.x, yOrig - ptDev.y);
}

/////////////////////////////////////////////////////////////////////////////
// Other helpers

void CLogScrollView::FillOutsideRect(CDC* pDC, CBrush* pBrush)
{
	ASSERT_VALID(pDC);
	ASSERT_VALID(pBrush);

	// fill rect outside the image
	CRect rect;
	GetClientRect(rect);
	ASSERT(rect.left == 0 && rect.top == 0);
	rect.left = m_totalDev.cx;
	if (!rect.IsRectEmpty())
		pDC->FillRect(rect, pBrush);    // vertical strip along the side
	rect.left = 0;
	rect.right = m_totalDev.cx;
	rect.top = m_totalDev.cy;
	if (!rect.IsRectEmpty())
		pDC->FillRect(rect, pBrush);    // horizontal strip along the bottom
}

void CLogScrollView::ResizeParentToFit(BOOL bShrinkOnly)
{
	// adjust parent rect so client rect is appropriate size
	// determine current size of the client area as if no scrollbars present
	CRect rectClient;
	GetWindowRect(rectClient);
	CRect rect = rectClient;
	CalcWindowRect(rect);
	rectClient.left += rectClient.left - rect.left;
	rectClient.top += rectClient.top - rect.top;
	rectClient.right -= rect.right - rectClient.right;
	rectClient.bottom -= rect.bottom - rectClient.bottom;
	rectClient.OffsetRect(-rectClient.left, -rectClient.top);
	ASSERT(rectClient.left == 0 && rectClient.top == 0);

	// determine desired size of the view
	CRect rectView(0, 0, m_totalDev.cx, m_totalDev.cy);
	if (bShrinkOnly)
	{
		if (rectClient.right <= m_totalDev.cx)
			rectView.right = rectClient.right;
		if (rectClient.bottom <= m_totalDev.cy)
			rectView.bottom = rectClient.bottom;
	}
	CalcWindowRect(rectView, CWnd::adjustOutside);
	rectView.OffsetRect(-rectView.left, -rectView.top);
	ASSERT(rectView.left == 0 && rectView.top == 0);
	if (bShrinkOnly)
	{
		if (rectClient.right <= m_totalDev.cx)
			rectView.right = rectClient.right;
		if (rectClient.bottom <= m_totalDev.cy)
			rectView.bottom = rectClient.bottom;
	}

	// dermine and set size of frame based on desired size of view
	CRect rectFrame;
	CFrameWnd* pFrame = GetParentFrame();
	ASSERT_VALID(pFrame);
	pFrame->GetWindowRect(rectFrame);
	CSize size = rectFrame.Size();
	size.cx += rectView.right - rectClient.right;
	size.cy += rectView.bottom - rectClient.bottom;
	pFrame->SetWindowPos(NULL, 0, 0, size.cx, size.cy,
		SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
}

/////////////////////////////////////////////////////////////////////////////

void CLogScrollView::OnSize(UINT nType, int cx, int cy)
{
	CView::OnSize(nType, cx, cy);
	UpdateBars();
}

/////////////////////////////////////////////////////////////////////////////
// Scrolling Helpers

void CLogScrollView::CenterOnPoint(CPoint ptCenter) // center in device coords
{
	CRect rect;
	GetClientRect(&rect);           // find size of client window

	int xDesired = ptCenter.x - rect.Width() / 2;
	int yDesired = ptCenter.y - rect.Height() / 2;

	DWORD dwStyle = GetStyle();

	if ((dwStyle & WS_HSCROLL) == 0 || xDesired < 0)
	{
		xDesired = 0;
	}
	else
	{
		int xMax = GetScrollLimit(SB_HORZ);
		if (xDesired > xMax)
			xDesired = xMax;
	}

	if ((dwStyle & WS_VSCROLL) == 0 || yDesired < 0)
	{
		yDesired = 0;
	}
	else
	{
		int yMax = GetScrollLimit(SB_VERT);
		if (yDesired > yMax)
			yDesired = yMax;
	}

	ASSERT(xDesired >= 0);
	ASSERT(yDesired >= 0);

	int xOrig = GetScrollPos(SB_HORZ);
	SetScrollPos(SB_HORZ, xDesired);
	int yOrig = GetScrollPos(SB_VERT);
	SetScrollPos(SB_VERT, yDesired);
}

/////////////////////////////////////////////////////////////////////////////
// Tie to scrollbars and CWnd behaviour

void CLogScrollView::GetScrollBarSizes(CSize& sizeSb)
{
	sizeSb.cx = sizeSb.cy = 0;
	DWORD dwStyle = GetStyle();

	if (GetScrollBarCtrl(SB_VERT) == NULL)
	{
		// vert scrollbars will impact client area of this window
		sizeSb.cx = GetSystemMetrics(SM_CXVSCROLL);
		if (dwStyle & WS_BORDER)
			sizeSb.cx -= CX_BORDER;
	}
	if (GetScrollBarCtrl(SB_HORZ) == NULL)
	{
		// horz scrollbars will impact client area of this window
		sizeSb.cy = GetSystemMetrics(SM_CYVSCROLL);
		if (dwStyle & WS_BORDER)
			sizeSb.cy -= CY_BORDER;
	}
}

BOOL CLogScrollView::GetTrueClientSize(CSize& size, CSize& sizeSb)
	// return TRUE if enough room to add scrollbars if needed
{
	CRect rect;
	GetClientRect(&rect);
	ASSERT(rect.top == 0 && rect.left == 0);
	size.cx = rect.right;
	size.cy = rect.bottom;
	DWORD dwStyle = GetStyle();

	// first get the size of the scrollbars for this window
	GetScrollBarSizes(sizeSb);

	// first calculate the size of a potential scrollbar
	// (scroll bar controls do not get turned on/off)
	if (sizeSb.cx != 0 && (dwStyle & WS_VSCROLL))
	{
		// vert scrollbars will impact client area of this window
		size.cx += sizeSb.cx;   // currently on - adjust now
	}
	if (sizeSb.cy != 0 && (dwStyle & WS_HSCROLL))
	{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美电影一区二区| 亚洲免费毛片网站| av不卡在线观看| 麻豆一区二区在线| 亚洲日本va在线观看| 日韩精品一区二区三区在线观看 | 亚洲综合视频在线观看| 久久午夜老司机| 欧美日本在线视频| 91在线观看下载| 国产资源精品在线观看| 亚洲成在人线在线播放| 亚洲婷婷综合久久一本伊一区| 日韩精品在线一区二区| 欧美精品日日鲁夜夜添| av电影天堂一区二区在线 | 欧美在线免费观看视频| 国产成人在线色| 久热成人在线视频| 五月婷婷色综合| 亚洲狠狠丁香婷婷综合久久久| 中文欧美字幕免费| 国产午夜三级一区二区三| 日韩午夜电影在线观看| 欧美日韩一级二级| 色吧成人激情小说| 91网站最新地址| 99国产精品国产精品毛片| 国产精品一区二区免费不卡 | 91啪九色porn原创视频在线观看| 国产成+人+日韩+欧美+亚洲| 精品一区二区久久| 奇米777欧美一区二区| 日韩av中文字幕一区二区三区| 亚洲制服丝袜一区| 亚洲午夜国产一区99re久久| 亚洲精选免费视频| 一区二区三区加勒比av| 一区二区三区成人| 一级特黄大欧美久久久| 亚洲一线二线三线视频| 一区二区三区自拍| 亚洲在线中文字幕| 亚洲国产精品欧美一二99| 亚洲精品日韩一| 亚洲永久免费av| 午夜精品成人在线视频| 日韩av中文字幕一区二区三区| 美女爽到高潮91| 国产一区二区三区高清播放| 4438亚洲最大| 欧美一二三四区在线| 日韩精品一区二| 日本一区二区三区在线观看| 中文字幕一区二区三区四区不卡 | 欧美激情一区在线| 亚洲同性同志一二三专区| 怡红院av一区二区三区| 日韩成人一级片| 久久精品久久综合| 懂色av一区二区三区免费看| av电影天堂一区二区在线观看| 欧美影视一区二区三区| 欧美一级国产精品| 亚洲国产成人自拍| 亚洲一区二区av在线| 久久精品久久久精品美女| 成人精品国产一区二区4080| 99re视频这里只有精品| 欧美日韩一区二区在线观看视频| 6080国产精品一区二区| 久久久亚洲精品石原莉奈| 国产精品九色蝌蚪自拍| 三级欧美在线一区| 国产福利不卡视频| 欧美日韩中文字幕一区二区| 亚洲精品一区二区三区福利| 亚洲特黄一级片| 麻豆精品在线播放| 成人免费av网站| 欧美精品一二三区| 久久综合精品国产一区二区三区| 日韩一区在线免费观看| 奇米色一区二区| 91色|porny| www激情久久| 亚洲尤物视频在线| 顶级嫩模精品视频在线看| 欧美日韩免费一区二区三区视频| 久久综合999| 亚洲午夜久久久久久久久电影网 | 91丨porny丨国产| 日韩欧美国产1| 亚洲男人电影天堂| 国产乱国产乱300精品| 欧美日韩aaaaa| 亚洲女同一区二区| 国产久卡久卡久卡久卡视频精品| 欧洲亚洲精品在线| 国产欧美精品一区| 麻豆视频一区二区| 欧美日韩一区 二区 三区 久久精品| 国产欧美日韩三级| 久久精品国产亚洲a| 欧美色综合天天久久综合精品| 国产欧美一区二区精品仙草咪| 丝瓜av网站精品一区二区| 91一区二区三区在线观看| 久久久久久一二三区| 蜜臀av性久久久久蜜臀av麻豆 | 91视频www| 国产日产精品1区| 精品一区二区三区av| 日韩一区二区三区四区| 一区二区免费在线播放| av男人天堂一区| 国产亚洲1区2区3区| 精东粉嫩av免费一区二区三区 | 亚洲三级免费观看| 国产69精品久久久久毛片| 日韩视频一区二区在线观看| 亚洲成人一二三| 欧美三级三级三级| 亚洲男人的天堂av| 99久久精品情趣| 1024成人网| 色综合天天综合网天天狠天天| 国产精品嫩草影院com| 国产成人精品午夜视频免费| 久久精品亚洲精品国产欧美kt∨ | 欧美国产国产综合| 国产一区二区主播在线| 欧美变态tickling挠脚心| 青草av.久久免费一区| 欧美一区二区高清| 美女网站色91| www久久久久| 国产成人免费9x9x人网站视频| 国产欧美一区二区三区在线老狼| 国产成人综合亚洲91猫咪| 久久免费视频色| 成人丝袜视频网| 中文字幕在线免费不卡| 色88888久久久久久影院野外| 亚洲午夜羞羞片| 日韩视频免费直播| 国产黄色91视频| 综合分类小说区另类春色亚洲小说欧美| fc2成人免费人成在线观看播放| 中文字幕一区二区日韩精品绯色| 色婷婷一区二区三区四区| 亚洲一区二区不卡免费| 69堂精品视频| 激情五月婷婷综合| 欧美精彩视频一区二区三区| av在线播放一区二区三区| 亚洲精品水蜜桃| 欧美精选在线播放| 国内精品嫩模私拍在线| 中文字幕精品三区| 91成人免费电影| 日本一道高清亚洲日美韩| 337p日本欧洲亚洲大胆精品| 99麻豆久久久国产精品免费优播| 亚洲综合在线观看视频| 日韩一级免费观看| 粉嫩高潮美女一区二区三区| 亚洲精品久久久蜜桃| 欧美精品免费视频| 国产精品一区三区| 一区二区三区四区在线| 日韩美女一区二区三区| 成人激情图片网| 午夜久久电影网| 久久久国产精品午夜一区ai换脸| 色综合咪咪久久| 激情都市一区二区| 亚洲精品网站在线观看| 日韩精品一区二区在线| 97精品久久久午夜一区二区三区| 日韩av高清在线观看| 国产精品国产精品国产专区不片| 欧美日韩一区国产| 粉嫩一区二区三区性色av| 亚洲成人av在线电影| 国产亚洲人成网站| 欧美日韩aaaaaa| 波多野结衣在线aⅴ中文字幕不卡| 午夜精品福利视频网站| 国产精品久久久久桃色tv| 日韩欧美区一区二| 91久久奴性调教| 国产精品伊人色| 婷婷国产v国产偷v亚洲高清| 中文字幕av一区二区三区高| 日韩亚洲欧美综合| 日本精品一区二区三区四区的功能| 精品一区二区在线视频| 亚洲一区av在线| 国产精品视频在线看|