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

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

?? axclientview.cpp

?? VisualC++實踐與提高-ActiveX篇源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// AxClientView.cpp : implementation of the CAxClientView class
//

#include "stdafx.h"
#include "AxClient.h"

#include "AxClientDoc.h"
#include "CntrItem.h"
#include "AxClientView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAxClientView

IMPLEMENT_DYNCREATE(CAxClientView, CScrollView)

BEGIN_MESSAGE_MAP(CAxClientView, CScrollView)
	//{{AFX_MSG_MAP(CAxClientView)
	ON_WM_DESTROY()
	ON_WM_SETFOCUS()
	ON_WM_SIZE()
	ON_COMMAND(ID_OLE_INSERT_NEW, OnInsertObject)
	ON_COMMAND(ID_CANCEL_EDIT_CNTR, OnCancelEditCntr)
	ON_WM_SETCURSOR()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONDBLCLK()
	ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
	ON_COMMAND(ID_EDIT_DEL, OnEditDel)
	ON_UPDATE_COMMAND_UI(ID_EDIT_DEL, OnUpdateEditDel)
	ON_COMMAND(ID_EDIT_CUT, OnEditCut)
	ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnUpdateEditCut)
	ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
	ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy)
	ON_COMMAND(ID_EDIT_PASTE_SPECIAL, OnEditPasteSpecial)
	ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE_SPECIAL, OnUpdateEditPasteSpecial)
	ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, OnUpdateEditPaste)
	ON_COMMAND(ID_EDIT_PASTE_LINK, OnEditPasteLink)
	ON_COMMAND(ID_OLE_EDIT_PROPERTIES, OnOleEditProperties)
	ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_PROPERTIES, OnUpdateOleEditProperties)
	ON_WM_RBUTTONDOWN()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()

CLIPFORMAT CAxClientView::m_cfObjectDescriptor=NULL;

/////////////////////////////////////////////////////////////////////////////
// CAxClientView construction/destruction

CAxClientView::CAxClientView()
{
	m_pSelection = NULL;
	// TODO: add construction code here
	if (m_cfObjectDescriptor == NULL)
		m_cfObjectDescriptor =
			(CLIPFORMAT)::RegisterClipboardFormat(_T("Object Descriptor"));

	m_pSelection = NULL;

}

CAxClientView::~CAxClientView()
{
}

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

	return CScrollView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAxClientView drawing

void CAxClientView::OnDraw(CDC* pDC)
{
	CAxClientDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	// TODO: also draw all OLE items in the document

	// Draw the selection at an arbitrary position.  This code should be
	//  removed once your real drawing code is implemented.  This position
	//  corresponds exactly to the rectangle returned by CAxClientCntrItem,
	//  to give the effect of in-place editing.

	// TODO: remove this code when final draw code is complete.
/*
	if (m_pSelection == NULL)
	{
		POSITION pos = pDoc->GetStartPosition();
		m_pSelection = (CAxClientCntrItem*)pDoc->GetNextClientItem(pos);
	}
	if (m_pSelection != NULL)
		m_pSelection->Draw(pDC, CRect(10, 10, 210, 210));
*/
	POSITION pos=pDoc->GetStartPosition();
	while(pos!=NULL)
	{
		CAxClientCntrItem* pItem=(CAxClientCntrItem*)pDoc->GetNextItem(pos);
		if(pItem == NULL) 
			break;

		//	繪制對象
		CRect rect=CRect(pItem->m_ptPos,pItem->m_sizeCur);
		pItem->Draw(pDC,rect);

		//	繪制對象的跟蹤矩形
		CRectTracker tracker;
		SetupTracker(&tracker,pItem);
		tracker.Draw(pDC);
	}
}

void CAxClientView::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();


	// TODO: remove this code when final selection model code is written
	m_pSelection = NULL;    // initialize selection

	CSize sizeTotal;
	// TODO: calculate the total size of this view
	sizeTotal.cx = sizeTotal.cy = 100;
	SetScrollSizes(MM_TEXT, sizeTotal);
}

/////////////////////////////////////////////////////////////////////////////
// CAxClientView printing

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

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

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

void CAxClientView::OnDestroy()
{
	// Deactivate the item on destruction; this is important
	// when a splitter view is being used.
   CScrollView::OnDestroy();
   COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
   if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
   {
      pActiveItem->Deactivate();
      ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
   }
}


/////////////////////////////////////////////////////////////////////////////
// OLE Client support and commands

BOOL CAxClientView::IsSelected(const CObject* pDocItem) const
{
	// The implementation below is adequate if your selection consists of
	//  only CAxClientCntrItem objects.  To handle different selection
	//  mechanisms, the implementation here should be replaced.

	// TODO: implement this function that tests for a selected OLE client item

	return pDocItem == m_pSelection;
}

void CAxClientView::OnInsertObject()
{
	// Invoke the standard Insert Object dialog box to obtain information
	//  for new CAxClientCntrItem object.
	COleInsertDialog dlg;
	if (dlg.DoModal() != IDOK)
		return;

	BeginWaitCursor();

	CAxClientCntrItem* pItem = NULL;
	TRY
	{
		// Create new item connected to this document.
		CAxClientDoc* pDoc = GetDocument();
		ASSERT_VALID(pDoc);
		pItem = new CAxClientCntrItem(pDoc);
		ASSERT_VALID(pItem);

		// Initialize the item from the dialog data.
		if (!dlg.CreateItem(pItem))
			AfxThrowMemoryException();  // any exception will do
		ASSERT_VALID(pItem);
		
        if (dlg.GetSelectionType() == COleInsertDialog::createNewItem)
			pItem->DoVerb(OLEIVERB_SHOW, this);

		ASSERT_VALID(pItem);

		// As an arbitrary user interface design, this sets the selection
		//  to the last item inserted.

		// TODO: reimplement selection as appropriate for your application

		m_pSelection = pItem;   // set selection to last inserted item
		
		SetSelection(pItem);
		
		pDoc->UpdateAllViews(NULL);
	}
	CATCH(CException, e)
	{
		if (pItem != NULL)
		{
			ASSERT_VALID(pItem);
			pItem->Delete();
		}
		AfxMessageBox(IDP_FAILED_TO_CREATE);
	}
	END_CATCH

	EndWaitCursor();
}

// The following command handler provides the standard keyboard
//  user interface to cancel an in-place editing session.  Here,
//  the container (not the server) causes the deactivation.
void CAxClientView::OnCancelEditCntr()
{
	// Close any in-place active item on this view.
	COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
	if (pActiveItem != NULL)
	{
		pActiveItem->Close();
	}
	ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}

// Special handling of OnSetFocus and OnSize are required for a container
//  when an object is being edited in-place.
void CAxClientView::OnSetFocus(CWnd* pOldWnd)
{
	COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
	if (pActiveItem != NULL &&
		pActiveItem->GetItemState() == COleClientItem::activeUIState)
	{
		// need to set focus to this item if it is in the same view
		CWnd* pWnd = pActiveItem->GetInPlaceWindow();
		if (pWnd != NULL)
		{
			pWnd->SetFocus();   // don't call the base class
			return;
		}
	}

	CScrollView::OnSetFocus(pOldWnd);
}

void CAxClientView::OnSize(UINT nType, int cx, int cy)
{
	CScrollView::OnSize(nType, cx, cy);
	COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
	if (pActiveItem != NULL)
		pActiveItem->SetItemRects();
}

void CAxClientView::SetupTracker(CRectTracker* pTracker, CAxClientCntrItem* pItem,
	CRect* pTrueRect)
{
	ASSERT(pTracker != NULL);
	ASSERT(pItem != NULL);

	pTracker->m_rect = CRect(pItem->m_ptPos,pItem->m_sizeCur);
//	DocToClient(pTracker->m_rect);
	CClientDC dc(this);
	OnPrepareDC(&dc);
	dc.LPtoDP(&pTracker->m_rect);
	pTracker->m_rect.NormalizeRect();

	// set minimum size for our OLE items
	pTracker->m_sizeMin.cx = 8;
	pTracker->m_sizeMin.cy = 8;

	pTracker->m_nStyle = 0;

	// setup resize handles if item is selected
	if (pItem == m_pSelection)
		pTracker->m_nStyle |= CRectTracker::resizeInside;

	// put correct border depending on item type
	if (pItem->GetType() == OT_LINK)
		pTracker->m_nStyle |= CRectTracker::dottedLine;
	else
		pTracker->m_nStyle |= CRectTracker::solidLine;

	// put hatching over the item if it is currently open
	if (pItem->GetItemState() == COleClientItem::openState ||
		pItem->GetItemState() == COleClientItem::activeUIState)
	{
		pTracker->m_nStyle |= CRectTracker::hatchInside;
	}

	if (pTrueRect != NULL)
		pTracker->GetTrueRect(pTrueRect);
}

/////////////////////////////////////////////////////////////////////////////
// CAxClientView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CAxClientView message handlers

BOOL CAxClientView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	// TODO: Add your message handler code here and/or call default
	if(pWnd==this&&m_pSelection!=NULL)
	{
		CRectTracker tracker;
		SetupTracker(&tracker,m_pSelection);
		if(tracker.SetCursor(this,nHitTest))
			return TRUE;
	}
	
	return CScrollView::OnSetCursor(pWnd, nHitTest, message);
}

CAxClientCntrItem* CAxClientView::HitTestItems(CPoint point)
{
	CAxClientDoc* pDoc=GetDocument();
	CAxClientCntrItem* pItemHit=NULL;
	
	POSITION pos=pDoc->GetStartPosition();
	while (pos!=NULL)
	{
		CAxClientCntrItem* pItem=(CAxClientCntrItem*)pDoc->GetNextItem(pos);
		if(pItem == NULL) 
			break;
		CRect rect=CRect(pItem->m_ptPos,pItem->m_sizeCur);
		if(rect.PtInRect(point)) 
		{
			pItemHit=pItem;
			return pItemHit;
		}
	}
	return pItemHit;
}

void CAxClientView::SetSelection(CAxClientCntrItem * pItem)
{
	if(pItem==NULL||m_pSelection!=pItem)
	{
		COleClientItem* pActiveItem=
			GetDocument()->GetInPlaceActiveItem(this);
		if(pActiveItem!=NULL&&pActiveItem!=pItem)
			pActiveItem->Close();
	}

	if(m_pSelection!=pItem)
	{
		if(m_pSelection!=NULL)
		{
			CRectTracker tracker;
			SetupTracker(&tracker,m_pSelection);
			CRect rect;
			tracker.GetTrueRect(rect);
			InvalidateRect(rect);
		}
		m_pSelection=pItem;
		if(m_pSelection!=NULL)
		{
			CRectTracker tracker;
			SetupTracker(&tracker,m_pSelection);
			CRect rect;
			tracker.GetTrueRect(rect);
			InvalidateRect(rect);
		}
	}

}

void CAxClientView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CAxClientCntrItem* pItemHit = NULL;

	pItemHit=HitTestItems(point);
	SetSelection(pItemHit);

	if(pItemHit!=NULL)
	{
		CRectTracker tracker;
		SetupTracker(&tracker,pItemHit);
		UpdateWindow();
		if(tracker.Track(this,point))
		{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品国产91久久久久久| 国产一区二区精品久久99| 欧美中文字幕一二三区视频| 亚洲三级电影网站| 在线亚洲高清视频| 亚洲h精品动漫在线观看| 欧美一区二区精品在线| 美女免费视频一区二区| 久久久五月婷婷| 99视频精品全部免费在线| 亚洲乱码国产乱码精品精小说| 日本道在线观看一区二区| 亚洲与欧洲av电影| 7799精品视频| 国产成人av福利| 最近日韩中文字幕| 9191久久久久久久久久久| 国产一区二区影院| 一区二区三区在线视频播放| 欧美精品日韩精品| 成人自拍视频在线| 亚洲电影在线播放| 精品久久久久一区| av中文字幕一区| 日韩极品在线观看| 国产精品狼人久久影院观看方式| 在线免费观看一区| 国产成人综合自拍| 午夜欧美视频在线观看| 亚洲精品一区二区三区四区高清| 99re这里只有精品视频首页| 日本伊人色综合网| 成人欧美一区二区三区白人| 在线不卡欧美精品一区二区三区| 国产美女在线观看一区| 亚洲精品视频一区| 久久久亚洲高清| 欧美三级电影在线看| 国产美女一区二区| 免费看黄色91| 亚洲一区二区三区四区在线观看 | 精品国产人成亚洲区| 99国产精品99久久久久久| 久久99久久99精品免视看婷婷 | 亚洲综合成人在线| 国产日韩欧美在线一区| 欧美日韩免费高清一区色橹橹| 成人一道本在线| 久久精品国产网站| 亚洲精品欧美激情| 国产精品福利一区二区三区| 日韩视频国产视频| 欧美色大人视频| 91亚洲精品一区二区乱码| 国产乱码精品一区二区三| 亚洲成人精品影院| 亚洲免费观看高清完整版在线观看| 精品国产91乱码一区二区三区| 欧美少妇一区二区| 99久久精品免费看国产| 国产69精品一区二区亚洲孕妇| 免费观看成人av| 亚瑟在线精品视频| 亚洲福利国产精品| 亚洲主播在线播放| 亚洲精品第1页| 国产精品福利在线播放| 中文天堂在线一区| 国产区在线观看成人精品| 精品理论电影在线| 日韩女同互慰一区二区| 欧美电影影音先锋| 777a∨成人精品桃花网| 欧美日韩一级大片网址| 欧美日韩一区二区三区四区五区| 日本久久电影网| 在线看日韩精品电影| 欧美在线不卡视频| 欧美精品日韩综合在线| 欧美一区二区三级| 精品久久久久久久久久久久包黑料| 欧美成人一区二区三区 | 久久久www免费人成精品| 精品久久久久久久久久久久久久久 | 久久精品国产在热久久| 极品美女销魂一区二区三区免费| 麻豆91在线看| 国产麻豆一精品一av一免费| 国产精品一卡二卡在线观看| 成人综合婷婷国产精品久久免费| 成人av在线资源网站| 91在线小视频| 在线免费观看一区| 欧美一级淫片007| 久久综合久久综合亚洲| 国产午夜精品久久| 亚洲婷婷综合色高清在线| 亚洲久草在线视频| 亚洲第一搞黄网站| 极品瑜伽女神91| 成人黄色777网| 欧美日韩国产高清一区二区三区 | 国产欧美日韩另类一区| 亚洲欧美国产77777| 亚洲v中文字幕| 国产一区二区毛片| 成av人片一区二区| 91精品国产丝袜白色高跟鞋| 精品国产欧美一区二区| 亚洲欧洲精品一区二区三区不卡 | 亚洲色图第一区| 日韩电影一区二区三区四区| 国产福利精品导航| 欧美私人免费视频| 精品美女在线播放| 亚洲在线中文字幕| 国产一区二区0| 欧美日韩国产电影| 欧美国产精品久久| 日韩二区三区在线观看| www.欧美.com| 日韩一二三区视频| 亚洲精品欧美综合四区| 精品一区二区三区日韩| 91成人在线观看喷潮| 久久中文娱乐网| 天堂一区二区在线| av电影在线观看不卡| 日韩你懂的电影在线观看| 亚洲欧美偷拍三级| 国产精品中文欧美| 7777精品伊人久久久大香线蕉经典版下载| 国产欧美中文在线| 精品一区二区在线观看| 在线观看www91| 国产精品亲子伦对白| 日产国产高清一区二区三区| 99在线精品免费| 久久精品在这里| 日韩va欧美va亚洲va久久| 99视频在线观看一区三区| 精品女同一区二区| 免费观看成人av| 在线不卡一区二区| 亚洲午夜一二三区视频| av电影在线不卡| 国产欧美精品国产国产专区| 日本美女一区二区三区视频| 色综合激情五月| 成人欧美一区二区三区1314| 国产成人精品三级| 久久综合久色欧美综合狠狠| 日本aⅴ亚洲精品中文乱码| 欧美亚洲一区二区在线观看| 最新高清无码专区| 99精品久久免费看蜜臀剧情介绍| 久久综合狠狠综合| 国产剧情在线观看一区二区| 精品国产一区二区国模嫣然| 日av在线不卡| 日韩一区二区在线看片| 日韩影院在线观看| 4438x亚洲最大成人网| 亚洲成人动漫在线观看| 欧美日韩视频第一区| 亚洲不卡在线观看| 91精品国产综合久久福利| 亚洲成a人v欧美综合天堂| 欧美日韩一区二区欧美激情 | 日韩欧美成人一区二区| 免费欧美高清视频| 日韩精品资源二区在线| 伦理电影国产精品| 久久影视一区二区| 国产成人免费在线视频| 日本一区二区三区高清不卡| 国产老肥熟一区二区三区| 国产视频911| 97精品国产露脸对白| 亚洲乱码国产乱码精品精小说| 91成人在线精品| 日本视频中文字幕一区二区三区| 欧美一区二区三区视频免费播放| 蜜臀av性久久久久蜜臀aⅴ| 日韩一区二区免费视频| 美女脱光内衣内裤视频久久影院| 欧美成人一区二区三区片免费| 国产伦精品一区二区三区免费 | 欧美二区在线观看| 国内一区二区在线| 国产精品久久久久aaaa樱花 | 麻豆极品一区二区三区| 久久免费午夜影院| 成人动漫一区二区| 亚洲最大的成人av| 精品精品欲导航| av电影天堂一区二区在线| 亚洲午夜免费视频| 久久亚洲精精品中文字幕早川悠里| 不卡av电影在线播放|