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

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

?? scribvw.cpp

?? 侯捷大師的《深入淺出MFC》的scribble源代碼
?? CPP
字號:
// ScribVw.cpp : implementation of the CScribbleView class
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1995 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#include "stdafx.h"
#include "Scribble.h"

#include "ScribDoc.h"
#include "ScribVw.h"

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

/////////////////////////////////////////////////////////////////////////////
// CScribbleView

IMPLEMENT_DYNCREATE(CScribbleView, CScrollView)

BEGIN_MESSAGE_MAP(CScribbleView, CScrollView)
	//{{AFX_MSG_MAP(CScribbleView)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_MOUSEMOVE()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CScribbleView construction/destruction

CScribbleView::CScribbleView()
{
	// TODO: add construction code here

}

CScribbleView::~CScribbleView()
{
}

BOOL CScribbleView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CScribbleView drawing

void CScribbleView::OnDraw(CDC* pDC)
{
	CScribbleDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// Get the invalidated rectangle of the view, or in the case
	// of printing, the clipping region of the printer dc.
	CRect rectClip;
	CRect rectStroke;
	pDC->GetClipBox(&rectClip);

	// Note: CScrollView::OnPaint() will have already adjusted the
	// viewport origin before calling OnDraw(), to reflect the
	// currently scrolled position.

	// The view delegates the drawing of individual strokes to
	// CStroke::DrawStroke().
	CTypedPtrList<CObList,CStroke*>& strokeList = pDoc->m_strokeList;
	POSITION pos = strokeList.GetHeadPosition();
	while (pos != NULL)
	{
		CStroke* pStroke = strokeList.GetNext(pos);
		rectStroke = pStroke->GetBoundingRect();
		if (!rectStroke.IntersectRect(&rectStroke, &rectClip))
			continue;
		pStroke->DrawStroke(pDC);
	}
}

/////////////////////////////////////////////////////////////////////////////
// CScribbleView printing

BOOL CScribbleView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CScribbleView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CScribbleView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CScribbleView diagnostics

#ifdef _DEBUG
void CScribbleView::AssertValid() const
{
	CScrollView::AssertValid();
}

void CScribbleView::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}

CScribbleDoc* CScribbleView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CScribbleDoc)));
	return (CScribbleDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CScribbleView message handlers

void CScribbleView::OnLButtonDown(UINT, CPoint point) 
{
    // Pressing the mouse button in the view window starts a new stroke

	// CScrollView changes the viewport origin and mapping mode.
	// It's necessary to convert the point from device coordinates
	// to logical coordinates, such as are stored in the document.
	CClientDC dc(this);
	OnPrepareDC(&dc);
	dc.DPtoLP(&point);

	m_pStrokeCur = GetDocument()->NewStroke();
	// Add first point to the new stroke
	m_pStrokeCur->m_pointArray.Add(point);

	SetCapture();       // Capture the mouse until button up.
	m_ptPrev = point;   // Serves as the MoveTo() anchor point for the
						// LineTo() the next point, as the user drags the
						// mouse.

	return;
}

void CScribbleView::OnLButtonUp(UINT, CPoint point) 
{
	// Mouse button up is interesting in the Scribble application
	// only if the user is currently drawing a new stroke by dragging
	// the captured mouse.

	if (GetCapture() != this)
		return; // If this window (view) didn't capture the mouse,
				// then the user isn't drawing in this window.

	CScribbleDoc* pDoc = GetDocument();

	CClientDC dc(this);

	// CScrollView changes the viewport origin and mapping mode.
	// It's necessary to convert the point from device coordinates
	// to logical coordinates, such as are stored in the document.
	OnPrepareDC(&dc);  // set up mapping mode and viewport origin
	dc.DPtoLP(&point);

	CPen* pOldPen = dc.SelectObject(pDoc->GetCurrentPen());
	dc.MoveTo(m_ptPrev);
	dc.LineTo(point);
	dc.SelectObject(pOldPen);
	m_pStrokeCur->m_pointArray.Add(point);

	// Tell the stroke item that we're done adding points to it.
	// This is so it can finish computing its bounding rectangle.
	m_pStrokeCur->FinishStroke();

	// Tell the other views that this stroke has been added
	// so that they can invalidate this stroke's area in their
	// client area.
	pDoc->UpdateAllViews(this, 0L, m_pStrokeCur);

	ReleaseCapture();   // Release the mouse capture established at
						// the beginning of the mouse drag.
	return;
}

void CScribbleView::OnMouseMove(UINT, CPoint point) 
{
	// Mouse movement is interesting in the Scribble application
	// only if the user is currently drawing a new stroke by dragging
	// the captured mouse.

	if (GetCapture() != this)
		return; // If this window (view) didn't capture the mouse,
				// then the user isn't drawing in this window.

	CClientDC dc(this);
	// CScrollView changes the viewport origin and mapping mode.
	// It's necessary to convert the point from device coordinates
	// to logical coordinates, such as are stored in the document.
	OnPrepareDC(&dc);
	dc.DPtoLP(&point);

	m_pStrokeCur->m_pointArray.Add(point);

	// Draw a line from the previous detected point in the mouse
	// drag to the current point.
	CPen* pOldPen = dc.SelectObject(GetDocument()->GetCurrentPen());
	dc.MoveTo(m_ptPrev);
	dc.LineTo(point);
	dc.SelectObject(pOldPen);
	m_ptPrev = point;
	return;
}

void CScribbleView::OnUpdate(CView* /* pSender */, LPARAM /* lHint */, 
	CObject* pHint) 
{
	// The document has informed this view that some data has changed.

	if (pHint != NULL)
	{
		if (pHint->IsKindOf(RUNTIME_CLASS(CStroke)))
		{
			// The hint is that a stroke as been added (or changed).
			// So, invalidate its rectangle.
			CStroke* pStroke = (CStroke*)pHint;
			CClientDC dc(this);
			OnPrepareDC(&dc);
			CRect rectInvalid = pStroke->GetBoundingRect();
			dc.LPtoDP(&rectInvalid);
			InvalidateRect(&rectInvalid);
			return;
		}
	}
	// We can't interpret the hint, so assume that anything might
	// have been updated.
	Invalidate(TRUE);
	return;
}

void CScribbleView::OnInitialUpdate() 
{
	SetScrollSizes(MM_TEXT, GetDocument()->GetDocSize());
	CScrollView::OnInitialUpdate();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看亚洲精品视频| 日本伊人色综合网| 成人免费高清视频| 国产午夜精品一区二区三区嫩草| 麻豆成人久久精品二区三区小说| 日韩一区二区三区高清免费看看| 青草国产精品久久久久久| 日韩欧美成人激情| 国产一区二区三区黄视频| 日本一区二区三区视频视频| 成人免费av在线| 亚洲夂夂婷婷色拍ww47| 欧美一区二区三区影视| 国产一区二区伦理| 日韩一区欧美一区| 337p亚洲精品色噜噜| 久久精品国产免费| 中文字幕在线观看一区| 欧美日韩免费高清一区色橹橹| 蜜桃av噜噜一区二区三区小说| 久久久久国产精品麻豆| 欧美性色黄大片| 国产一区二区三区四区五区美女| 成人欧美一区二区三区视频网页 | 色婷婷亚洲一区二区三区| 亚洲一区二区欧美激情| 精品国产91久久久久久久妲己| 国产精品1区2区| 亚洲影院免费观看| 日韩欧美成人午夜| 久久精品日产第一区二区三区高清版| 成人精品一区二区三区中文字幕| 亚洲五月六月丁香激情| 久久久国产午夜精品| 欧美日韩一区视频| 成人伦理片在线| 美女免费视频一区二区| 亚洲视频香蕉人妖| 久久久av毛片精品| 欧美三级日韩三级| 高清国产一区二区三区| 日韩有码一区二区三区| 国产精品久久久久国产精品日日| 7777精品伊人久久久大香线蕉的| 成人久久视频在线观看| 日韩国产欧美在线观看| 综合av第一页| 国产亚洲欧美激情| 欧美电视剧在线看免费| 在线看国产一区二区| 高清beeg欧美| 狠狠久久亚洲欧美| 天天综合色天天综合| 亚洲欧美综合另类在线卡通| 久久综合色综合88| 日韩免费视频一区| 欧美精品视频www在线观看| 久久精品国产一区二区三区免费看| 欧美日韩亚洲不卡| 国产精品一区在线| 亚洲自拍偷拍九九九| 中文字幕日韩一区二区| 国产亚洲综合色| 日韩欧美专区在线| 91精品国产欧美一区二区18| 9久草视频在线视频精品| 粉嫩欧美一区二区三区高清影视| 九一久久久久久| 蜜臀久久99精品久久久久宅男| 亚洲狠狠丁香婷婷综合久久久| 国产精品网站在线| 亚洲国产精品精华液2区45| 精品欧美一区二区在线观看| 欧美一区二区精品在线| 欧美日韩精品一区二区三区蜜桃| 欧美视频一区二区三区| 91成人看片片| 欧美日韩极品在线观看一区| 欧美日韩国产精品自在自线| 欧美性三三影院| 欧美日韩一区二区不卡| 欧美日韩情趣电影| 欧美一级专区免费大片| 欧美顶级少妇做爰| 日韩精品一区二区三区在线| 欧美大黄免费观看| 久久精品一二三| 亚洲国产电影在线观看| 国产精品蜜臀av| 中文字幕综合网| 一区二区三区不卡视频在线观看| 亚洲精品成a人| 五月激情六月综合| 国产自产v一区二区三区c| 国产超碰在线一区| 国产高清久久久久| 99久久精品久久久久久清纯| 欧美中文字幕不卡| 欧美一级黄色录像| 国产亚洲综合av| 亚洲欧美另类在线| 天天色图综合网| 国产一区二区成人久久免费影院| av一区二区三区| 欧美亚洲另类激情小说| 欧美一级视频精品观看| 久久99精品网久久| 粉嫩欧美一区二区三区高清影视| 一本色道亚洲精品aⅴ| 日韩欧美精品在线视频| 欧美高清一级片在线观看| 一区二区三区四区精品在线视频| 蜜臀精品一区二区三区在线观看| 国产麻豆精品在线| 欧美在线看片a免费观看| 在线综合亚洲欧美在线视频| 久久精品免视看| 亚洲综合清纯丝袜自拍| 精品无人码麻豆乱码1区2区 | 成人高清在线视频| 欧美日韩亚洲不卡| 日本一区二区三区免费乱视频 | 成人欧美一区二区三区白人| 日本va欧美va瓶| 一本大道av伊人久久综合| 日韩三级免费观看| 亚洲欧美综合在线精品| 久久电影网电视剧免费观看| 91视频免费播放| www亚洲一区| 亚洲成av人片一区二区三区 | 久久99精品久久久久| 91视频观看免费| 久久久久久久综合日本| 午夜一区二区三区视频| 风间由美一区二区三区在线观看| 欧美美女直播网站| 亚洲天堂av一区| 成人免费视频app| 26uuu国产一区二区三区| 亚洲成人一区二区在线观看| 波多野结衣欧美| 久久亚区不卡日本| 麻豆精品一区二区av白丝在线| 91美女蜜桃在线| 亚洲国产精品av| 国内成+人亚洲+欧美+综合在线| 欧美日韩久久不卡| 亚洲韩国精品一区| 色乱码一区二区三区88| 亚洲欧美综合另类在线卡通| 粉嫩在线一区二区三区视频| 2017欧美狠狠色| 精品一二三四区| 日韩欧美成人一区| 毛片av中文字幕一区二区| 制服.丝袜.亚洲.另类.中文| 一区二区三区高清| 欧美中文字幕一区二区三区| 亚洲精品综合在线| 一本一道久久a久久精品综合蜜臀| 久久久久国产一区二区三区四区| 久久99国内精品| 日韩欧美成人激情| 激情久久久久久久久久久久久久久久| 91精品中文字幕一区二区三区| 亚洲大片一区二区三区| 欧美主播一区二区三区美女| 亚洲丝袜美腿综合| 91精品福利在线| 亚洲成人tv网| 777奇米四色成人影色区| 视频一区在线视频| 91麻豆精品国产自产在线观看一区 | 亚洲色图欧洲色图婷婷| 99热这里都是精品| 亚洲精品精品亚洲| 欧美三级资源在线| 日本欧美肥老太交大片| 日韩欧美国产一区二区三区| 精品一区二区三区日韩| 久久婷婷综合激情| 国产99久久久久| 国产精品国产三级国产专播品爱网| 成人黄色大片在线观看| 一区二区免费看| 337p亚洲精品色噜噜| 国产一区二区三区四区五区美女 | 91.com视频| 伦理电影国产精品| 久久久精品蜜桃| 日本韩国一区二区| 蜜臀久久久久久久| 国产丝袜欧美中文另类| 91亚洲精品久久久蜜桃| 亚洲国产视频a| 精品美女在线播放| 99精品视频在线观看| 亚洲成人三级小说| 久久女同精品一区二区|