梓囚徒貧圭�鮗� ○ 賜 ★ 辛酔堀貧和鍬匈��梓囚徒貧議 Enter 囚辛指欺云慕朕村匈��梓囚徒貧圭�鮗� ● 辛指欺云匈競何��
!!!!隆堋響頼��紗秘慕禰厮宴和肝写偬堋響��
#0177 dc。DPtoLP��&point���察�
#0178
#0179 CPen* pOldPen = dc。SelectObject��pDoc´〃GetCurrentPen�┌����察�
#0180 dc。MoveTo��m_ptPrev���察�
#0181 dc。LineTo��point���察�
#0182 dc。SelectObject��pOldPen���察�
#0183 m_pStrokeCur´〃m_pointArray。Add��point���察�
#0184
#0185 // Tell the stroke item that we're done adding points to it。
#0186 // This is so it can finish puting its bounding rectangle。
#0187 m_pStrokeCur´〃FinishStroke�┌��察�
#0188
#0189 // Tell the other views that this stroke has been added
#0190 // so that they can invalidate this stroke's area in their
#0191 // client area。
#0192 pDoc´〃UpdateAllViews��this�察�0L�察�m_pStrokeCur���察�
#0193
#0194 ReleaseCapture�┌��察 �// Release the mouse capture established at
#0195 // the beginning of the mouse drag。
#0196 return�察�
#0197 ��
#0198
#0199 void CScribbleView�今�OnMouseMove��UINT�察�CPoint point��
#0200 ��
#0201 // Mouse movement is interesting in the Scribble application
#0202 // only if the user is currently drawing a new stroke by dragging
#0203 // the captured mouse。
#0204
#0205 if ��GetCapture�┌� ��= this��
#0206 return�察�// If this window ��view�� didn't capture the mouse�察�
#0207 // then the user isn't drawing in this window。
#0208
#0209 CClientDC dc��this���察�
#0210 // CScrollView changes the viewport origin and mapping mode。
#0211 // It's necessary to convert the point from device coordinates
#0212 // to logical coordinates�察�such as are stored in the document。
#0213 OnPrepareDC��&dc���察�
898
´´´´´´´´´´´´´´´´´´´´´´Page 961´´´´´´´´´´´´´´´´´´´´´´´
現��B Scribble Step5 頼屁圻兵�a
#0214 dc。DPtoLP��&point���察�
#0215
#0216 m_pStrokeCur´〃m_pointArray。Add��point���察�
#0217
#0218 // Draw a line from the previous detected point in the mouse
#0219 // drag to the current point。
#0220 CPen* pOldPen = dc。SelectObject��GetDocument�┌�´〃GetCurrentPen�┌����察�
#0221 dc。MoveTo��m_ptPrev���察�
#0222 dc。LineTo��point���察�
#0223 dc。SelectObject��pOldPen���察�
#0224 m_ptPrev = point�察�
#0225 return�察�
#0226 ��
#0227
#0228 void CScribbleView�今�OnUpdate��CView* /* pSender */�察�LPARAM /* lHint */�察�
#0229 CObject* pHint��
#0230 ��
#0231 // The document has informed this view that some data has changed。
#0232
#0233 if ��pHint ��= NULL��
#0234 ��
#0235 if ��pHint´〃IsKindOf��RUNTIME_CLASS��CStroke������
#0236 ��
#0237 // The hint is that a stroke as been added ��or changed��。
#0238 // So�察�invalidate its rectangle。
#0239 CStroke* pStroke = ��CStroke*��pHint�察�
#0240 CClientDC dc��this���察�
#0241 OnPrepareDC��&dc���察�
#0242 CRect rectInvalid = pStroke´〃GetBoundingRect�┌��察�
#0243 dc。LPtoDP��&rectInvalid���察�
#0244 InvalidateRect��&rectInvalid���察�
#0245 return�察�
#0246 ��
#0247 ��
#0248 // We can't interpret the hint�察�so assume that anything might
#0249 // have been updated。
#0250 Invalidate��TRUE���察�
#0251 return�察�
#0252 ��
#0253
#0254 void CScribbleView�今�OnInitialUpdate�┌�
#0255 ��
#0256 SetScrollSizes��MM_LOENGLISH�察�GetDocument�┌�´〃GetDocSize�┌����察�
#0257 CScrollView�今�OnInitialUpdate�┌��察�
#0258 ��
#0259
899
´´´´´´´´´´´´´´´´´´´´´´Page 962´´´´´´´´´´´´´´´´´´´´´´´
及励鐙 現��
#0260 void CScribbleView�今�OnPrint��CDC* pDC�察�CPrintInfo* pInfo��
#0261 ��
#0262 if ��pInfo´〃m_nCurPage == 1�� // page no。 1 is the title page
#0263 ��
#0264 PrintTitlePage��pDC�察�pInfo���察�
#0265 return�察�// nothing else to print on page 1 but the page title
#0266 ��
#0267 CString strHeader = GetDocument�┌�´〃GetTitle�┌��察�
#0268
#0269 PrintPageHeader��pDC�察�pInfo�察�strHeader���察�
#0270 // PrintPageHeader�┌� subtracts out from the pInfo´〃m_rectDraw the
#0271 // amount of the page used for the header。
#0272
#0273 pDC´〃SetWindowOrg��pInfo´〃m_rectDraw。left�察�pInfo´〃m_rectDraw。top���察�
#0274
#0275 // Now print the rest of the page
#0276 OnDraw��pDC���察�
#0277 ��
#0278
#0279 void CScribbleView�今�PrintTitlePage��CDC* pDC�察�CPrintInfo* pInfo��
#0280 ��
#0281 // Prepare a font size for displaying the file name
#0282 LOGFONT logFont�察�
#0283 memset��&logFont�察�0�察�sizeof��LOGFONT�����察�
#0284 logFont。lfHeight = 75�察 �// 3/4th inch high in MM_LOENGLISH
#0285 // ��1/100th inch��
#0286 CFont font�察�
#0287 CFont* pOldFont = NULL�察�
#0288 if ��font。CreateFontIndirect��&logFont����
#0289 pOldFont = pDC´〃SelectObject��&font���察�
#0290
#0291 // Get the file name�察�to be displayed on title page
#0292 CString strPageTitle = GetDocument�┌�´〃GetTitle�┌��察�
#0293
#0294 // Display the file name 1 inch below top of the page�察�
#0295 // centered horizontally
#0296 pDC´〃SetTextAlign��TA_CENTER���察�
#0297 pDC´〃TextOut��pInfo´〃m_rectDraw。right/2�察 �100�察�strPageTitle���察�
#0298
#0299 if ��pOldFont ��= NULL��
#0300 pDC´〃SelectObject��pOldFont���察�
#0301 ��
#0302
#0303 void CScribbleView�今�PrintPageHeader��CDC* pDC�察�CPrintInfo* pInfo�察�
#0304 CString& strHeader��
#0305 ��
900
´´´´´´´´´´´´´´´´´´´´´´Page 963´´´´´´´´´´´´´´´´´´´´´´´
現��B Scribble Step5 頼屁圻兵�a
#0306 // Print a page header consisting of the name of
#0307 // the document and a horizontal line
#0308 pDC´〃SetTextAlign��TA_LEFT���察�
#0309