The view
class CWordView
has only two fields. The field m_pWordDoc
is a pointer to the document
class object. Similar to the Calc application, we need to keep track of double-clicks. The field m_bDoubleclick
is first set to false when the user clicks the mouse key, and then set to true if is followed by a double-click. When the user drags the mouse, we note the first and last position. However, in the case of a double-click, a word will be marked, and we should not finish the marking process by calling MouseUp
in the document class.
const int LINE_WIDTH = 500; const int LINE_HEIGHT = 500; class CWordView : public CView { private: DECLARE_DYNCREATE(CWordView) DECLARE_MESSAGE_MAP() CWordView(); public: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); virtual void OnInitialUpdate(); virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL); afx_msg void OnSize(UINT uType, int cxClient, ...