CCreateContext* pContext)
#0065 {
#0066 return m_wndSplitter。Create(this;
#0067 2; 2; // TODO: adjust the number of rows; columns
#0068 CSize(10; 10); // TODO: adjust the minimum pane size
#0069 pContext);
#0070 }
SCRIBBLEDOC。H
#0001 /////////////////////////////////////////////////////////////////
#0002 // class CStroke
#0003 //
#0004 // A stroke is a series of connected points in the scribble drawing。
884
…………………………………………………………Page 947……………………………………………………………
附錄B Scribble Step5 完整原始碼
#0005 // A scribble document may have multiple strokes。
#0006
#0007 class CStroke : public CObject
#0008 {
#0009 public:
#0010 CStroke(UINT nPenWidth);
#0011
#0012 protected:
#0013 CStroke();
#0014 DECLARE_SERIAL(CStroke)
#0015
#0016 // Attributes
#0017 protected:
#0018 UINT m_nPenWidth; // one pen width applies to entire stroke
#0019 public:
#0020 CArray m_pointArray; // series of connected points
#0021 CRect m_rectBounding; // smallest rect that surrounds all
#0022 // of the points in the stroke
#0023 // measured in MM_LOENGLISH units
#0024 // (0。01 inches; with Y…axis inverted)
#0025 public:
#0026 CRect& GetBoundingRect() { return m_rectBounding; }
#0027
#0028 // Operations
#0029 public:
#0030 BOOL DrawStroke(CDC* pDC);
#0031 void FinishStroke();
#0032
#0033 public:
#0034 virtual void Serialize(CArchive& ar);
#0035 };
#0036
#0037 /////////////////////////////////////////////////////////////////
#0038
#0039 class CScribbleDoc : public CDocument
#0040 {
#0041 protected: // create from serialization only
#0042 CScribbleDoc();
#0043 DECLARE_DYNCREATE(CScribbleDoc)
#0044
#0045 // Attributes
#0046 protected:
#0047 // The document keeps track of the current pen width on
#0048 // behalf of all views。 We"d like the user interface of
#0049 // Scribble to be such that if the user chooses the Draw
#0050 // Thick Line mand; it will apply to all views; not just
885
…………………………………………………………Page 948……………………………………………………………
第五篇 附錄
#0051 // the view that currently has the focus。
#0052
#0053 UINT m_nPenWidth; // current user…selected pen width
#0054 BOOL m_bThickPen; // TRUE if current pen is thick
#0055 UINT m_nThinWidth;
#0056 UINT m_nThickWidth;
#0057 CPen m_penCur; // pen created according to
#0058 // user…selected pen style (width)
#0059 public:
#0060 CTypedPtrList m_strokeList;
#0061 CPen* GetCurrentPen() { return &m_penCur; }
#0062
#0063 protected:
#0064 CSize m_sizeDoc;
#0065 public:
#0066 CSize GetDocSize() { return m_sizeDoc; }
#0067
#0068 // Operations
#0069 public:
#0070 CStroke* NewStroke();
#0071
#0072 // Overrides
#0073 // ClassWizard generated virtual function overrides
#0074 //{{AFX_VIRTUAL(CScribbleDoc)
#0075 public:
#0076 virtual BOOL OnNewDocument();
#0077 virtual void Serialize(CArchive& ar);
#0078 virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
#0079 virtual void DeleteContents();
#0080 //}}AFX_VIRTUAL
#0081
#0082 // Implementation
#0083 protected:
#0084 void ReplacePen();
#0085
#0086 public:
#0087 virtual ~CScribbleDoc();
#0088 #ifdef _DEBUG
#0089 virtual void AssertValid() const;
#0090 virtual void Dump(CDumpContext& dc) const;
#0091 #endif
#0092
#0093 protected:
#0094 void InitDocument();
#0095
#0096 // Generated message map functions
886
…………………………………………………………Page 949……………………………………………………………
附錄B Scribble Step5 完整原始碼
#0097 protected:
#0098 //{{AFX_MSG(CScribbleDoc)
#0099 afx_msg void OnEditClearAll();
#0100 afx_msg void OnPenThickOrThin();
#0101 afx_msg void OnUpdateEditClearAll(CCmdUI* pCmdUI);
#0102 afx_msg void OnUpdatePenThickOrThin(CCmdUI* pCmdUI);
#0103 afx_msg void OnPenWidt
小说推荐
- Java编程思想第4版[中文版](PDF格式)
- -Page 1-Page 2《Thinking In Java》中文版作者:Bruce Eckel主页:http/BruceEckel.编译:Trans Bot主页:http/memberease~transbot致谢-献给那些直到现在仍在孜孜不倦创造下一代计算机语言的人们!指导您利用万维网的语言进
- 最新章:第295章
- VB2008从入门到精通(PDF格式英文版)
- -Page 1(R)The eXperT’s Voice inBeginningVB 2008From Novice to ProfessionalChristian Gross-Page 2-Page 3-Beginning VB 2008From Novice to Professional■C
- 最新章:第214章
- oracle从入门到精通(PDF格式)
- -Page 1-Oracle 从入门到精通-Page 2-资源来自网络,仅供学习 Oracle 从入门到精通一、SQL 8
- 最新章:第37章
- C语言游戏编程从入门到精通(PDF格式)
- -Page 1-Page 2-Page 3-Page 4-Page 5-Page 6-Page 7-Page 8-Page 9-Page 10-Page 11-Page 12-Page 13-Page 14
- 最新章:第4章
- 深入浅出
- 《深入浅出》作者:白小骨晋江VIP20140610完结+1番外非V章节总点击数:67370 总书评数:209 当前被收藏数:764 文章积分:11,386,657文案:每个前男友都是女人掉过的坑,从何典阳这个坑里往外爬的梁温暖一脸血表示,何典阳他这个深坑实在太坑爹。何典阳:我是坑?梁温暖…别看我,我
- 最新章:第74章
- 深入浅出[娱乐圈]
- 文案【忠犬影帝攻X傲娇明星受,1V1轻松甜文,前期互相试探,38章在一起后甜甜甜,两人都有细微的变化和成长~这也是我用心构思攻受感情发展的文,但数据有点太惨了,没入V可以全文免费看,还是想求点收藏呀,数据好看点吧,让我开心一下(笑哭.jpg)流量偶像白漾和影帝顾瑜祁关系很僵,传言两人出道时不合而互相
- 最新章:第59章
- JMS简明教程(PDF格式)
- -Page 1-JMS1.1规范中文版卫建军2007‐11‐22-Page 2
- 最新章:第28章
- SQL语言艺术(PDF格式)
- -Page 1-SQLSSQQLL语言艺术内容介绍本书分为12章,每一章包含许多原则或准则,并通过举例的方式对原则进行解释说明。这些例子大多来自于实际案例,对九种SQL经典查询场景以及其性能影响讨论,非常便于实践,为你数据库应用维护人员阅读。资深 SQL 专家 Stéphane Faroult倾力打
- 最新章:第27章
- C语言实例教程(PDF格式)
- -Page 1-前 言Visual C+是开发运行于Windows 95和Windows NT环境下的Win32应用程序的可视化编程工具中最重要的成员之一,它为软件开发人员提供了完整的编辑、编译和调试工具和建立于Win32 API(ApplicationProgramming Interface)基
- 最新章:第143章