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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? logscr~1.cpp

?? InsideVC++配套源碼之三
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// 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))
	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产自产拍在线| 国产精品一区二区三区网站| 国产91丝袜在线播放| 国产一区二区不卡在线| 裸体健美xxxx欧美裸体表演| 欧美精品一区二区久久久| 日韩成人精品在线| 中文字幕不卡在线观看| 欧美三级乱人伦电影| 亚洲激情图片一区| 欧美一区二区视频在线观看2020| 欧美sm美女调教| 制服丝袜一区二区三区| 一本久久精品一区二区| 国产精品久久二区二区| 日本一区二区三区四区在线视频 | 成人欧美一区二区三区小说| 日韩精品每日更新| 中文字幕一区二区三区精华液| 一本大道久久a久久精品综合| 国产欧美精品一区二区色综合朱莉 | 激情五月激情综合网| 欧美一区在线视频| 欧美一区二区私人影院日本| 91麻豆国产在线观看| 色婷婷精品大在线视频| 欧美亚洲综合在线| 欧美高清在线一区二区| 美女被吸乳得到大胸91| 国产成人鲁色资源国产91色综| 美国三级日本三级久久99| 亚洲国产精品传媒在线观看| 欧美日韩亚洲不卡| 国产精品66部| 亚洲va在线va天堂| 日韩码欧中文字| 欧美老女人在线| 在线观看日韩电影| 国产一区二区三区黄视频 | 欧美色中文字幕| 91国偷自产一区二区三区成为亚洲经典| 在线亚洲人成电影网站色www| 7777精品伊人久久久大香线蕉 | 亚洲影视在线观看| 亚洲精品一二三四区| 亚洲精品一区二区三区福利 | 日韩影视精彩在线| 久久综合中文字幕| 日韩视频一区二区在线观看| 国产一区二区三区免费播放 | 亚洲精品乱码久久久久久久久 | 久久久久成人黄色影片| 国产成人a级片| 国产精品三级在线观看| 国模冰冰炮一区二区| 91精品一区二区三区久久久久久| 午夜精品久久久久久久久久久| 91福利在线播放| 天堂久久一区二区三区| 欧美视频三区在线播放| 秋霞午夜鲁丝一区二区老狼| 欧美一区二区视频在线观看2020| 理论电影国产精品| 国产精品毛片a∨一区二区三区| 成人精品高清在线| 一区二区三区中文字幕电影| 欧美一级久久久久久久大片| 美腿丝袜亚洲一区| 日本一区二区三区久久久久久久久不 | 日韩亚洲欧美综合| 亚洲一区二三区| 欧美亚洲国产一卡| 日韩精品自拍偷拍| 久久亚洲精品国产精品紫薇| 欧美一区二区三区视频免费 | 精品中文av资源站在线观看| 精品国产免费视频| 91农村精品一区二区在线| 日精品一区二区| 中文字幕亚洲欧美在线不卡| 欧美日韩另类一区| 国产成人在线视频网站| 亚洲最大成人网4388xx| 精品日韩一区二区三区免费视频| 亚洲成人av福利| 成人毛片老司机大片| 26uuu亚洲综合色| 国产在线视视频有精品| 日韩一区二区电影网| 首页国产欧美久久| 日韩一区二区三免费高清| 美脚の诱脚舐め脚责91| 在线看日本不卡| 婷婷国产v国产偷v亚洲高清| 久久久久高清精品| 欧美日韩另类一区| 在线精品视频小说1| 国产精品一区二区x88av| 亚洲一区二区不卡免费| 久久色成人在线| 日韩欧美一二区| 欧美日韩免费视频| 成人丝袜高跟foot| 老汉av免费一区二区三区| 亚洲福利电影网| 国产精品成人网| 国产午夜精品一区二区三区嫩草 | 91精品国产欧美一区二区成人 | av一区二区久久| 国产精品一区二区x88av| 日韩综合在线视频| 亚洲欧美日韩久久| 欧美成人女星排名| 久久综合狠狠综合久久综合88 | 天堂va蜜桃一区二区三区漫画版 | 中文字幕一区二区三区精华液| 欧美久久高跟鞋激| 欧美午夜不卡在线观看免费| www.日韩在线| 国产在线观看一区二区| 国产精品综合久久| 国内外成人在线| 1区2区3区国产精品| 亚洲精品国产精华液| 国产伦精一区二区三区| 国产伦精品一区二区三区在线观看| 精品一区二区综合| 日韩二区在线观看| 麻豆成人免费电影| 91亚洲国产成人精品一区二区三 | 国产大片一区二区| 欧美电影免费观看高清完整版| 日韩精品免费视频人成| 日韩欧美一区二区三区在线| 激情五月激情综合网| 2021国产精品久久精品| jlzzjlzz亚洲女人18| 亚洲欧美一区二区不卡| 成人午夜视频福利| 欧洲精品中文字幕| 亚洲女人****多毛耸耸8| 韩国av一区二区三区四区| 日韩小视频在线观看专区| 一区二区成人在线观看| 成人污视频在线观看| 欧美不卡在线视频| 亚洲电影欧美电影有声小说| 狠狠色狠狠色综合系列| 久久久久久久免费视频了| 日韩一级二级三级| 欧美激情一区二区在线| 一区二区三区不卡视频在线观看 | 日韩欧美高清dvd碟片| 国产精品色婷婷| 日韩avvvv在线播放| 成人激情综合网站| 91精品国产一区二区人妖| 国产欧美日韩卡一| 免费高清视频精品| 色婷婷亚洲综合| 国产清纯美女被跳蛋高潮一区二区久久w| 国产精品不卡在线| 精彩视频一区二区| 欧美色综合网站| 中文字幕一区日韩精品欧美| 久久激情综合网| 欧美午夜精品一区二区蜜桃| 国产精品免费av| 久久疯狂做爰流白浆xx| 欧美色男人天堂| 欧美高清在线精品一区| 九九**精品视频免费播放| 欧美专区日韩专区| 中文字幕不卡在线观看| 狠狠色丁香婷婷综合| 欧美精品在线一区二区三区| 一区二区中文字幕在线| 国产一区二区三区免费在线观看 | 欧美色精品在线视频| 国产精品色哟哟网站| 国产精一区二区三区| 日韩精品一区二区三区三区免费| 一区二区三区加勒比av| 91影视在线播放| 国产精品无码永久免费888| 国产精品一区二区久久精品爱涩| 日韩一区二区免费电影| 天天影视涩香欲综合网| 欧美视频一区二区在线观看| 亚洲天堂精品在线观看| av资源网一区| 国产精品乱码人人做人人爱| 国产高清亚洲一区| 久久一夜天堂av一区二区三区| 视频一区视频二区在线观看| 成人aaaa免费全部观看| 国产一区二区三区在线观看免费视频 | 国产福利不卡视频| 亚洲国产精品影院| 2017欧美狠狠色|