⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 第七章6.txt

📁 本书在复习C++基础知识后
💻 TXT
字号:
void CEx_A7View::OnMouseMove(UINT nFlags, CPoint point) 
{
		CDC* pDC		= this->GetDC();
		CString		strPos;
	if (m_bLineStart )
	{
		// 计算长度和角度
		int dx = point.x - m_ptPrevPos.x;
		int dy = point.y - m_ptPrevPos.y;
		double length	= sqrt( dx * dx + dy * dy );
		double angle;
		if (dx == 0 )		angle = 90.0;
		else if ( dy == 0 ) angle = 0.0;
		else				angle = 180.0 * atan( (double)dy / (double)dx ) / 3.14159265;
		strPos.Format( "%.1f<%.1f", length, angle );
	} else
			strPos.Format( "%d, %d", point.x, point.y );
		if ( m_bCursorFirst )
		{
			m_bCursorFirst	= FALSE;
			m_ptCurPos		= point;
			DrawCursor( pDC, m_ptCurPos );
			DrawInfoWnd( pDC, m_ptCurPos, strPos );
		} else
		{
			DrawCursor( pDC, m_ptCurPos );
		if (m_bLineStart )				// 绘制XOR直线 
			DrawXORLine( pDC, m_ptPrevPos, m_ptCurPos );
			if ( m_dcMem.m_hDC )
			{
				pDC->BitBlt( m_ptCurPos.x, m_ptCurPos.y - 15, 80, 15, 
					&m_dcMem, m_ptCurPos.x, m_ptCurPos.y - 15, SRCCOPY );
			}
			m_ptCurPos		= point;
		if (m_bLineStart )				// 绘制XOR直线 
			DrawXORLine( pDC, m_ptPrevPos, m_ptCurPos );
			DrawCursor( pDC, m_ptCurPos );
			DrawInfoWnd( pDC, m_ptCurPos, strPos );
		}
		CView::OnMouseMove(nFlags, point);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -