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

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

?? drawobj.cpp

?? 工業(yè)組態(tài)王6.5版本軟件最新版本完整源代碼.
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
	{
		WORD wTemp;
		ar >> wTemp; m_nShape = (Shape)wTemp;
		ar >> m_roundness;
	}
}

/**/
void CDrawRect::DrawCircle(CDC* pDC,CRect rect)
{
	ASSERT_VALID(this);

	int cx,cy;
	if (rect.right < rect.left)
		{
			cx = rect.left;
			rect.left = rect.right;
			rect.right = cx;
		}
	if (rect.bottom < rect.top)
		{
			cy = rect.top;
			rect.top = rect.bottom;
			rect.bottom = cy;
		}
	cx = rect.right - rect.left;
    cy = rect.bottom - rect.top;
	if (cx > cy)
		{
			rect.left += (cx-cy) / 2;
			rect.right = rect.left + cy;
		}
	else
		{
            rect.top += (cy-cx) / 2;
			rect.bottom = rect.top + cx;
		}
	//pDC->TextOut(rect.left,rect.bottom,"123",3);
	pDC->Ellipse(rect);
}
/**/

void CDrawRect::Draw(CDC* pDC)
{
	ASSERT_VALID(this);

	CBrush brush;
	if (!brush.CreateBrushIndirect(&m_logbrush))
		return;
	CPen pen;
	if (!pen.CreatePenIndirect(&m_logpen))
		return;

	CBrush* pOldBrush;
	CPen* pOldPen;

	if (m_bBrush)
		pOldBrush = pDC->SelectObject(&brush);
	else
		pOldBrush = (CBrush*)pDC->SelectStockObject(NULL_BRUSH);

	if (m_bPen)
		pOldPen = pDC->SelectObject(&pen);
	else
		pOldPen = (CPen*)pDC->SelectStockObject(NULL_PEN);

	CRect rect = m_position;
	switch (m_nShape)
	{
	case rectangle:
		pDC->Rectangle(rect);
		break;

	case roundRectangle:
		pDC->RoundRect(rect, m_roundness);
		break;

	case ellipse:
		pDC->Ellipse(rect);
		break;

	case circle:
		DrawCircle(pDC,rect);
		//pDC->Circle(rect);
		break;

	case line:
		if (rect.top > rect.bottom)
		{
			rect.top -= m_logpen.lopnWidth.y / 2;
			rect.bottom += (m_logpen.lopnWidth.y + 1) / 2;
		}
		else
		{
			rect.top += (m_logpen.lopnWidth.y + 1) / 2;
			rect.bottom -= m_logpen.lopnWidth.y / 2;
		}

		if (rect.left > rect.right)
		{
			rect.left -= m_logpen.lopnWidth.x / 2;
			rect.right += (m_logpen.lopnWidth.x + 1) / 2;
		}
		else
		{
			rect.left += (m_logpen.lopnWidth.x + 1) / 2;
			rect.right -= m_logpen.lopnWidth.x / 2;
		}

		pDC->MoveTo(rect.TopLeft());
		pDC->LineTo(rect.BottomRight());
		break;
	}

	pDC->SelectObject(pOldBrush);
	pDC->SelectObject(pOldPen);
}


int CDrawRect::GetHandleCount()
{
	ASSERT_VALID(this);

	return m_nShape == line ? 2 :
		CDrawObj::GetHandleCount() + (m_nShape == roundRectangle);
}

// returns center of handle in logical coordinates
CPoint CDrawRect::GetHandle(int nHandle)
{
	ASSERT_VALID(this);

	if (m_nShape == line && nHandle == 2)
		nHandle = 5;
	else if (m_nShape == roundRectangle && nHandle == 9)
	{
		CRect rect = m_position;
		rect.NormalizeRect();
		CPoint point = rect.BottomRight();
		point.x -= m_roundness.x / 2;
		point.y -= m_roundness.y / 2;
		return point;
	}

	return CDrawObj::GetHandle(nHandle);
}

HCURSOR CDrawRect::GetHandleCursor(int nHandle)
{
	ASSERT_VALID(this);

	if (m_nShape == line && nHandle == 2)
		nHandle = 5;
	else if (m_nShape == roundRectangle && nHandle == 9)
		return AfxGetApp()->LoadStandardCursor(IDC_SIZEALL);
	return CDrawObj::GetHandleCursor(nHandle);
}

// point is in logical coordinates
void CDrawRect::MoveHandleTo(int nHandle, CPoint point, CDrawView* pView)
{
	ASSERT_VALID(this);

	if (m_nShape == line && nHandle == 2)
		nHandle = 5;
	else if (m_nShape == roundRectangle && nHandle == 9)
	{
		CRect rect = m_position;
		rect.NormalizeRect();
		if (point.x > rect.right - 1)
			point.x = rect.right - 1;
		else if (point.x < rect.left + rect.Width() / 2)
			point.x = rect.left + rect.Width() / 2;
		if (point.y > rect.bottom - 1)
			point.y = rect.bottom - 1;
		else if (point.y < rect.top + rect.Height() / 2)
			point.y = rect.top + rect.Height() / 2;
		m_roundness.x = 2 * (rect.right - point.x);
		m_roundness.y = 2 * (rect.bottom - point.y);
		m_pDocument->SetModifiedFlag();
		if (pView == NULL)
			Invalidate();
		else
			pView->InvalObj(this);
		return;
	}

	CDrawObj::MoveHandleTo(nHandle, point, pView);
}

// rect must be in logical coordinates
BOOL CDrawRect::Intersects(const CRect& rect)
{
	ASSERT_VALID(this);

	CRect rectT = rect;
	rectT.NormalizeRect();

	CRect fixed = m_position;
	fixed.NormalizeRect();
	if ((rectT & fixed).IsRectEmpty())
		return FALSE;

	CRgn rgn;
	switch (m_nShape)
	{
	case rectangle:
		return TRUE;

	case roundRectangle:
		rgn.CreateRoundRectRgn(fixed.left, fixed.top, fixed.right, fixed.bottom,
			m_roundness.x, m_roundness.y);
		break;

	case ellipse:
		rgn.CreateEllipticRgnIndirect(fixed);
		break;

	case line:
		{
			int x = (m_logpen.lopnWidth.x + 5) / 2;
			int y = (m_logpen.lopnWidth.y + 5) / 2;
			POINT points[4];
			points[0].x = fixed.left;
			points[0].y = fixed.top;
			points[1].x = fixed.left;
			points[1].y = fixed.top;
			points[2].x = fixed.right;
			points[2].y = fixed.bottom;
			points[3].x = fixed.right;
			points[3].y = fixed.bottom;

			if (fixed.left < fixed.right)
			{
				points[0].x -= x;
				points[1].x += x;
				points[2].x += x;
				points[3].x -= x;
			}
			else
			{
				points[0].x += x;
				points[1].x -= x;
				points[2].x -= x;
				points[3].x += x;
			}

			if (fixed.top < fixed.bottom)
			{
				points[0].y -= y;
				points[1].y += y;
				points[2].y += y;
				points[3].y -= y;
			}
			else
			{
				points[0].y += y;
				points[1].y -= y;
				points[2].y -= y;
				points[3].y += y;
			}
			rgn.CreatePolygonRgn(points, 4, ALTERNATE);
		}
		break;
	case circle:
		rgn.CreateEllipticRgnIndirect(fixed);
		break;
	}
	return rgn.RectInRegion(fixed);
}

CDrawObj* CDrawRect::Clone(CDrawDoc* pDoc)
{
	ASSERT_VALID(this);

	CDrawRect* pClone = new CDrawRect(m_position);

	pClone->m_bPen = m_bPen;
	pClone->m_logpen = m_logpen;
	pClone->m_bBrush = m_bBrush;
	pClone->m_logbrush = m_logbrush;
	pClone->m_nShape = m_nShape;
	pClone->m_roundness = m_roundness;

	pClone->m_nOrder = m_nOrder;
	pClone->m_nType = m_nType;

	ASSERT_VALID(pClone);

	if (pDoc != NULL)
		pDoc->Add(pClone);

	ASSERT_VALID(pClone);

	return pClone;
}
////////////////////////////////////////////////////////////////////////////

IMPLEMENT_SERIAL(CDrawOleObj, CDrawObj, 0)

BOOL CDrawOleObj::c_bShowItems = TRUE;

CDrawOleObj::CDrawOleObj() : m_extent(0,0)
{
	m_pClientItem = NULL;
}

CDrawOleObj::CDrawOleObj(const CRect& position)
	: CDrawObj(position), m_extent(0, 0)
{
	m_pClientItem = NULL;
}

CDrawOleObj::~CDrawOleObj()
{
	if (m_pClientItem != NULL)
	{
		m_pClientItem->Release();
		m_pClientItem = NULL;
	}
}

void CDrawOleObj::Remove()
{
	if (m_pClientItem != NULL)
	{
		m_pClientItem->Delete();
		m_pClientItem = NULL;
	}
	CDrawObj::Remove();
}

void CDrawOleObj::Serialize( CArchive& ar )
{
	ASSERT_VALID(this);

	CDrawObj::Serialize(ar);

	if (ar.IsStoring())
	{
		ar << m_extent;
		ar << m_pClientItem;
	}
	else
	{
		ar >> m_extent;
		ar >> m_pClientItem;
		m_pClientItem->m_pDrawObj = this;
	}
 }

CDrawObj* CDrawOleObj::Clone(CDrawDoc* pDoc)
{
	ASSERT_VALID(this);
 
	AfxGetApp()->BeginWaitCursor();

	CDrawOleObj* pClone = NULL;
	CDrawItem* pItem = NULL;
 
	TRY
	{
		// perform a "deep copy" -- need to copy CDrawOleObj and the CDrawItem
		//  that it points to.
		CDrawOleObj* pClone = new CDrawOleObj(m_position);
		CDrawItem* pItem = new CDrawItem(m_pDocument, pClone);
		if (!pItem->CreateCloneFrom(m_pClientItem))
			AfxThrowMemoryException();

		pClone->m_pClientItem = pItem;
		pClone->m_bPen = m_bPen;
		pClone->m_logpen = m_logpen;
		pClone->m_bBrush = m_bBrush;
		pClone->m_logbrush = m_logbrush;

		pClone->m_nOrder = m_nOrder;
	    pClone->m_nType = m_nType;

		ASSERT_VALID(pClone);

		if (pDoc != NULL)
			pDoc->Add(pClone);
	}
	CATCH_ALL(e)
	{
		pItem->Delete();
		pClone->m_pClientItem = NULL;
		pClone->Remove();
		AfxGetApp()->EndWaitCursor();

		THROW_LAST();
	}
	END_CATCH_ALL

	AfxGetApp()->EndWaitCursor();

	return pClone;
}

void CDrawOleObj::Draw(CDC* pDC)
{
	ASSERT_VALID(this);

	CDrawItem* pItem = m_pClientItem;
	if (pItem != NULL)
	{
		// draw the OLE item itself
		pItem->Draw(pDC, m_position);

		// don't draw tracker in print preview or on printer
		if (!pDC->IsPrinting())
		{
			// use a CRectTracker to draw the standard effects
			CRectTracker tracker;
			tracker.m_rect = m_position;
			pDC->LPtoDP(tracker.m_rect);

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

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

void CDrawOleObj::OnOpen(CDrawView* pView)
{
	AfxGetApp()->BeginWaitCursor();
	m_pClientItem->DoVerb(
#ifndef _MAC		
		GetKeyState(VK_CONTROL) < 0 ? OLEIVERB_OPEN : OLEIVERB_PRIMARY,
#else		
		GetKeyState(VK_OPTION) < 0 ? OLEIVERB_OPEN : OLEIVERB_PRIMARY,
#endif		
		pView);
	AfxGetApp()->EndWaitCursor();
}

void CDrawOleObj::OnEditProperties()
{
	// using COlePropertiesDialog directly means no scaling
	COlePropertiesDialog dlg(m_pClientItem, 100, 100, NULL);

	dlg.DoModal();
}

// position is in logical
void CDrawOleObj::MoveTo(const CRect& position, CDrawView* pView)
{
	ASSERT_VALID(this);

	if (position == m_position)
		return;

	// call base class to update position
	CDrawObj::MoveTo(position, pView);

	// update position of in-place editing session on position change
	if (m_pClientItem->IsInPlaceActive())
		m_pClientItem->SetItemRects();
}

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合一区二区三区| 欧美日韩大陆一区二区| 亚洲精品视频一区二区| 91麻豆精品国产自产在线| 成人污视频在线观看| 蜜桃传媒麻豆第一区在线观看| 日本一区二区三区dvd视频在线| 在线区一区二视频| 成人小视频在线观看| 奇米精品一区二区三区在线观看| 一色屋精品亚洲香蕉网站| 日韩午夜小视频| 欧美区一区二区三区| 99久久精品一区| 国产精品白丝jk黑袜喷水| 日本vs亚洲vs韩国一区三区| 亚洲欧美电影一区二区| 欧美国产日本视频| 久久这里只有精品6| 日韩欧美区一区二| 欧美老肥妇做.爰bbww| 色天使久久综合网天天| 成人av资源下载| 国产一区二区三区免费观看| 日韩va欧美va亚洲va久久| 亚洲黄色录像片| 日韩美女久久久| 中文字幕欧美一| 欧美国产日本韩| 久久精品一区二区三区四区| 欧美zozozo| 欧美一级高清大全免费观看| 欧美日韩精品系列| 欧美综合天天夜夜久久| 在线观看视频91| 日本韩国一区二区三区视频| 不卡的av在线播放| 91香蕉视频在线| 97精品久久久久中文字幕| 不卡av电影在线播放| 成人一级黄色片| 国产福利一区二区| 国产不卡视频一区二区三区| 国产伦精品一区二区三区免费迷| 久久精品国产99国产精品| 精品一区二区免费| 经典三级一区二区| 成人综合在线观看| 日韩欧美在线影院| 99精品视频一区二区| 日本va欧美va瓶| 蜜臀精品久久久久久蜜臀| 久久99久久精品| 国产精品自在欧美一区| 国产夫妻精品视频| 91欧美一区二区| 欧美日韩情趣电影| 日韩欧美综合在线| 久久免费看少妇高潮| 国产精品美女久久久久久久久久久 | 美女精品一区二区| 国内精品免费**视频| 国产传媒一区在线| 一本久久a久久精品亚洲| 欧美色图天堂网| 91精品国产色综合久久久蜜香臀| 日韩欧美高清在线| 亚洲国产精品t66y| 亚洲精品免费在线观看| 秋霞午夜鲁丝一区二区老狼| 国产精品中文字幕日韩精品| 99精品1区2区| 欧美日韩国产综合久久 | 日韩欧美国产电影| 中文字幕第一区第二区| 亚洲一区二区视频在线| 久久精品国产久精国产爱| 丁香另类激情小说| 欧洲亚洲精品在线| 久久久亚洲国产美女国产盗摄 | 久久综合久久综合九色| 亚洲欧美日韩电影| 久久国产精品免费| 欧美日韩日本视频| 亚洲国产高清在线观看视频| 亚洲国产成人av好男人在线观看| 国内久久精品视频| 一本大道久久a久久精品综合 | 国产精品福利电影一区二区三区四区| 夜夜亚洲天天久久| 国产91精品精华液一区二区三区| 色哟哟在线观看一区二区三区| 日韩一级大片在线观看| 亚洲女性喷水在线观看一区| 另类调教123区| 91久久人澡人人添人人爽欧美| 欧美一级午夜免费电影| 亚洲人成精品久久久久久 | 精品写真视频在线观看| 91视频免费播放| 久久久午夜精品| 日韩中文字幕麻豆| 91年精品国产| 国产午夜精品一区二区三区四区 | 丁香婷婷综合五月| 日韩一区二区三区免费看| 一区二区三区中文字幕电影| 国产一本一道久久香蕉| 91精品久久久久久久91蜜桃| 亚洲日本在线天堂| 国产成人啪免费观看软件| 欧美日韩免费电影| 亚洲精品免费一二三区| 成人深夜福利app| 亚洲精品一区二区三区在线观看| 亚洲国产成人av网| 色琪琪一区二区三区亚洲区| 国产精品免费看片| 高清在线观看日韩| 久久久久国产免费免费| 精品一区二区在线播放| 91精品国产美女浴室洗澡无遮挡| 玉米视频成人免费看| 99国产精品国产精品久久| 中文字幕国产精品一区二区| 国产乱色国产精品免费视频| 欧美一区二区成人6969| 日韩影院在线观看| 欧美日韩综合色| 亚洲综合区在线| 色呦呦网站一区| 夜夜爽夜夜爽精品视频| 在线观看一区二区视频| 一个色在线综合| 欧美中文字幕一区二区三区亚洲| 亚洲人亚洲人成电影网站色| 91免费视频观看| 亚洲乱码一区二区三区在线观看| 99久久精品免费看国产| 中文字幕乱码亚洲精品一区| 成人动漫视频在线| 国产精品久久久久久亚洲伦| 99在线视频精品| 亚洲精品亚洲人成人网在线播放| 91亚洲精品乱码久久久久久蜜桃| 亚洲精品成人在线| 欧美唯美清纯偷拍| 青青草国产精品亚洲专区无| 7777精品伊人久久久大香线蕉最新版| 三级成人在线视频| 欧美大肚乱孕交hd孕妇| 国产盗摄精品一区二区三区在线| 国产精品沙发午睡系列990531| 欧美精品一区二区三区蜜桃视频| 精品一区二区在线视频| 欧美激情综合五月色丁香小说| aa级大片欧美| 亚洲国产精品久久艾草纯爱| 5566中文字幕一区二区电影| 麻豆91免费看| 欧美—级在线免费片| 91激情五月电影| 轻轻草成人在线| 久久精品欧美一区二区三区麻豆| jizz一区二区| 亚洲国产精品一区二区久久| 日韩午夜中文字幕| 成人av综合在线| 午夜影院在线观看欧美| 精品少妇一区二区三区在线视频| 国产成人在线影院| 一区二区三区四区国产精品| 91精品国产乱| 成人短视频下载| 日韩精品成人一区二区在线| 精品国产乱码久久久久久老虎| 不卡免费追剧大全电视剧网站| 亚洲国产精品久久人人爱蜜臀| 精品999久久久| 一本一本大道香蕉久在线精品| 免费人成在线不卡| 中文字幕+乱码+中文字幕一区| 91高清视频免费看| 国产一区二区三区四区五区美女| 亚洲久本草在线中文字幕| 欧美www视频| 在线免费观看日本欧美| 国产自产v一区二区三区c| 一区二区三区四区视频精品免费| 精品成人佐山爱一区二区| 日本精品一区二区三区高清| 国产曰批免费观看久久久| 一区二区免费看| 中文字幕乱码日本亚洲一区二区| 欧美日韩免费电影| 成人免费黄色大片| 精品一区二区三区在线播放| 亚洲电影欧美电影有声小说| 中文字幕免费一区| 欧美精品一区在线观看|