... the Application Wizard to generate the classes CCalcApp, CMainFrame, CChildFrame, CCalcDoc, CCalcView, and CAboutDlg. We will modify CCalcDoc and CCalcView as we develop the application, the ... SetPreviousText(CDC* pDC); void Draw(CDC* pDC) const; CRect GetArea() const; Font* GetFont(); void SetFont(const Font& font, CDC* pDC); private: void GenerateCaretArray(CDC* pDC); public:...
Ngày tải lên: 12/08/2014, 21:20
... called every time an object of the class is created. // The default constructor is called for each car object. Car carArray[3]; carArray[2].IncreaseSpeed (10 0); // The default constructor is called ... account1 (12 3); account1.Deposit (10 0); cout << "Account1: number " << account1.GetNumber() // 12 3 << ", $" << account1.GetSaldo() <<...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 3 pdf
... (Logical Coordinates to Device Coordinates) translates MFC class objects CSize, and CRect, and (one or more) CPoint objects between logical and device coordinates. void DPtoLP(CSize* pSize) const; void ... Type> TemplateStack<Type>::~TemplateStack() { Cell<Type>* pCurrCell = m_pFirstCell; while (pCurrCell != NULL) { Cell<Type>* pRemoveCell = pCurrCell; pCurrCell =...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 4 pptx
... turn calls the Win32 API function DestroyCaret. Caret.cpp void Caret::SetAndShowCaret(const CRect rcCaret) { m_rcCaret = rcCaret; CClientDC dc(m_pFocusView); m_pFocusView->OnPrepareDC(&dc); ... m_pFocusView->OnPrepareDC(&dc); dc.LPtoDP(m_rcCaret); m_rcCaret.left = min(m_rcCaret.left, m_rcCaret.right - 1) ; if (m_rcCaret.left < 0) { m_rcCaret.right += abs(m_rcCaret....
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 5 pot
... object is created, is connected to the document object by the pointer m_pTetrisDoc. int CTetrisView::OnCreate(LPCREATESTRUCT lpCreateStruct) { // We check that the view has been correctly created. ... DoubleClick(const CPoint& ptMouse); BOOL Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& szDistance); void Move(const CSize& szDistance); void Draw(C...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 7 pptx
... the code will be clearer. a2 a2 c2 c2 b1 b3 b1 b3 source source source source (a2) = {} (b1) = {} (b3) = {a2} (c2 ) = {a2, b1} target target target target (a2) = {b3, c2 } (b1) = {c2 } (b3) = {} (c2 ) ... ROW_HEIGHT)); CRect rcMargin(rcCell.left + CELL_MARGIN, rcCell.top + CELL_MARGIN, rcCell.right - CELL_MARGIN, rcCell.bottom - CELL_MARGIN); Color penColor = (bEdit || bMarked) ? m...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 8 ppsx
... rcCurrCell.GetRow(), COLS - 1) ; Chapter 8 [ 293 ] class CCalcDoc : public CDocument { protected: DECLARE_DYNCREATE(CCalcDoc) DECLARE_MESSAGE_MAP() CCalcDoc(); public: virtual void Serialize(CArchive& ... rcCurrCell); switch (eArea) { case MS_ALL: m_pCalcDoc->UnmarkAndMark(0, 0, ROWS - 1, COLS - 1) ; break; case MS_ROW: m_pCalcDoc->UnmarkAndMark(rcCurrCell.GetRow...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 9 doc
... (isHomeChar(iChar)) { CRect rcChar = m_rectArray[iChar]; CRect rcCaret(rcChar.left, rcChar.top, rcChar.right, rcChar.bottom); return szUpperLeft + rcCaret; } else { CRect rcChar = m_rectArray[iChar ... m_rectArray[iChar - 1] ; CRect rcCaret(rcChar.right, rcChar.top, rcChar.right + rcChar.Width(), rcChar.bottom); return szUpperLeft + rcCaret; } } When the user scrolls up and down...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 10 ppt
... 10 3 RingView.cpp 11 2, 11 3 S scroll bar setting 11 4 serialization 99, 10 0 RingDoc.cpp 12 4, 12 5 set class, MFC class about 13 7 example 13 7 -14 0 size class, MFC class CSize class 12 8 spread sheet, calc application cell ... 11 7 mouse, catching 11 0 mouse button, clicking 11 0 registry 12 3 rings, drawing 11 2, 11 3 scroll bar, setting 11 4 serialization 12 4, 12 5 t...
Ngày tải lên: 12/08/2014, 21:20