正在加载图片...
第16单元多文档界面程序 332 m cAptured False: ReleaseCapture o Doc->m lineList lpDoc->m nCount]= CLine(m pointFrom, m pointTo m_colorCurr, m nCurrWidth) Doc->UpdateAllViews(this) Invalidate o void CMyView: OnMouse Move UInT nFlags, CPoint point CView:: OnMouseMove(n Flags, point) lientDC dc(this dc. SetROP2(R2 NOT ne dc. Move To(m dc LineTo(m pointTo void CMyView:: OnColorO CColorDialog dlg(m colorCurr) (dlg DoModal== IDOK m colorCurr dlg. GetColoro void CMyView: OnWidth1o m n CurrWidth h30 n CurrWidth =3:第 16 单元 多文档界面程序 332 m_bCaptured = FALSE; ReleaseCapture(); pDoc->m_lineList[pDoc->m_nCount] = CLine(m_pointFrom,m_pointTo, m_colorCurr, m_nCurrWidth); pDoc->m_nCount++; pDoc->SetModifiedFlag(); pDoc->UpdateAllViews(this); Invalidate(); } } void CMyView::OnMouseMove(UINT nFlags, CPoint point) { CView::OnMouseMove(nFlags, point); if(m_bCaptured) { CClientDC dc(this); dc.SetROP2(R2_NOT); dc.MoveTo(m_pointFrom); dc.LineTo(m_pointTo); m_pointTo = point; dc.MoveTo(m_pointFrom); dc.LineTo(m_pointTo); } } void CMyView::OnColor() { CColorDialog dlg(m_colorCurr); if(dlg.DoModal() == IDOK) m_colorCurr = dlg.GetColor(); } void CMyView::OnWidth1() { m_nCurrWidth = 1; } void CMyView::OnWidth3() { m_nCurrWidth = 3; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有