正在加载图片...
附录5:七巧板程序 pointList[3]. x=DELTA+CHIP WIDTH/2 pointList[3]y DELTA+CHIP WIDTH m chipList [6]. Set Chip(7, pointList, 4) /清理文档:关闭文档、建立新文档和打开文档前调用 void CMy Doc: DeleteContentsO Reset CDocument:: Delete Contents ∥/系列化:读写文档时自动调用 void CMy Doc: Serialize(CArchive &a for (int i=0: i<CHIP COUNT; i++) m chipList[i]. Serialize(ar) ∥视图类 class CMyview: public Cview DECLARE DYNCREATE ( CMyView) BOOLm cAptured: CPoint m pointMouse int m nCurrIndex bli CMyViewOIm bCaptured FALSE: F CMy Doc* GetDocumento return (CMy Doc*)m pDocument virtual void OnInitialUpdate o virtual BOOL OnPreparePrinting(CPrintInfo* pInfo) virtual void OnDraw(CDC* pDC) afx msg void OnLButton Down (UINT nFlags, CPoint point) afx msg void OnLButtonUp UINT nFlags, CPoint point afx msg void On MouseMove UiNt nFlags, CPoint point) afx msg void OnRButton Down (UINT nFlags, CPoint point)附录 5:七巧板程序 378 pointList[3].x = DELTA+CHIP_WIDTH/2; pointList[3].y = DELTA+CHIP_WIDTH; m_chipList[6].SetChip(7, pointList, 4); } // 清理文档:关闭文档、建立新文档和打开文档前调用 void CMyDoc::DeleteContents() { Reset(); CDocument::DeleteContents(); } // 系列化:读写文档时自动调用 void CMyDoc::Serialize(CArchive &ar) { for(int i=0; i<CHIP_COUNT; i++) m_chipList[i].Serialize(ar); } // 视图类 /////////////////////////////////////////////////// class CMyView : public CView { DECLARE_DYNCREATE(CMyView) BOOLm_bCaptured; CPoint m_pointMouse; int m_nCurrIndex; public: CMyView(){m_bCaptured = FALSE;} CMyDoc* GetDocument(){return (CMyDoc*)m_pDocument;} virtual void OnInitialUpdate(); virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnDraw(CDC* pDC); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有