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

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

?? logscr~1.cpp

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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久综合| 国产精品一区二区在线观看不卡| 国产精品乱码人人做人人爱| wwww国产精品欧美| 精品国产一区二区在线观看| 日韩欧美国产电影| 欧美不卡在线视频| 精品国产乱码久久久久久牛牛| 精品日韩成人av| 26uuuu精品一区二区| 久久久久久久综合狠狠综合| 日本一区二区三区四区| 中文字幕精品三区| 亚洲色图欧美偷拍| 亚洲一区二区三区四区在线| 午夜欧美电影在线观看| 日本不卡123| 国产一区亚洲一区| 高清成人在线观看| 色老综合老女人久久久| 欧美人伦禁忌dvd放荡欲情| 欧美老年两性高潮| 欧美变态口味重另类| 国产亚洲欧美一区在线观看| 中文字幕中文字幕一区| 一区二区三区波多野结衣在线观看 | 色伊人久久综合中文字幕| 在线亚洲免费视频| 777午夜精品免费视频| 精品久久国产老人久久综合| 国产欧美日韩视频在线观看| 亚洲精品国产第一综合99久久 | 天堂蜜桃一区二区三区| 精品制服美女丁香| 成人av网站在线观看| 91麻豆123| 欧美一卡2卡3卡4卡| 久久久噜噜噜久久人人看| 17c精品麻豆一区二区免费| 亚洲国产精品一区二区www在线| 蜜臀va亚洲va欧美va天堂| 国产成人av影院| 欧美日韩亚洲另类| 久久新电视剧免费观看| 国产精品成人免费| 美女脱光内衣内裤视频久久影院| 成人性色生活片免费看爆迷你毛片| 91在线视频18| 日韩欧美一二区| 中文字幕制服丝袜成人av | 欧美三级视频在线| 精品88久久久久88久久久| 亚洲欧美激情插 | 精品国产一区二区三区不卡| 国产精品高潮久久久久无| 亚洲成av人片一区二区| 国产高清一区日本| 欧美日韩免费在线视频| 国产日韩欧美a| 五月天精品一区二区三区| 国产盗摄一区二区三区| 777精品伊人久久久久大香线蕉| 日本一区二区三区高清不卡| 日韩av在线播放中文字幕| www.在线欧美| 亚洲精品在线观看网站| 亚洲v日本v欧美v久久精品| 成人精品视频.| 日韩欧美二区三区| 亚洲一二三四在线观看| 成人a区在线观看| 久久综合久久久久88| 亚洲成年人网站在线观看| aaa国产一区| 久久夜色精品国产欧美乱极品| 亚洲不卡一区二区三区| 99久久精品费精品国产一区二区| 精品国产一区二区三区av性色| 亚洲成人av一区二区三区| 91亚洲精品一区二区乱码| 久久久久久久国产精品影院| 麻豆极品一区二区三区| 欧美电影在线免费观看| 亚洲精品菠萝久久久久久久| 成人教育av在线| 国产偷国产偷精品高清尤物| 麻豆国产精品777777在线| 欧美日韩免费观看一区二区三区 | 亚洲一区成人在线| 色网综合在线观看| 亚洲视频一二区| 99精品在线免费| 国产精品日韩精品欧美在线| 国产高清在线观看免费不卡| 久久久久久电影| 国产精品小仙女| 久久九九全国免费| 国产露脸91国语对白| 久久午夜色播影院免费高清| 国产永久精品大片wwwapp | 亚洲小少妇裸体bbw| 91丨九色丨蝌蚪富婆spa| 18涩涩午夜精品.www| 91天堂素人约啪| 亚洲美女精品一区| 一本久久综合亚洲鲁鲁五月天| 国产精品欧美一区喷水| 99免费精品视频| 综合网在线视频| 色婷婷综合久久久| 亚洲小说春色综合另类电影| 欧美片在线播放| 日本欧美韩国一区三区| 日韩欧美高清一区| 国产伦精品一区二区三区视频青涩| 精品国产一区二区三区四区四| 国产一区激情在线| 国产亚洲欧洲997久久综合 | 4438成人网| 免费成人美女在线观看.| 欧美大片在线观看一区| 国产在线精品免费| 国产亚洲综合色| gogo大胆日本视频一区| 夜夜嗨av一区二区三区中文字幕 | 欧亚一区二区三区| 天使萌一区二区三区免费观看| 日韩欧美黄色影院| 国产成人精品一区二区三区四区| 国产精品午夜免费| 色天使色偷偷av一区二区| 亚洲午夜电影网| 日韩视频一区二区三区| 粉嫩aⅴ一区二区三区四区| 亚洲色图欧美偷拍| 欧美一区二区三区思思人| 国产露脸91国语对白| 亚洲黄色免费网站| 日韩免费高清av| 国产91在线看| 亚洲高清免费一级二级三级| 精品三级在线看| 成人免费毛片a| 婷婷丁香激情综合| 日本一区二区三区dvd视频在线| 欧美在线观看视频一区二区| 奇米色一区二区| 国产精品卡一卡二| 欧美美女视频在线观看| 国产高清无密码一区二区三区| 一区二区三区电影在线播| 2023国产精品| 在线亚洲高清视频| 国内精品第一页| 亚洲高清免费在线| 欧美国产日产图区| 欧美一区二区三区喷汁尤物| 成人黄色一级视频| 免费成人在线影院| 亚洲女同女同女同女同女同69| 日韩欧美不卡在线观看视频| 色综合久久久久久久| 国产乱人伦精品一区二区在线观看| 亚洲伊人色欲综合网| 国产女人aaa级久久久级 | 国产欧美视频一区二区三区| 欧美日本在线看| 99久久久久久| 国产美女在线观看一区| 石原莉奈在线亚洲二区| 亚洲人成在线播放网站岛国| 精品国产123| 欧美日韩免费不卡视频一区二区三区| 大尺度一区二区| 看电视剧不卡顿的网站| 一区二区三区免费| 亚洲欧洲国产日本综合| 久久综合九色综合97婷婷女人| 69堂成人精品免费视频| 一本久久综合亚洲鲁鲁五月天 | 午夜精品久久久久久久99水蜜桃| 亚洲国产精品传媒在线观看| 欧美一区二区视频观看视频| 欧美做爰猛烈大尺度电影无法无天| 国产不卡视频在线观看| 美女爽到高潮91| 日韩成人午夜电影| 亚洲自拍偷拍欧美| 136国产福利精品导航| 日本一区免费视频| 久久精品这里都是精品| 精品久久国产字幕高潮| 欧美一级国产精品| 在线不卡a资源高清| 91福利精品视频| 99re成人精品视频| 成人av资源下载| 成人性色生活片| 成人一区在线看| 成人午夜免费电影|