MiniCADView.cpp
上传用户:netltd
上传日期:2013-02-12
资源大小:7234k
文件大小:32k
源码类别:

绘图程序

开发平台:

Visual C++

  1. // MiniCADView.cpp : implementation of the CMiniCADView class
  2. //
  3. #include "stdafx.h"
  4. #include "MiniCADView.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMiniCADView
  12. IMPLEMENT_DYNCREATE(CMiniCADView, CScrollView)
  13. BEGIN_MESSAGE_MAP(CMiniCADView, CScrollView)
  14. //{{AFX_MSG_MAP(CMiniCADView)
  15. ON_COMMAND(ID_DRAW_CIRCLE, OnDrawCircle)
  16. ON_COMMAND(ID_DRAW_LINE, OnDrawLine)
  17. ON_WM_LBUTTONDOWN()
  18. ON_WM_RBUTTONDOWN()
  19. ON_WM_MOUSEMOVE()
  20. ON_WM_VSCROLL()
  21. ON_WM_DESTROY()
  22. ON_WM_HSCROLL()
  23. ON_COMMAND(ID_VIEW_ZOOMOUT, OnZoomout)
  24. ON_COMMAND(ID_VIEW_ZOOMIN, OnZoomin)
  25. ON_CBN_SELCHANGE(IDC_COLOR, OnSelchangeColor)
  26. ON_CBN_SELCHANGE(IDC_LINESTYLE, OnSelchangeLinestyle)
  27. ON_COMMAND(ID_DRAW_RECT, OnDrawRect)
  28. ON_WM_SIZE()
  29. ON_COMMAND(ID_VIEW_REDRAW, OnViewRedraw)
  30. ON_COMMAND(ID_DRAW_SELECT, OnDrawSelect)
  31. ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
  32. ON_COMMAND(ID_EDIT_REDO, OnEditRedo)
  33. ON_COMMAND(ID_DRAW_ARC, OnDrawArc)
  34. ON_COMMAND(ID_DRAW_TEXT, OnDrawText)
  35. ON_UPDATE_COMMAND_UI(ID_DRAW_SELECT, OnUpdateDrawSelect)
  36. ON_UPDATE_COMMAND_UI(ID_DRAW_LINE, OnUpdateDrawLine)
  37. ON_UPDATE_COMMAND_UI(ID_DRAW_RECT, OnUpdateDrawRect)
  38. ON_UPDATE_COMMAND_UI(ID_DRAW_CIRCLE, OnUpdateDrawCircle)
  39. ON_UPDATE_COMMAND_UI(ID_DRAW_ARC, OnUpdateDrawArc)
  40. ON_UPDATE_COMMAND_UI(ID_DRAW_TEXT, OnUpdateDrawText)
  41. ON_UPDATE_COMMAND_UI(ID_EDIT_REDO, OnUpdateEditRedo)
  42. ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateEditUndo)
  43. ON_UPDATE_COMMAND_UI(ID_CHANGE_DELETE, OnUpdateChangeDelete)
  44.     ON_WM_ERASEBKGND()
  45. ON_CBN_SELCHANGE(IDC_FILESIZE, OnSelchangeFilesize)
  46. ON_COMMAND(ID_DRAW_MULTILINE, OnDrawMultiline)
  47. ON_COMMAND(ID_DRAW_POLYGON, OnDrawPolygon)
  48. ON_COMMAND(ID_DRAW_ELLIPSE, OnDrawEllipse)
  49. ON_COMMAND(ID_MODIFY_DELETE, OnModifyDelete)
  50. ON_COMMAND(ID_MODIFY_COPY, OnModifyCopy)
  51. ON_COMMAND(ID_MODIFY_CUT, OnModifyCut)
  52. ON_COMMAND(ID_MODIFY_CUTTOANGLE, OnModifyCuttoangle)
  53. ON_COMMAND(ID_MODIFY_LENGTHENTO, OnModifyLengthento)
  54. ON_COMMAND(ID_MODIFY_JOIN, OnModifyJoin)
  55. ON_COMMAND(ID_MODIFY_MIRROR, OnModifyMirror)
  56. ON_COMMAND(ID_MODIFY_VERTICAL, OnModifyVertical)
  57. ON_COMMAND(ID_DRAW_DOT, OnDrawDot)
  58. ON_COMMAND(ID_DRAW_CURVE, OnDrawCurve)
  59. ON_COMMAND(ID_MODIFY_MOVE, OnModifyMove)
  60. ON_COMMAND(ID_MODIFY_ROTATE, OnModifyRotate)
  61. ON_COMMAND(ID_DRAW_DEFINELINE, OnDrawDefineline)
  62. ON_COMMAND(ID_MODIFY_EXCURSION, OnModifyExcursion)
  63. ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
  64. ON_COMMAND(ID_EDIT_CUT, OnEditCut)
  65. ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
  66. ON_COMMAND(ID_COMPONENT_DEFINE, OnComponentDefine)
  67. ON_COMMAND(ID_COMPONENT_INSERT, OnComponentInsert)
  68. ON_COMMAND(ID_ALIGN_BOTTOM, OnAlignBottom)
  69. ON_COMMAND(ID_ALIGN_CONCENTRIC, OnAlignConcentric)
  70. ON_COMMAND(ID_ALIGN_LEFT, OnAlignLeft)
  71. ON_COMMAND(ID_ALIGN_ONLINE, OnAlignOnline)
  72. ON_COMMAND(ID_ALIGN_RIGHT, OnAlignRight)
  73. ON_COMMAND(ID_ALIGN_TOP, OnAlignTop)
  74. ON_COMMAND(ID_DRAW_FILL, OnDrawFill)
  75. ON_COMMAND(ID_MODIFY_BREAK, OnModifyBreak)
  76. //}}AFX_MSG_MAP
  77. // Standard printing commands
  78. ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  79. ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  80. ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  81. END_MESSAGE_MAP()
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CMiniCADView construction/destruction
  84. CMiniCADView::CMiniCADView()
  85. {
  86. // TODO: add construction code here
  87. pApp = (CMiniCADApp*)AfxGetApp();
  88. pMainWnd = (CMainFrame*)pApp->m_pMainWnd;
  89. }
  90. CMiniCADView::~CMiniCADView()
  91. {
  92. }
  93. BOOL CMiniCADView::PreCreateWindow(CREATESTRUCT& cs)
  94. {
  95. // TODO: Modify the Window class or styles here by modifying
  96. //  the CREATESTRUCT cs
  97.     cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 0 ,(HBRUSH)::GetStockObject(WHITE_BRUSH), 0);
  98. return CView::PreCreateWindow(cs);
  99. }
  100. /////////////////////////////////////////////////////////////////////////////
  101. // CMiniCADView printing
  102. BOOL CMiniCADView::OnPreparePrinting(CPrintInfo* pInfo)
  103. {
  104. // default preparation
  105. return DoPreparePrinting(pInfo);
  106. }
  107. void CMiniCADView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  108. {
  109. // TODO: add extra initialization before printing
  110. }
  111. void CMiniCADView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  112. {
  113. // TODO: add cleanup after printing
  114. }
  115. /////////////////////////////////////////////////////////////////////////////
  116. // CMiniCADView diagnostics
  117. #ifdef _DEBUG
  118. void CMiniCADView::AssertValid() const
  119. {
  120. CView::AssertValid();
  121. }
  122. void CMiniCADView::Dump(CDumpContext& dc) const
  123. {
  124. CView::Dump(dc);
  125. }
  126. CMiniCADDoc* CMiniCADView::GetDocument() // non-debug version is inline
  127. {
  128. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMiniCADDoc)));
  129. return (CMiniCADDoc*)m_pDocument;
  130. }
  131. #endif //_DEBUG
  132. /////////////////////////////////////////////////////////////////////////////
  133. // CMiniCADView message handlers
  134. void CMiniCADView::OnInitialUpdate() 
  135. {
  136. CScrollView::OnInitialUpdate();
  137. CMiniCADDoc* Doc = GetDocument();
  138. CClientDC dc(this);
  139.     
  140. //在MDI子框架上显示标题,标题为图纸名
  141. CChildFrame* pChildWnd = (CChildFrame*)pMainWnd->MDIGetActive();
  142. pChildWnd->SetWindowText(Doc->FileInfo.Name);
  143.     
  144. //初始化颜色复选框
  145. CComboBoxEx* ColorCombo = (CComboBoxEx*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_COLOR);
  146. ColorCombo->EnableWindow(TRUE);
  147.     ColorCombo->SetCurSel(0);
  148. //初始化线形复选框
  149. CComboBoxEx* LineStyleCombo = (CComboBoxEx*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_LINESTYLE);
  150. LineStyleCombo->EnableWindow(TRUE);
  151. LineStyleCombo->SetCurSel(0);
  152. //初始化图纸尺寸复选框
  153. CComboBox* pSizeCombo = (CComboBox*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_FILESIZE);
  154. pSizeCombo->EnableWindow(TRUE);
  155. pSizeCombo->SetCurSel(3);
  156.     //初始化绘图工具条 、光标
  157. SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  158.     Doc->MyOperate.LineStyle = pApp->CADInfo.LineStyle;
  159. Doc->MyOperate.ForeColor = pApp->CADInfo.ForeColor;
  160.     Proportion = 1.0;
  161. //根据图纸尺寸设置滚动条滚动区域(既客户区)
  162. Size.cx = Doc->FileInfo.size.cx + EXTRA_WIDTH * 2; 
  163.     Size.cy = Doc->FileInfo.size.cy + EXTRA_HIGTH * 2;
  164. SetScrollSizes(MM_TEXT, Size);
  165. Doc->MyOperate.size.cx = Size.cx;
  166. Doc->MyOperate.size.cy = Size.cy;
  167. }
  168. ////////////////////////////////////////////////////////////////////////////////////////////////
  169. //改变视图背景颜色
  170. void CMiniCADView::OnEraseBkgnd (CDC* pDC)
  171. {
  172. // Create a cyan brush.
  173.     CBrush Brush (RGB (200, 255, 255));
  174.     CBrush* pOldBrush = pDC->SelectObject (&Brush);
  175.     // Get the area that needs to be erased .
  176.     CRect rcClip ;
  177.     pDC->GetClipBox (&rcClip);
  178.     //Paint the area.
  179.     pDC-> PatBlt (rcClip.left , rcClip.top , rcClip.Width ( ) , rcClip.Height ( ) , PATCOPY );
  180.     //Unselect brush out of device context .
  181.     pDC->SelectObject (pOldBrush );
  182. }
  183. // CMiniCADView drawing
  184. void CMiniCADView::OnDraw(CDC* pDC)
  185. {
  186. CMiniCADDoc* pDoc = GetDocument();
  187. ASSERT_VALID(pDoc);
  188.     
  189. CBrush brush;
  190. RECT rect;
  191. RECT shadow;
  192. rect.left = EXTRA_WIDTH;
  193. rect.top = EXTRA_HIGTH;
  194. rect.right = rect.left + (long)(pDoc->FileInfo.size.cx * Proportion) + 1;
  195. rect.bottom = rect.top + (long)(pDoc->FileInfo.size.cy * Proportion) + 1;
  196. brush.CreateSolidBrush(RGB(192, 192, 192));
  197.     shadow.left = rect.left + 3;
  198. shadow.top = rect.bottom;
  199. shadow.right = rect.right + 3;
  200. shadow.bottom = shadow.top + 3;
  201.     pDC->FillRect(&shadow, &brush);
  202. shadow.left = rect.right;
  203. shadow.top = rect.top + 3;
  204. shadow.right = shadow.left + 3;
  205. shadow.bottom = rect.bottom + 3;
  206.     pDC->FillRect(&shadow, &brush);
  207. pDC->Rectangle(&rect);
  208.     //重画所有的图形对象
  209. pDoc->MyOperate.RedrawAllObject(pDC);
  210. }
  211. //////////////////////////////////////////////////////////////////////////////////////////////
  212. void CMiniCADView::OnDrawSelect() 
  213. {
  214. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  215. pApp->CADInfo.LRepeatTimes = 0;
  216. }
  217. void CMiniCADView::OnDrawLine() 
  218. {
  219. CMiniCADDoc* Doc = GetDocument();
  220. if(Doc->MyOperate.UnselectObject())
  221. Invalidate();
  222. pApp->CADInfo.CurrentCommand = DRAW_LINE;
  223. pApp->CADInfo.LRepeatTimes = 0;
  224. }
  225. void CMiniCADView::OnDrawRect() 
  226. {
  227. CMiniCADDoc* Doc = GetDocument();
  228. if(Doc->MyOperate.UnselectObject())
  229. Invalidate();
  230. pApp->CADInfo.CurrentCommand = DRAW_RECT;
  231. pApp->CADInfo.LRepeatTimes = 0;
  232. }
  233. void CMiniCADView::OnDrawCircle() 
  234. {
  235. CMiniCADDoc* Doc = GetDocument();
  236. if(Doc->MyOperate.UnselectObject())
  237. Invalidate();
  238. pApp->CADInfo.CurrentCommand = DRAW_CIRCLE;
  239. pApp->CADInfo.LRepeatTimes = 0;
  240. }
  241. void CMiniCADView::OnDrawArc() 
  242. {
  243. CMiniCADDoc* Doc = GetDocument();
  244. if(Doc->MyOperate.UnselectObject())
  245. Invalidate();
  246. pApp->CADInfo.CurrentCommand = DRAW_ARC;
  247. pApp->CADInfo.LRepeatTimes = 0;
  248. }
  249. void CMiniCADView::OnDrawMultiline() 
  250. {
  251. }
  252. void CMiniCADView::OnDrawPolygon() 
  253. {
  254. }
  255. void CMiniCADView::OnDrawEllipse() 
  256. {
  257. }
  258. void CMiniCADView::OnDrawDot() 
  259. {
  260. }
  261. void CMiniCADView::OnDrawCurve() 
  262. {
  263. }
  264. void CMiniCADView::OnDrawDefineline() 
  265. {
  266. }
  267. void CMiniCADView::OnDrawText() 
  268. {
  269. CMiniCADDoc* Doc = GetDocument();
  270. if(Doc->MyOperate.UnselectObject())
  271. Invalidate();
  272. pApp->CADInfo.CurrentCommand = DRAW_TEXT;
  273. pApp->CADInfo.LRepeatTimes = 0;
  274. }
  275. ///////////////////////////////////////////////////////////////////////////////////////////////
  276. void CMiniCADView::OnUpdateDrawLine(CCmdUI* pCmdUI) 
  277. {
  278. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_LINE);
  279. //继续传递当前命令
  280. pCmdUI->ContinueRouting();
  281. }
  282. void CMiniCADView::OnUpdateDrawRect(CCmdUI* pCmdUI) 
  283. {
  284. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_RECT);
  285. pCmdUI->ContinueRouting();
  286. }
  287. void CMiniCADView::OnUpdateDrawCircle(CCmdUI* pCmdUI) 
  288. {
  289. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_CIRCLE);
  290. pCmdUI->ContinueRouting();
  291. }
  292. void CMiniCADView::OnUpdateDrawArc(CCmdUI* pCmdUI) 
  293. {
  294. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_ARC);
  295. pCmdUI->ContinueRouting();
  296. }
  297. void CMiniCADView::OnUpdateDrawText(CCmdUI* pCmdUI) 
  298. {
  299. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_TEXT);
  300. pCmdUI->ContinueRouting();
  301. }
  302. ///////////////////////////////////////////////////////////////////////////////////////////////
  303. //mouse message
  304. void CMiniCADView::OnLButtonDown(UINT nFlags, CPoint point) 
  305. {
  306. // TODO: Add your message handler code here and/or call default
  307. int ObjectType;
  308. int ObjetcIndex;
  309. CMiniCADDoc* Doc = GetDocument();
  310. CClientDC dc(this);
  311. OnPrepareDC(&dc);
  312. dc.DPtoLP(&point);
  313. //获取视相对窗口的偏移量
  314. switch(pApp->CADInfo.CurrentCommand)
  315. {
  316. case DRAW_SELECT:
  317. Doc->MyOperate.SelectObject(&dc, point);
  318. break;
  319. case DRAW_LINE:
  320. {
  321. pApp->CADInfo.LRepeatTimes++;
  322. switch(pApp->CADInfo.LRepeatTimes)
  323. {
  324. case 1:
  325. //窗口坐标等于视坐标加视相对窗口的偏移量
  326. Doc->MyOperate.StartPoint = point;
  327. Doc->MyOperate.oldEndPoint = Doc->MyOperate.StartPoint;
  328. break;
  329. case 2:
  330. {   
  331. //窗口坐标等于视坐标加视相对窗口的偏移量
  332. Doc->MyOperate.EndPoint = point;
  333. Doc->MyOperate.DrawLineC(&dc);
  334. Doc->MyOperate.AddLine();
  335. ObjectType = OBJ_LINE;
  336. ObjetcIndex = Doc->MyOperate.m_LineArray.GetUpperBound();
  337. //清除序号在CommandPointer + 1之后的命令
  338. //因为执行一项新操作后,将不再有可以Redo的命令
  339. Doc->MyCommand.DelCommandFrom(Doc->MyCommand.CommandPointer + 1);
  340. Doc->MyCommand.AddCommand(ID_DRAW_LINE, 1, &ObjectType, &ObjetcIndex);
  341. //命令指针移到命令数组末尾
  342. Doc->MyCommand.CommandPointer = Doc->MyCommand.m_CommandArray.GetUpperBound();
  343. pApp->CADInfo.LRepeatTimes--;
  344. Doc->MyOperate.StartPoint = Doc->MyOperate.EndPoint;
  345. Doc->MyOperate.oldEndPoint = Doc->MyOperate.StartPoint;
  346. }
  347. break;
  348. }
  349. }
  350. break;
  351. case DRAW_RECT:
  352. {
  353. pApp->CADInfo.LRepeatTimes++;
  354. switch(pApp->CADInfo.LRepeatTimes)
  355. {
  356. case 1:
  357. //窗口坐标等于视坐标加视相对窗口的偏移量
  358. Doc->MyOperate.StartPoint = point;
  359. Doc->MyOperate.oldEndPoint = Doc->MyOperate.StartPoint;
  360. break;
  361. case 2:
  362. //窗口坐标等于视坐标加视相对窗口的偏移量
  363. Doc->MyOperate.EndPoint = point;
  364. Doc->MyOperate.DrawRectC(&dc);
  365. Doc->MyOperate.AddRect();
  366. ObjectType = OBJ_RECT;
  367. ObjetcIndex = Doc->MyOperate.m_RectArray.GetUpperBound();
  368. Doc->MyCommand.DelCommandFrom(Doc->MyCommand.CommandPointer + 1);
  369. Doc->MyCommand.AddCommand(ID_DRAW_RECT, 1, &ObjectType, &ObjetcIndex);
  370. Doc->MyCommand.CommandPointer = Doc->MyCommand.m_CommandArray.GetUpperBound();
  371. pApp->CADInfo.LRepeatTimes = 0;
  372. }
  373. }
  374. break;
  375. case DRAW_CIRCLE:
  376. {
  377. pApp->CADInfo.LRepeatTimes++;
  378. switch(pApp->CADInfo.LRepeatTimes)
  379. {
  380. case 1:
  381. //窗口坐标等于视坐标加视相对窗口的偏移量
  382. Doc->MyOperate.StartPoint = point;
  383. Doc->MyOperate.oldEndPoint = Doc->MyOperate.StartPoint;
  384. Doc->MyOperate.Radius = 0;
  385. break;
  386. case 2:
  387. //窗口坐标等于视坐标加视相对窗口的偏移量
  388. Doc->MyOperate.EndPoint = point;
  389. Doc->MyOperate.DrawCircleC(&dc);
  390. Doc->MyOperate.AddCircle();
  391. ObjectType = OBJ_CIRCLE;
  392. ObjetcIndex = Doc->MyOperate.m_CircleArray.GetUpperBound();
  393. Doc->MyCommand.DelCommandFrom(Doc->MyCommand.CommandPointer + 1);
  394. Doc->MyCommand.AddCommand(ID_DRAW_CIRCLE, 1, &ObjectType, &ObjetcIndex);
  395. Doc->MyCommand.CommandPointer = Doc->MyCommand.m_CommandArray.GetUpperBound();
  396. pApp->CADInfo.LRepeatTimes = 0;
  397. }
  398. }
  399. break;
  400. case DRAW_ARC:
  401. {
  402. pApp->CADInfo.LRepeatTimes++;
  403. switch(pApp->CADInfo.LRepeatTimes)
  404. {
  405. case 1:
  406. Doc->MyOperate.StartPoint = point;
  407. Doc->MyOperate.oldMidPoint = Doc->MyOperate.StartPoint;
  408. Doc->MyOperate.Radius = 0;
  409. break;
  410. case 2:
  411. Doc->MyOperate.MidPoint = point;
  412. break;
  413. case 3:
  414. Doc->MyOperate.EndPoint = point;
  415. Doc->MyOperate.DrawArcC(&dc);
  416. Doc->MyOperate.AddArc(); 
  417. ObjectType = OBJ_ARC;
  418. ObjetcIndex = Doc->MyOperate.m_ArcArray.GetUpperBound();
  419. Doc->MyCommand.DelCommandFrom(Doc->MyCommand.CommandPointer + 1);
  420. Doc->MyCommand.AddCommand(ID_DRAW_ARC, 1, &ObjectType, &ObjetcIndex);
  421. Doc->MyCommand.CommandPointer = Doc->MyCommand.m_CommandArray.GetUpperBound();
  422. pApp->CADInfo.LRepeatTimes = 0;
  423. break;
  424. }
  425. }
  426. break;
  427. case DRAW_TEXT:
  428. break;
  429. }
  430. CScrollView::OnLButtonDown(nFlags, point);
  431. }
  432. void CMiniCADView::OnRButtonDown(UINT nFlags, CPoint point) 
  433. {
  434. // TODO: Add your message handler code here and/or call default
  435. CMiniCADDoc* Doc = GetDocument();
  436. CClientDC dc(this);
  437. OnPrepareDC(&dc);
  438. dc.DPtoLP(&point);
  439. switch(pApp->CADInfo.CurrentCommand)
  440. {
  441. case DRAW_SELECT:
  442. if(Doc->MyOperate.UnselectObject())
  443. Invalidate();
  444. break;
  445. case DRAW_LINE:
  446. if(pApp->CADInfo.LRepeatTimes == 1)
  447. {
  448. Doc->MyOperate.CancelDrawLine(&dc);
  449. pApp->CADInfo.LRepeatTimes = 0;
  450. }
  451. else
  452. {
  453. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  454. SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  455. pApp->CADInfo.LRepeatTimes = 0;
  456. }
  457. break;
  458. case DRAW_RECT:
  459. if(pApp->CADInfo.LRepeatTimes == 1)
  460. {
  461. Doc->MyOperate.CancelDrawRect(&dc);
  462. pApp->CADInfo.LRepeatTimes = 0;
  463. }
  464. else
  465. {
  466. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  467. SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  468. pApp->CADInfo.LRepeatTimes = 0;
  469. }
  470. break;
  471. case DRAW_CIRCLE:
  472. if(pApp->CADInfo.LRepeatTimes == 1)
  473. {
  474. Doc->MyOperate.CancelDrawCircle(&dc);
  475. pApp->CADInfo.LRepeatTimes = 0;
  476. }
  477. else
  478. {
  479. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  480. SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  481. pApp->CADInfo.LRepeatTimes = 0;
  482. }
  483. break;
  484. case DRAW_ARC:
  485. if(pApp->CADInfo.LRepeatTimes > 0)
  486. {
  487. Doc->MyOperate.CancelDrawArc(&dc, pApp->CADInfo.LRepeatTimes);
  488. pApp->CADInfo.LRepeatTimes = 0;
  489. }
  490. else
  491. {
  492. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  493.     SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  494. pApp->CADInfo.LRepeatTimes = 0;
  495. }
  496. break;
  497. }
  498. CScrollView::OnRButtonDown(nFlags, point);
  499. }
  500. void CMiniCADView::OnMouseMove(UINT nFlags, CPoint point) 
  501. {
  502. // TODO: Add your message handler code here and/or call default
  503. char x[32];
  504. char y[32];
  505. int count;
  506. CMiniCADDoc* Doc = GetDocument();
  507. CClientDC dc(this);
  508.     OnPrepareDC(&dc);
  509. dc.DPtoLP(&point);
  510. count = sprintf(x, "%s", "X = ");
  511. sprintf(x + count, "%f", (float)(point.x - EXTRA_WIDTH) / Proportion);
  512. pMainWnd->m_wndStatusBar.SetPaneText(1, x, TRUE);
  513. count = sprintf(y, "%s", "Y = ");
  514. sprintf(y + count, "%f", (float)(Size.cy - point.y - EXTRA_HIGTH) / Proportion);
  515. pMainWnd->m_wndStatusBar.SetPaneText(2, y, TRUE);
  516. switch(pApp->CADInfo.CurrentCommand)
  517. {
  518. case DRAW_SELECT:
  519. SetCursor(AfxGetApp()->LoadCursor(IDC_SELECTCUR));
  520. break;
  521. case DRAW_LINE:
  522. SetCursor(AfxGetApp()->LoadCursor(IDC_DRAWCUR));
  523. if(pApp->CADInfo.LRepeatTimes == 1)
  524. {
  525. Doc->MyOperate.EndPoint = point;
  526. Doc->MyOperate.DrawLineA(&dc);
  527. }
  528. break;
  529. case DRAW_RECT:
  530. SetCursor(AfxGetApp()->LoadCursor(IDC_DRAWCUR));
  531. if(pApp->CADInfo.LRepeatTimes == 1)
  532. {
  533. Doc->MyOperate.EndPoint = point;
  534. Doc->MyOperate.DrawRectA(&dc);
  535. }
  536. break;
  537. case DRAW_CIRCLE:
  538. SetCursor(AfxGetApp()->LoadCursor(IDC_DRAWCUR));
  539. if(pApp->CADInfo.LRepeatTimes == 1)
  540. {
  541. Doc->MyOperate.EndPoint = point;
  542. Doc->MyOperate.DrawCircleA(&dc);
  543. }
  544. break;
  545. case DRAW_ARC:
  546. SetCursor(AfxGetApp()->LoadCursor(IDC_DRAWCUR));
  547. switch(pApp->CADInfo.LRepeatTimes)
  548. {
  549. case 1:
  550. Doc->MyOperate.MidPoint = point;
  551. Doc->MyOperate.DrawArcA(&dc, 1);
  552. break;
  553. case 2:
  554. Doc->MyOperate.EndPoint = point;
  555. Doc->MyOperate.DrawArcA(&dc, 2);
  556. break;
  557. }
  558. break;
  559. }
  560. CScrollView::OnMouseMove(nFlags, point);
  561. }
  562. void CMiniCADView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
  563. {
  564. // TODO: Add your message handler code here and/or call default
  565. CMiniCADDoc* Doc = GetDocument();
  566. CClientDC dc(this);
  567. OnPrepareDC(&dc);
  568. switch(pApp->CADInfo.CurrentCommand)
  569. {
  570. case DRAW_LINE:
  571. //必须重画直线,因为在滚屏过程中原来的直线有可能被破坏
  572. if(pApp->CADInfo.LRepeatTimes == 1)
  573. Doc->MyOperate.DrawLineB(&dc);
  574. break;
  575. case DRAW_RECT:
  576. if(pApp->CADInfo.LRepeatTimes == 1)
  577. Doc->MyOperate.DrawRectB(&dc);
  578. break;
  579. case DRAW_CIRCLE:
  580. if(pApp->CADInfo.LRepeatTimes == 1)
  581. Doc->MyOperate.DrawCircleB(&dc);
  582. break;
  583. case DRAW_ARC:
  584. Doc->MyOperate.DrawArcB(&dc, pApp->CADInfo.LRepeatTimes);
  585. break;
  586. }
  587. CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
  588. }
  589. void CMiniCADView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
  590. {
  591. // TODO: Add your message handler code here and/or call default
  592. CMiniCADDoc* Doc = GetDocument();
  593. CClientDC dc(this);
  594. OnPrepareDC(&dc);
  595. switch(pApp->CADInfo.CurrentCommand)
  596. {
  597. case DRAW_LINE:
  598. //必须重画直线,因为在滚屏过程中原来的直线有可能被破坏
  599. if(pApp->CADInfo.LRepeatTimes == 1)
  600. Doc->MyOperate.DrawLineB(&dc);
  601. break;
  602. case DRAW_RECT:
  603. //必须重画矩形,因为在滚屏过程中原来的矩形有可能被破坏
  604. if(pApp->CADInfo.LRepeatTimes == 1)
  605. Doc->MyOperate.DrawRectB(&dc);
  606. break;
  607. case DRAW_CIRCLE:
  608. if(pApp->CADInfo.LRepeatTimes == 1)
  609. Doc->MyOperate.DrawCircleB(&dc);
  610. break;
  611. case DRAW_ARC:
  612. Doc->MyOperate.DrawArcB(&dc, pApp->CADInfo.LRepeatTimes);
  613. break;
  614. }
  615. CScrollView::OnHScroll(nSBCode, nPos, pScrollBar);
  616. }
  617. void CMiniCADView::OnDestroy() 
  618. {
  619. CScrollView::OnDestroy();
  620. // TODO: Add your message handler code here
  621. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  622. pApp->CADInfo.LRepeatTimes = 0;
  623. }
  624. //屏幕放大
  625. void CMiniCADView::OnZoomout() 
  626. {
  627. // TODO: Add your command handler code here
  628. CMiniCADDoc* pDoc = GetDocument();
  629. if(Proportion < 4)
  630. {
  631. Proportion += 0.25;
  632.         pDoc->MyOperate.Proportion = Proportion;
  633. //根据图纸尺寸设置滚动条滚动区域(既客户区)
  634. Size.cx = (long)(pDoc->FileInfo.size.cx * Proportion) + EXTRA_WIDTH * 2; 
  635. Size.cy = (long)(pDoc->FileInfo.size.cy * Proportion) + EXTRA_HIGTH * 2;
  636. SetScrollSizes(MM_TEXT, Size);
  637. pDoc->MyOperate.size.cx = Size.cx;
  638. pDoc->MyOperate.size.cy = Size.cy;
  639. CComboBox* pSizeCombo = (CComboBox*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_FILESIZE);
  640.     pSizeCombo->SetCurSel((int)(Proportion / 0.25 - 1));
  641. Invalidate();
  642. }
  643. }
  644. //屏幕缩小
  645. void CMiniCADView::OnZoomin() 
  646. {
  647. // TODO: Add your command handler code here
  648. CMiniCADDoc* pDoc = GetDocument();
  649. if(Proportion > 0.25)
  650. {
  651. Proportion -= 0.25;
  652.         pDoc->MyOperate.Proportion = Proportion;
  653. //根据图纸尺寸设置滚动条滚动区域(既客户区)
  654. Size.cx = (long)(pDoc->FileInfo.size.cx * Proportion) + EXTRA_WIDTH * 2; 
  655. Size.cy = (long)(pDoc->FileInfo.size.cy * Proportion) + EXTRA_HIGTH * 2;
  656. SetScrollSizes(MM_TEXT, Size);
  657. pDoc->MyOperate.size.cx = Size.cx;
  658. pDoc->MyOperate.size.cy = Size.cy;
  659. CComboBox* pSizeCombo = (CComboBox*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_FILESIZE);
  660.     pSizeCombo->SetCurSel((int)(Proportion / 0.25 - 1));
  661. Invalidate();
  662. }
  663. }
  664. //选择图纸尺寸
  665. void CMiniCADView::OnSelchangeFilesize() 
  666. {
  667. // TODO: Add your control notification handler code here
  668. CMiniCADDoc* pDoc = GetDocument();
  669. int index;
  670. CComboBox* pSizeCombo = (CComboBox*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_FILESIZE);
  671. index = pSizeCombo->GetCurSel();
  672.     Proportion = (index + 1) * (float)0.25;
  673. pDoc->MyOperate.Proportion = Proportion;
  674. //根据图纸尺寸设置滚动条滚动区域(既客户区)
  675. Size.cx = (long)(pDoc->FileInfo.size.cx * Proportion) + EXTRA_WIDTH * 2; 
  676. Size.cy = (long)(pDoc->FileInfo.size.cy * Proportion) + EXTRA_HIGTH * 2;
  677. SetScrollSizes(MM_TEXT, Size);
  678. pDoc->MyOperate.size.cx = Size.cx;
  679. pDoc->MyOperate.size.cy = Size.cy;
  680. Invalidate();
  681. }
  682. void CMiniCADView::OnSelchangeColor() 
  683. {
  684. // TODO: Add your control notification handler code here
  685. CMiniCADDoc* Doc = GetDocument();
  686. CComboBoxEx* ColorCombo = (CComboBoxEx*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_COLOR);
  687. switch(ColorCombo->GetCurSel())
  688. {
  689. case 0:
  690. pApp->CADInfo.ForeColor = RGB(0, 0, 0);
  691. break;
  692. case 1:
  693. pApp->CADInfo.ForeColor = RGB(255, 0, 0);
  694. break;
  695. case 2:
  696. pApp->CADInfo.ForeColor = RGB(255, 255, 0);
  697. break;
  698. case 3:
  699. pApp->CADInfo.ForeColor = RGB(0, 255, 0);
  700. break;
  701. case 4:
  702. pApp->CADInfo.ForeColor = RGB(0, 255, 255);
  703. break;
  704. case 5:
  705. pApp->CADInfo.ForeColor = RGB(0, 0, 255);
  706. break;
  707. case 6:
  708. pApp->CADInfo.ForeColor = RGB( 255, 0, 255);
  709. break;
  710. }
  711.     Doc->MyOperate.ForeColor = pApp->CADInfo.ForeColor;
  712. }
  713. void CMiniCADView::OnSelchangeLinestyle() 
  714. {
  715. // TODO: Add your control notification handler code here
  716. CMiniCADDoc* Doc = GetDocument();
  717. CComboBoxEx* LineStyleCombo = (CComboBoxEx*)pMainWnd->m_MyOptionBar.GetDlgItem(IDC_LINESTYLE);
  718. switch(LineStyleCombo->GetCurSel())
  719. {
  720. case 0:
  721. pApp->CADInfo.LineStyle = PS_SOLID;
  722. break;
  723. case 1:
  724. pApp->CADInfo.LineStyle = PS_DASH;
  725. break;
  726. case 2:
  727. pApp->CADInfo.LineStyle = PS_DOT;
  728. break;
  729. case 3:
  730. pApp->CADInfo.LineStyle = PS_DASHDOT;
  731. break;
  732. case 4:
  733. pApp->CADInfo.LineStyle = PS_DASHDOTDOT;
  734. break;
  735. }
  736.     Doc->MyOperate.LineStyle = pApp->CADInfo.LineStyle;
  737. }
  738. void CMiniCADView::OnSize(UINT nType, int cx, int cy) 
  739. {
  740. CScrollView::OnSize(nType, cx, cy);
  741. // TODO: Add your message handler code here
  742. //当改变视图尺寸时取消当前的绘图命令
  743. pApp->CADInfo.CurrentCommand = DRAW_SELECT;
  744. pApp->CADInfo.LRepeatTimes = 0;
  745. }
  746. void CMiniCADView::OnViewRedraw() 
  747. {
  748. // TODO: Add your command handler code here
  749. //激活OnDraw()函数,重画当前视图
  750. Invalidate();
  751. }
  752. void CMiniCADView::OnEditUndo() 
  753. {
  754. // TODO: Add your command handler code here
  755. CMyCommandStruct* pCommand;
  756. CMyObjectInfo* pLineInfo;
  757. CMyObjectInfo* pRectInfo;
  758. CMyObjectInfo* pCircleInfo;
  759. CMyObjectInfo* pArcInfo;
  760. CMiniCADDoc* Doc = GetDocument();
  761. if(Doc->MyCommand.CommandPointer < 0)
  762. return;
  763. pCommand = (CMyCommandStruct*)Doc->MyCommand.GetCommandAt(Doc->MyCommand.CommandPointer);
  764.     switch(pCommand->m_command)
  765. {
  766. case ID_DRAW_LINE:
  767. pLineInfo = (CMyObjectInfo*)Doc->MyOperate.m_LineInfoArray.GetAt(pCommand->m_index[0]);
  768.         pLineInfo->m_del = TRUE;
  769. break;
  770. case ID_DRAW_RECT:
  771. pRectInfo = (CMyObjectInfo*)Doc->MyOperate.m_RectInfoArray.GetAt(pCommand->m_index[0]);
  772.         pRectInfo->m_del = TRUE;
  773. break;
  774. case ID_DRAW_CIRCLE:
  775. pCircleInfo = (CMyObjectInfo*)Doc->MyOperate.m_CircleInfoArray.GetAt(pCommand->m_index[0]);
  776.         pCircleInfo->m_del = TRUE;
  777. break;
  778. case ID_DRAW_ARC:
  779. pArcInfo = (CMyObjectInfo*)Doc->MyOperate.m_ArcInfoArray.GetAt(pCommand->m_index[0]);
  780.         pArcInfo->m_del = TRUE;
  781. break;
  782. case ID_CHANGE_DELETE:
  783. for(int index =0; index < pCommand->m_num; index++)
  784. {
  785. switch(pCommand->m_object[index])
  786. {
  787. case OBJ_LINE:
  788. pLineInfo = (CMyObjectInfo*)Doc->MyOperate.m_LineInfoArray.GetAt(pCommand->m_index[index]);
  789. pLineInfo->m_del = FALSE;
  790. break;
  791. case OBJ_RECT:
  792. pRectInfo = (CMyObjectInfo*)Doc->MyOperate.m_RectInfoArray.GetAt(pCommand->m_index[index]);
  793. pRectInfo->m_del = FALSE;
  794. break;
  795. case OBJ_CIRCLE:
  796. pCircleInfo = (CMyObjectInfo*)Doc->MyOperate.m_CircleInfoArray.GetAt(pCommand->m_index[index]);
  797. pCircleInfo->m_del = FALSE;
  798. break;
  799. case OBJ_ARC:
  800. pArcInfo = (CMyObjectInfo*)Doc->MyOperate.m_ArcInfoArray.GetAt(pCommand->m_index[index]);
  801. pArcInfo->m_del = FALSE;
  802. break;
  803. }
  804. }
  805. break;
  806. }
  807.      
  808. Doc->MyCommand.CommandPointer--;
  809. Invalidate();
  810. }
  811. void CMiniCADView::OnUpdateEditUndo(CCmdUI* pCmdUI) 
  812. {
  813. // TODO: Add your command update UI handler code here
  814. CMiniCADDoc* Doc = GetDocument();
  815. if(Doc->MyCommand.m_CommandArray.GetSize() > 0 &&
  816.    Doc->MyCommand.CommandPointer > -1)
  817. pCmdUI->Enable(TRUE);
  818. else
  819. pCmdUI->Enable(FALSE);
  820. }
  821. void CMiniCADView::OnEditRedo() 
  822. {
  823. // TODO: Add your command handler code here
  824. CMyCommandStruct* pCommand;
  825. CMyObjectInfo* pLineInfo;
  826. CMyObjectInfo* pRectInfo;
  827. CMyObjectInfo* pCircleInfo;
  828. CMyObjectInfo* pArcInfo;
  829. CMiniCADDoc* Doc = GetDocument();
  830. if(Doc->MyCommand.CommandPointer == Doc->MyCommand.m_CommandArray.GetUpperBound())
  831. return;
  832. else
  833. Doc->MyCommand.CommandPointer++;
  834. pCommand = (CMyCommandStruct*)Doc->MyCommand.GetCommandAt(Doc->MyCommand.CommandPointer);
  835.     switch(pCommand->m_command)
  836. {
  837. case ID_DRAW_LINE:
  838. pLineInfo = (CMyObjectInfo*)Doc->MyOperate.m_LineInfoArray.GetAt(pCommand->m_index[0]);
  839.         pLineInfo->m_del = FALSE;
  840. break;
  841. case ID_DRAW_RECT:
  842. pRectInfo = (CMyObjectInfo*)Doc->MyOperate.m_RectInfoArray.GetAt(pCommand->m_index[0]);
  843.         pRectInfo->m_del = FALSE;
  844. break;
  845. case ID_DRAW_CIRCLE:
  846. pCircleInfo = (CMyObjectInfo*)Doc->MyOperate.m_CircleInfoArray.GetAt(pCommand->m_index[0]);
  847.         pCircleInfo->m_del = FALSE;
  848. break;
  849. case ID_DRAW_ARC:
  850. pArcInfo = (CMyObjectInfo*)Doc->MyOperate.m_ArcInfoArray.GetAt(pCommand->m_index[0]);
  851.         pArcInfo->m_del = FALSE;
  852. break;
  853. case ID_CHANGE_DELETE:
  854. for(int index =0; index < pCommand->m_num; index++)
  855. {
  856. switch(pCommand->m_object[index])
  857. {
  858. case OBJ_LINE:
  859. pLineInfo = (CMyObjectInfo*)Doc->MyOperate.m_LineInfoArray.GetAt(pCommand->m_index[index]);
  860. pLineInfo->m_del = TRUE;
  861. break;
  862. case OBJ_RECT:
  863. pRectInfo = (CMyObjectInfo*)Doc->MyOperate.m_RectInfoArray.GetAt(pCommand->m_index[index]);
  864. pRectInfo->m_del = TRUE;
  865. break;
  866. case OBJ_CIRCLE:
  867. pCircleInfo = (CMyObjectInfo*)Doc->MyOperate.m_CircleInfoArray.GetAt(pCommand->m_index[index]);
  868. pCircleInfo->m_del = TRUE;
  869. break;
  870. case OBJ_ARC:
  871. pArcInfo = (CMyObjectInfo*)Doc->MyOperate.m_ArcInfoArray.GetAt(pCommand->m_index[index]);
  872. pArcInfo->m_del = TRUE;
  873. break;
  874. }
  875. }
  876. break;
  877. }
  878. Invalidate();
  879. }
  880. void CMiniCADView::OnUpdateEditRedo(CCmdUI* pCmdUI) 
  881. {
  882. // TODO: Add your command update UI handler code here
  883. CMiniCADDoc* Doc = GetDocument();
  884. if(Doc->MyCommand.m_CommandArray.GetSize() > 0 &&
  885.    Doc->MyCommand.CommandPointer < Doc->MyCommand.m_CommandArray.GetUpperBound())
  886. pCmdUI->Enable(TRUE);
  887. else
  888. pCmdUI->Enable(FALSE);
  889. }
  890. void CMiniCADView::OnUpdateDrawSelect(CCmdUI* pCmdUI) 
  891. {
  892. // TODO: Add your command update UI handler code here
  893. pCmdUI->SetRadio(pApp->CADInfo.CurrentCommand == DRAW_SELECT);
  894. pCmdUI->ContinueRouting();
  895. }
  896. void CMiniCADView::OnModifyDelete() 
  897. {
  898. // TODO: Add your command handler code here
  899. int* pObjectType;
  900. int* pObjetcIndex;
  901. int nIndex;
  902. int num;
  903. CMyObjectInfo* pLineInfo;
  904. CMyObjectInfo* pRectInfo;
  905. CMyObjectInfo* pCircleInfo;
  906. CMyObjectInfo* pArcInfo;
  907. CMySelObjectInfo* pSelObjectInfo;
  908. CMiniCADDoc* Doc = GetDocument();
  909. num = Doc->MyOperate.m_SelObjInfoArray.GetSize();
  910. pObjectType = new int[num];
  911. pObjetcIndex = new int[num];
  912. for(nIndex = 0; nIndex < num; nIndex++)
  913. {
  914. pSelObjectInfo = (CMySelObjectInfo*)Doc->MyOperate.m_SelObjInfoArray.GetAt(nIndex);
  915. switch(pSelObjectInfo->m_type)
  916. {
  917. case OBJ_LINE:
  918. pLineInfo = (CMyObjectInfo*)Doc->MyOperate.m_LineInfoArray.GetAt(pSelObjectInfo->m_index);
  919. pLineInfo->m_del = TRUE;
  920. pObjectType[nIndex] = OBJ_LINE;
  921. pObjetcIndex[nIndex] = pSelObjectInfo->m_index;
  922. break;
  923. case OBJ_RECT:
  924. pRectInfo = (CMyObjectInfo*)Doc->MyOperate.m_RectInfoArray.GetAt(pSelObjectInfo->m_index);
  925. pRectInfo->m_del = TRUE;
  926. pObjectType[nIndex] = OBJ_RECT;
  927. pObjetcIndex[nIndex] = pSelObjectInfo->m_index;
  928. break;
  929. case OBJ_CIRCLE:
  930. pCircleInfo = (CMyObjectInfo*)Doc->MyOperate.m_CircleInfoArray.GetAt(pSelObjectInfo->m_index);
  931. pCircleInfo->m_del = TRUE;
  932. pObjectType[nIndex] = OBJ_CIRCLE;
  933. pObjetcIndex[nIndex] = pSelObjectInfo->m_index;
  934. break;
  935. case OBJ_ARC:
  936. pArcInfo = (CMyObjectInfo*)Doc->MyOperate.m_ArcInfoArray.GetAt(pSelObjectInfo->m_index);
  937. pArcInfo->m_del = TRUE;
  938. pObjectType[nIndex] = OBJ_ARC;
  939. pObjetcIndex[nIndex] = pSelObjectInfo->m_index;
  940. break;
  941. }
  942. }
  943. Doc->MyCommand.DelCommandFrom(Doc->MyCommand.CommandPointer + 1);
  944. Doc->MyCommand.AddCommand(ID_CHANGE_DELETE, num, pObjectType, pObjetcIndex);
  945. Doc->MyCommand.CommandPointer = Doc->MyCommand.m_CommandArray.GetUpperBound();
  946.     Doc->MyOperate.UnselectObject();
  947. Invalidate();
  948. delete pObjectType;
  949. delete pObjetcIndex;
  950. }
  951. void CMiniCADView::OnUpdateChangeDelete(CCmdUI* pCmdUI) 
  952. {
  953. // TODO: Add your command update UI handler code here
  954. CMiniCADDoc* Doc = GetDocument();
  955. if(Doc->MyOperate.m_SelObjInfoArray.GetSize() > 0)
  956. pCmdUI->Enable(TRUE);
  957. else
  958. pCmdUI->Enable(FALSE);
  959. }
  960. void CMiniCADView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) 
  961. {
  962. // TODO: Add your specialized code here and/or call the base class
  963. CScrollView::OnPrepareDC(pDC, pInfo);
  964. }
  965. void CMiniCADView::OnModifyCopy() 
  966. {
  967. }
  968. void CMiniCADView::OnModifyCut() 
  969. {
  970. }
  971. void CMiniCADView::OnModifyCuttoangle() 
  972. {
  973. }
  974. void CMiniCADView::OnModifyLengthento() 
  975. {
  976. }
  977. void CMiniCADView::OnModifyJoin() 
  978. {
  979. }
  980. void CMiniCADView::OnModifyMirror() 
  981. {
  982. }
  983. void CMiniCADView::OnModifyVertical() 
  984. {
  985. }
  986. void CMiniCADView::OnModifyMove() 
  987. {
  988. }
  989. void CMiniCADView::OnModifyRotate() 
  990. {
  991. }
  992. void CMiniCADView::OnModifyExcursion() 
  993. {
  994. }
  995. void CMiniCADView::OnEditCopy() 
  996. {
  997. }
  998. void CMiniCADView::OnEditCut() 
  999. {
  1000. }
  1001. void CMiniCADView::OnEditPaste() 
  1002. {
  1003. }
  1004. void CMiniCADView::OnComponentDefine() 
  1005. {
  1006. // TODO: Add your command handler code here
  1007. }
  1008. void CMiniCADView::OnComponentInsert() 
  1009. {
  1010. // TODO: Add your command handler code here
  1011. }
  1012. void CMiniCADView::OnAlignBottom() 
  1013. {
  1014. // TODO: Add your command handler code here
  1015. }
  1016. void CMiniCADView::OnAlignConcentric() 
  1017. {
  1018. // TODO: Add your command handler code here
  1019. }
  1020. void CMiniCADView::OnAlignLeft() 
  1021. {
  1022. // TODO: Add your command handler code here
  1023. }
  1024. void CMiniCADView::OnAlignOnline() 
  1025. {
  1026. // TODO: Add your command handler code here
  1027. }
  1028. void CMiniCADView::OnAlignRight() 
  1029. {
  1030. // TODO: Add your command handler code here
  1031. }
  1032. void CMiniCADView::OnAlignTop() 
  1033. {
  1034. // TODO: Add your command handler code here
  1035. }
  1036. void CMiniCADView::OnDrawFill() 
  1037. {
  1038. // TODO: Add your command handler code here
  1039. }
  1040. void CMiniCADView::OnModifyBreak() 
  1041. {
  1042. // TODO: Add your command handler code here
  1043. }