DrawObj.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. ///************************************************************************/
  2. /* Copyright (C), 2016-2020, [Home], 保留所有权利;
  3. /* 模 块 名:;
  4. /* 描 述:;
  5. /*
  6. /* 版 本:[V];
  7. /* 作 者:[Home];
  8. /* 日 期:[10/26/2016];
  9. /*
  10. /*
  11. /* 注 意:;
  12. /*
  13. /* 修改记录:[Home];
  14. /* 修改日期:;
  15. /* 修改版本:;
  16. /* 修改内容:;
  17. /************************************************************************/
  18. #ifndef __DRAWOBJ_HEADER__
  19. #define __DRAWOBJ_HEADER__
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. #include "ReportColPage.h"
  25. //#include "Picture.h"
  26. #include "ImageEx.h"
  27. #include "shockwaveflash.h"
  28. class CGraph;
  29. struct LAYOUTSTRUCT
  30. {
  31. CRect rect; // m_rect (Normalized);
  32. // left点;
  33. int nX1; // m_rect.left (Normalized);
  34. // right点;
  35. int nX2; // m_rect.right (Normalized);
  36. // top点;
  37. int nY1; // m_rect.top (Normalized);
  38. // bottom点;
  39. int nY2; // m_rect.bottom(Normalized);
  40. // width宽;
  41. int nXX; // m_rect.Width();
  42. // height高;
  43. int nYY; // m_rect.Height();
  44. // left + width/2;
  45. int nX0; // 中心点X坐标;
  46. // top + heigth/2;
  47. int nY0; // 中心点Y坐标;
  48. BOOL bHoriz; // 方向标志;
  49. BOOL bXInvert; // X方向反转标志;
  50. BOOL bYInvert; // Y方向反转标志;
  51. int nMinSize; // 可画的最小尺寸;
  52. };
  53. // 定义操作
  54. //---------------------------------------------- CAction -----------
  55. class CAction:public CObject
  56. {
  57. public:
  58. // 0=鼠标按下;1=鼠标松开;2=鼠标移动;3=链接操作;4=退出操作;
  59. int m_nActionType;
  60. // 触发操作的表达式;
  61. CString m_strVariant;
  62. // 触发操作的条件值;
  63. CString m_strActionValue;
  64. // 图片路径(用图片来具体化);
  65. CString m_strPicPath;
  66. DECLARE_SERIAL(CAction);
  67. CAction();
  68. virtual CAction* Clone(void);
  69. virtual void Serialize(CArchive& ar);
  70. CAction& operator=(CAction& action);
  71. };
  72. /************************************************************************/
  73. /* Copyright (C), 2016-2020, [IT], 保留所有权利;
  74. /* 模 块 名:CDrawObj类, 图元基类;
  75. /* 描 述:所有图元的基类;
  76. /*
  77. /* 版 本:[V];
  78. /* 作 者:[IT];
  79. /* 日 期:[5/11/2016];
  80. /*
  81. /*
  82. /* 注 意:;
  83. /*
  84. /* 修改记录:[IT];
  85. /* 修改日期:;
  86. /* 修改版本:;
  87. /* 修改内容:;
  88. /*
  89. /* 建议:新设计的图元应按以下方式:
  90. /* 图元:1,属性, 2,方法, 3,事件(回调);
  91. /************************************************************************/
  92. class CDrawObj:public CObject
  93. {
  94. public:
  95. DECLARE_SERIAL(CDrawObj);
  96. CDrawObj();
  97. public:
  98. CView* m_pView;
  99. // 图元大小;
  100. CRect m_rect;
  101. public:
  102. // 图元名称集合;
  103. static CStringArray drawsName;
  104. // 图元运行时对象集合;
  105. static CPtrArray drawsRuntimeClass;
  106. static void RegisterClass(CString strName,CRuntimeClass* pRuntimeClass);
  107. public:
  108. COLORREF m_clrFore; // 前景色;
  109. COLORREF m_clrLine; // 线条色;
  110. COLORREF m_clrBack; // 背景色;
  111. COLORREF m_clrFill; // 填充色;
  112. LOGFONT m_logfont; // 字体;
  113. CString m_strLineType; // 线型;
  114. int m_nLineWidth; // 线宽;
  115. CString m_strCaption; // 内联的文本(如果m_bVariant==TRUE,则为变量名);
  116. BOOL m_bVariant; // 是否是变量;
  117. BOOL m_bDynShow; // 是否动态显示;
  118. CString m_strDynShow; // 动态显示条件;
  119. BOOL m_bLocked; // 是否锁定不移动;
  120. BOOL m_bAligned; // 用来等距排列的标志位
  121. // 动态参数;
  122. COLORREF m_clrDynFore; // 动态前景色;
  123. CString m_strDynForeCon; // 动态前景内容;
  124. COLORREF m_clrDynBack; // 动态背景色;
  125. CString m_strDynBackCon; // 动态背景内容;
  126. COLORREF m_clrDynLine; // 线条动态色;
  127. CString m_strDynLineCon; // 线条动态内容;
  128. BOOL m_bDynFore; // 是否动态前景;
  129. BOOL m_bDynBack; // 是否动态背景;
  130. BOOL m_bDynLine; // 是否动态线条;
  131. int m_nFillMode; // 是否填充模式;
  132. CString m_strHoriPos; // 水平位置;
  133. CString m_strHoriSize; // 水平大小;
  134. CString m_strVertiPos; // 垂直位置;
  135. CString m_strVertiSize; // 垂直大小;
  136. BOOL m_bVertiSize; // 是否垂直大小;
  137. BOOL m_bVertiPos; // 是否垂直位置;
  138. BOOL m_bHorizSize; // 是否水平大小;注意: 为真时 报警背景闪烁;
  139. BOOL m_bHorizPos; // 是否水平位置;
  140. int m_nHorAlign;
  141. int m_nVerAlign;
  142. // 动态值;
  143. CRect m_rctCurrent; // 当图元内联变量后,动态显示的区域大小;
  144. COLORREF m_clrCurrentFore;
  145. COLORREF m_clrCurrentBack;
  146. COLORREF m_clrCurrentLine;
  147. CString m_strCurrentCaption; // 当前显示的文本(外在显示,与m_strCaption不同);
  148. BOOL m_bShow; // 是否可见;
  149. float m_fCurrentValue;
  150. BOOL m_bShowtemp;//chn add 为了GIF,flasg,OCX的隐藏和显示
  151. // 动作属性;
  152. CAction m_downAction;
  153. CAction m_upAction;
  154. CAction m_moveAction;
  155. BOOL m_bOnButtonUp;
  156. BOOL m_bOnButtonDown;
  157. BOOL m_bOnMove;//注意: 为真时 可以选择,但不能复制和移动
  158. //
  159. BOOL m_bHisFreshed;
  160. // 组合内动态缩放;
  161. double m_dbLeftRate;
  162. double m_dbRightRate;
  163. double m_dbTopRate;
  164. double m_dbBottomRate;
  165. public:
  166. static BOOL bRuning; // 是否处于运行状态;
  167. BOOL m_bModifyMore; // 是否是编辑多个;
  168. public:
  169. CDrawObj& operator=(CDrawObj& drawObj);
  170. virtual CDrawObj* Clone(void);
  171. virtual void Serialize(CArchive& ar);
  172. virtual BOOL OnAttrib(void);
  173. virtual BOOL OnAttrib(CPropertySheet& sheet);
  174. virtual void Draw(CDC* pDC);
  175. void DrawText(CDC* pDC);
  176. virtual bool Fresh(OUT CRect &RECT );
  177. void DrawHKedu(CDC* pDC, CRect rect, int nKedu, COLORREF clrKedu);
  178. void DrawVKedu(CDC* pDC, CRect rect, int nKedu, COLORREF clrKedu);
  179. void DrawArcKedu(CDC* pDC, CRect rect, int nStartAngle, int nEndAngle, int nKedu, COLORREF clrKedu);
  180. public:
  181. LOGBRUSH GetBrush();
  182. // 画框架;
  183. void DrawFrame(CDC* pDC);
  184. void ProcessAction(int type);
  185. // 获取Pen类型;
  186. int GetPenStyle(CString penType);
  187. // 布局;
  188. void Layout(BYTE Sharp,LAYOUTSTRUCT* pLayout);
  189. // 获取手势数量;
  190. virtual int GetHandleCount(void);
  191. // 获取手势所在点位置;
  192. virtual CPoint GetHandle(int nHandle);
  193. // 获取手势区域;
  194. CRect GetHandleRect(int nHandle);
  195. // 获取手势图标;
  196. virtual HCURSOR GetHandleCursor();
  197. // 移动到指定区域;
  198. virtual void MoveTo(CRect rect);
  199. // 移动手势到指定点;
  200. virtual void MoveHandleTo(int nHandle, CPoint point);
  201. // 画跟踪器;
  202. virtual void DrawTracker(CDC* pDC);
  203. // 单击;
  204. virtual int HitTest(CPoint point);
  205. // 是否相交;
  206. virtual BOOL Intersects(CRect rect);
  207. // 刷新;
  208. virtual void Invalidate(void);
  209. private:
  210. bool m_bFlag1,m_bFlag2,m_bFlag3;
  211. };
  212. typedef CTypedPtrList<CObList, CDrawObj*> CDrawObjList;
  213. //---------------------------------------------- CDrawComposite ---
  214. class CDrawComposite:public CDrawObj
  215. {
  216. public:
  217. DECLARE_SERIAL(CDrawComposite);
  218. CDrawComposite();
  219. CDrawComposite(CDrawObjList &ObjList);
  220. ~CDrawComposite();
  221. public:
  222. CDrawComposite& operator=(CDrawComposite& drawObj);
  223. virtual CDrawObj* Clone(void);
  224. virtual void Serialize(CArchive& ar);
  225. virtual void Draw(CDC* pDC);
  226. virtual void MoveTo(CRect rect);
  227. public:
  228. CDrawObjList m_ObjList;
  229. };
  230. //---------------------------------------------- CDrawTLine -------
  231. class CDrawTLine:public CDrawObj
  232. {
  233. public:
  234. DECLARE_SERIAL(CDrawTLine);
  235. CDrawTLine();
  236. public:
  237. virtual CDrawObj* Clone(void);
  238. virtual void Draw(CDC* pDC);
  239. //virtual bool Fresh( CRect &RECT );
  240. };
  241. //---------------------------------------------- CDrawLine -------
  242. class CDrawLine:public CDrawObj
  243. {
  244. public:
  245. DECLARE_SERIAL(CDrawLine);
  246. CDrawLine();
  247. public:
  248. virtual CDrawObj* Clone(void);
  249. virtual void Draw(CDC* pDC);
  250. //virtual bool Fresh( CRect &RECT );
  251. };
  252. //---------------------------------------------- CDrawText --------
  253. class CDrawText:public CDrawObj
  254. {
  255. public:
  256. DECLARE_SERIAL(CDrawText);
  257. CDrawText();
  258. public:
  259. virtual CDrawObj* Clone(void);
  260. virtual void Draw(CDC* pDC);
  261. virtual void DrawText(CDC* pDC);
  262. virtual bool Fresh( CRect &RECT );
  263. };
  264. //---------------------------------------------- CDrawRect --------
  265. class CDrawRect:public CDrawObj
  266. {
  267. public:
  268. DECLARE_SERIAL(CDrawRect);
  269. CDrawRect();
  270. public:
  271. virtual CDrawObj* Clone(void);
  272. virtual void Draw(CDC* pDC);
  273. //virtual bool Fresh( CRect &RECT );
  274. };
  275. //---------------------------------------------- CDrawRoundRect --------
  276. class CDrawRoundRect:public CDrawObj
  277. {
  278. public:
  279. DECLARE_SERIAL(CDrawRoundRect);
  280. CDrawRoundRect();
  281. public:
  282. virtual CDrawObj* Clone(void);
  283. virtual void Draw(CDC* pDC);
  284. //virtual bool Fresh( CRect &RECT );
  285. };
  286. //---------------------------------------------- CDrawOval --------
  287. class CDrawOval:public CDrawObj
  288. {
  289. public:
  290. DECLARE_SERIAL(CDrawOval);
  291. CDrawOval();
  292. public:
  293. virtual CDrawObj* Clone(void);
  294. virtual void Draw(CDC* pDC);
  295. //virtual bool Fresh( CRect &RECT );
  296. };
  297. //---------------------------------------------- CDrawPie --------
  298. class CDrawPie:public CDrawObj
  299. {
  300. public:
  301. DECLARE_SERIAL(CDrawPie);
  302. CDrawPie();
  303. int m_nStartAngle;
  304. int m_nSweepAngle;
  305. public:
  306. virtual CDrawObj* Clone(void);
  307. virtual void Draw(CDC* pDC);
  308. virtual void Serialize(CArchive& ar);
  309. virtual BOOL OnAttrib(CPropertySheet& sheet);
  310. };
  311. //---------------------------------------------- CDrawFan --------
  312. class CDrawFan:public CDrawObj
  313. {
  314. public:
  315. DECLARE_SERIAL(CDrawFan);
  316. CDrawFan();
  317. public:
  318. virtual CDrawObj* Clone(void);
  319. virtual void Draw(CDC* pDC);
  320. virtual void Serialize(CArchive& ar);
  321. virtual bool Fresh( CRect &RECT );
  322. virtual BOOL OnAttrib(CPropertySheet& sheet);
  323. public:
  324. int m_nStep;
  325. bool m_bComputed;
  326. BOOL m_bRun;
  327. CPoint tagPoint[8];
  328. CString m_strLogic;
  329. };
  330. //---------------------------------------------- CDrawArc --------
  331. class CDrawArc:public CDrawObj
  332. {
  333. public:
  334. DECLARE_SERIAL(CDrawArc);
  335. CDrawArc();
  336. int m_nStartAngle;
  337. int m_nSweepAngle;
  338. public:
  339. virtual CDrawObj* Clone(void);
  340. virtual void Draw(CDC* pDC);
  341. virtual void Serialize(CArchive& ar);
  342. virtual BOOL OnAttrib(CPropertySheet& sheet);
  343. };
  344. //---------------------------------------------- CDrawPoly --------
  345. class CDrawPoly:public CDrawObj
  346. {
  347. public:
  348. DECLARE_SERIAL(CDrawPoly);
  349. CDrawPoly();
  350. ~CDrawPoly();
  351. int m_nPoints;
  352. int m_nAllocPoints;
  353. CPoint* m_points;
  354. public:
  355. void AddPoint(const CPoint& point);
  356. BOOL RecalcBounds();
  357. public:
  358. virtual CDrawObj* Clone(void);
  359. virtual void Draw(CDC* pDC);
  360. virtual void Serialize(CArchive& ar);
  361. virtual void MoveTo(CRect rect);
  362. virtual int GetHandleCount();
  363. virtual CPoint GetHandle(int nHandle);
  364. virtual void MoveHandleTo(int nHandle, CPoint point);
  365. };
  366. //---------------------------------------------- CDrawMLine --------
  367. class CDrawMLine:public CDrawPoly
  368. {
  369. public:
  370. DECLARE_SERIAL(CDrawMLine);
  371. CDrawMLine();
  372. public:
  373. virtual CDrawObj* Clone(void);
  374. virtual void Draw(CDC* pDC);
  375. };
  376. //---------------------------------------------- CDrawArrow -------
  377. class CDrawArrow:public CDrawObj
  378. {
  379. public:
  380. DECLARE_SERIAL(CDrawArrow);
  381. CDrawArrow();
  382. public:
  383. virtual CDrawObj* Clone(void);
  384. virtual void Draw(CDC* pDC);
  385. void DrawArrow(CDC* pDC, CRect rect, BYTE Direction,COLORREF clrArrow );
  386. };
  387. //---------------------------------------------- CDrawButton ------
  388. class CDrawButton:public CDrawObj
  389. {
  390. public:
  391. DECLARE_SERIAL(CDrawButton);
  392. CDrawButton();
  393. public:
  394. virtual CDrawObj* Clone(void);
  395. virtual void Draw(CDC* pDC);
  396. };
  397. //---------------------------------------------- CDraw3dCircle ------
  398. class CDraw3dCircle:public CDrawObj
  399. {
  400. public:
  401. DECLARE_SERIAL(CDraw3dCircle);
  402. CDraw3dCircle();
  403. public:
  404. virtual CDrawObj* Clone(void);
  405. virtual void Draw(CDC* pDC);
  406. };
  407. //---------------------------------------------- CDrawBreaker ------
  408. class CDrawBreaker:public CDrawObj
  409. {
  410. public:
  411. DECLARE_SERIAL(CDrawBreaker);
  412. CDrawBreaker();
  413. public:
  414. virtual CDrawObj* Clone(void);
  415. virtual void Draw(CDC* pDC);
  416. };
  417. //---------------------------------------------- CDrawSwitch ------
  418. class CDrawSwitch:public CDrawObj
  419. {
  420. public:
  421. DECLARE_SERIAL(CDrawSwitch);
  422. CDrawSwitch();
  423. public:
  424. virtual CDrawObj* Clone(void);
  425. virtual void Draw(CDC* pDC);
  426. virtual void Serialize(CArchive& ar);
  427. virtual bool Fresh( CRect &RECT );
  428. virtual BOOL OnAttrib(CPropertySheet& sheet);
  429. public:
  430. BOOL m_bRun;
  431. CString m_strLogic;
  432. };
  433. //---------------------------------------------- CDrawGrid ------
  434. class CDrawGrid:public CDrawObj
  435. {
  436. public:
  437. DECLARE_SERIAL(CDrawGrid);
  438. CDrawGrid();
  439. public:
  440. virtual CDrawObj* Clone(void);
  441. virtual void Draw(CDC* pDC);
  442. };
  443. //---------------------------------------------- CDrawTable ------
  444. class CDrawTable:public CDrawObj
  445. {
  446. public:
  447. DECLARE_SERIAL(CDrawTable);
  448. CDrawTable();
  449. BOOL m_bAddAve;
  450. BOOL m_bAddMax;
  451. BOOL m_bAddMin;
  452. int m_nType;
  453. BOOL m_bShowRowHead;
  454. CColProList m_colList;
  455. public:
  456. CString GetColFormat(int col);
  457. virtual CDrawObj* Clone(void);
  458. virtual void Draw(CDC* pDC);
  459. virtual void Serialize(CArchive& ar);
  460. virtual BOOL OnAttrib(CPropertySheet& sheet);
  461. };
  462. //---------------------------------------------- CDrawPipe ------
  463. class CDrawPipe:public CDrawObj
  464. {
  465. public:
  466. DECLARE_SERIAL(CDrawPipe);
  467. CDrawPipe();
  468. public:
  469. virtual CDrawObj* Clone(void);
  470. virtual void Draw(CDC* pDC);
  471. };
  472. //---------------------------------------------- CDrawZhePipe ------
  473. class CDrawZhePipe:public CDrawObj
  474. {
  475. public:
  476. DECLARE_SERIAL(CDrawZhePipe);
  477. CDrawZhePipe();
  478. public:
  479. virtual CDrawObj* Clone(void);
  480. virtual void Draw(CDC* pDC);
  481. };
  482. //---------------------------------------------- CDrawYPipe ------
  483. class CDrawYPipe:public CDrawObj
  484. {
  485. public:
  486. DECLARE_SERIAL(CDrawYPipe);
  487. CDrawYPipe();
  488. public:
  489. virtual CDrawObj* Clone(void);
  490. virtual void Draw(CDC* pDC);
  491. };
  492. //---------------------------------------------- CDrawBitmap ------
  493. class CDrawBitmap:public CDrawObj
  494. {
  495. public:
  496. DECLARE_SERIAL(CDrawBitmap);
  497. CDrawBitmap();
  498. ~CDrawBitmap();
  499. // 动态图像(gif、flash);
  500. CString m_strDynFile;
  501. // 静态图像(jpg、png);
  502. CString m_strStaticFile;
  503. // 是否拉伸;
  504. BOOL m_bStretch;
  505. // 是否动态;
  506. BOOL m_bDyn;
  507. // 显示动态图像的条件;
  508. CString m_strDynCondition;
  509. // 是否使用动态图像;
  510. BOOL m_bUseDnyFile;
  511. // GDI+
  512. ImageEx* m_image;
  513. CString m_sOldFilePath;
  514. public:
  515. virtual CDrawObj* Clone(void);
  516. virtual void Draw(CDC* pDC);
  517. virtual bool Fresh( CRect &RECT );
  518. virtual void Serialize(CArchive& ar);
  519. virtual BOOL OnAttrib(CPropertySheet& sheet);
  520. BOOL DisplayBMP(CDC* pDC,int nStartX,int nStartY,int nWidth,int nHeight,CString strBMPFile,BOOL bStretch);
  521. BOOL DisplayJPG(CDC* pDC,int nStartX,int nStartY,int nWidth,int nHeight,CString strJPGFile,BOOL bStretch);
  522. BOOL DisplayPNG(CDC* pDC,int nStartX,int nStartY,int nWidth,int nHeight,CString strPNGFile,BOOL bStretch);
  523. BOOL DisplayGIF(CDC* pDC,int nStartX,int nStartY,int nWidth,int nHeight,CString strGIFFile,BOOL bStretch);
  524. };
  525. //---------------------------------------------- CDrawGif ------
  526. class CDrawGif:public CDrawObj
  527. {
  528. public:
  529. DECLARE_SERIAL(CDrawGif);
  530. CDrawGif();
  531. ~CDrawGif();
  532. // GDI+
  533. ImageEx* m_image;
  534. CString m_strDynFile;
  535. CString m_strStaticFile;
  536. BOOL m_bStretch;
  537. BOOL m_bDyn;
  538. CString m_strDynCondition;
  539. BOOL m_bUseDnyFile;
  540. //CPicture m_Picture;
  541. public:
  542. virtual CDrawObj* Clone(void);
  543. virtual void Draw(CDC* pDC);
  544. virtual bool Fresh( CRect &RECT );
  545. virtual void Serialize(CArchive& ar);
  546. virtual BOOL OnAttrib(CPropertySheet& sheet);
  547. };
  548. //---------------------------------------------- CDrawTransfer ------
  549. class CDrawTransfer:public CDrawObj
  550. {
  551. public:
  552. DECLARE_SERIAL(CDrawTransfer);
  553. CDrawTransfer();
  554. public:
  555. virtual CDrawObj* Clone(void);
  556. virtual void Draw(CDC* pDC);
  557. void DrawCircle(CDC *pDC, POINT origin, int radius);
  558. };
  559. //---------------------------------------------- CDrawData ------
  560. class CDrawDatabox:public CDrawObj
  561. {
  562. public:
  563. DECLARE_SERIAL(CDrawDatabox);
  564. CDrawDatabox();
  565. public:
  566. int m_nFormat;
  567. void DrawText(CDC* pDC,CString& strText);
  568. public:
  569. virtual CDrawObj* Clone(void);
  570. virtual void Draw(CDC* pDC);
  571. virtual void Serialize(CArchive& ar);
  572. virtual BOOL OnAttrib(CPropertySheet& sheet);
  573. virtual bool Fresh( CRect &RECT );
  574. };
  575. //---------------------------------------------- CDrawWatch ------
  576. class CDrawWatch:public CDrawObj
  577. {
  578. public:
  579. DECLARE_SERIAL(CDrawWatch);
  580. CDrawWatch();
  581. int m_nLowwer;
  582. int m_nUpper;
  583. CString m_strVar;
  584. LONG m_lAspectN;
  585. LONG m_lAspectD;
  586. INT HorzRes;
  587. INT VertRes;
  588. protected:
  589. void DrawText(CDC* pDC,CString& strText);
  590. public:
  591. virtual CDrawObj* Clone(void);
  592. virtual void Draw(CDC* pDC);
  593. virtual void Serialize(CArchive& ar);
  594. virtual BOOL OnAttrib(CPropertySheet& sheet);
  595. void DrawFace(CDC* pDC);
  596. };
  597. //---------------------------------------------- CDrawSingleBar ------
  598. class CDrawSingleBar:public CDrawObj
  599. {
  600. public:
  601. DECLARE_SERIAL(CDrawSingleBar);
  602. CDrawSingleBar();
  603. protected:
  604. void DrawText(CDC* pDC,CString& strText);
  605. public:
  606. int m_nLowwer;
  607. int m_nUpper;
  608. float m_fValue;
  609. virtual CDrawObj* Clone(void);
  610. virtual void Draw(CDC* pDC);
  611. virtual BOOL OnAttrib(CPropertySheet& sheet);
  612. };
  613. //---------------------------------------------- CDrawBar ---------
  614. class CDrawBar:public CDrawObj
  615. {
  616. public:
  617. DECLARE_SERIAL(CDrawBar);
  618. CDrawBar();
  619. public:
  620. COLORREF m_clrBar1;
  621. COLORREF m_clrBar2;
  622. COLORREF m_clrBar3;
  623. int m_nLowwer;
  624. int m_nUpper;
  625. CString m_strVar1;
  626. CString m_strVar2;
  627. CString m_strVar3;
  628. int m_nValue1;
  629. int m_nValue2;
  630. int m_nValue3;
  631. public:
  632. int GetBarNum();
  633. virtual bool Fresh( CRect &RECT );
  634. virtual CDrawObj* Clone(void);
  635. virtual void Draw(CDC* pDC);
  636. virtual void Serialize(CArchive& ar);
  637. void DrawBar(CDC* pDC,int data,int x1,int x2,COLORREF clrBar);
  638. virtual BOOL OnAttrib(CPropertySheet& sheet);
  639. };
  640. //---------------------------------------------- CDrawCurve ---------
  641. class CDrawCurve:public CDrawObj
  642. {
  643. public:
  644. DECLARE_SERIAL(CDrawCurve);
  645. CDrawCurve();
  646. public:
  647. COLORREF m_clrCurve1;
  648. COLORREF m_clrCurve2;
  649. COLORREF m_clrCurve3;
  650. int m_nLowwer;
  651. int m_nUpper;
  652. CString m_strVar1;
  653. CString m_strVar2;
  654. CString m_strVar3;
  655. int m_nValue1[60];
  656. int m_nValue2[60];
  657. int m_nValue3[60];
  658. int m_nSecond;
  659. float m_fValue1;
  660. float m_fValue2;
  661. float m_fValue3;
  662. CString m_strVarDes1;
  663. CString m_strVarDes2;
  664. CString m_strVarDes3;
  665. int getMin( int iLowwer );
  666. int getMax( int iUpper );
  667. public:
  668. virtual bool Fresh( CRect &RECT );
  669. virtual CDrawObj* Clone(void);
  670. virtual void Draw(CDC* pDC);
  671. void DrawCurve(CDC* pDC, CRect rect, int* data, COLORREF color);
  672. virtual void Serialize(CArchive& ar);
  673. virtual BOOL OnAttrib(CPropertySheet& sheet);
  674. };
  675. //---------------------------------------------- CDrawHisCurve ---------
  676. class CDrawHisCurve:public CDrawObj
  677. {
  678. public:
  679. DECLARE_SERIAL(CDrawHisCurve);
  680. CDrawHisCurve();
  681. public:
  682. COLORREF m_clrCurve1;
  683. COLORREF m_clrCurve2;
  684. COLORREF m_clrCurve3;
  685. int m_nLowwer;
  686. int m_nUpper;
  687. CString m_strVar1;
  688. CString m_strVar2;
  689. CString m_strVar3;
  690. int m_nValue1[60];
  691. int m_nValue2[60];
  692. int m_nValue3[60];
  693. int m_nSecond;
  694. public:
  695. virtual bool Fresh( CRect &RECT );
  696. virtual CDrawObj* Clone(void);
  697. virtual void Draw(CDC* pDC);
  698. void DrawCurve(CDC* pDC, CRect rect, int* data, COLORREF color);
  699. virtual void Serialize(CArchive& ar);
  700. virtual BOOL OnAttrib(CPropertySheet& sheet);
  701. };
  702. //---------------------------------------------- CDrawOCX --------
  703. class CDrawOCX:public CDrawObj
  704. {
  705. public:
  706. DECLARE_SERIAL(CDrawOCX);
  707. CDrawOCX();
  708. CString m_strOcxPath;
  709. int m_nOcxIndex;
  710. public:
  711. virtual CDrawObj* Clone(void);
  712. virtual void Draw(CDC* pDC);
  713. virtual void DrawText(CDC* pDC);
  714. virtual BOOL OnAttrib(CPropertySheet& sheet);
  715. virtual void Serialize(CArchive& ar);
  716. virtual bool Fresh( CRect &RECT );
  717. };
  718. //---------------------------------------------- CDrawFlash --------
  719. class CDrawFlash:public CDrawObj
  720. {
  721. public:
  722. DECLARE_SERIAL(CDrawFlash);
  723. CDrawFlash();
  724. ~CDrawFlash();
  725. CShockwaveFlash *m_pCtrlFlash;
  726. CString m_strFlashPath;
  727. bool m_bFlashCreate;
  728. public:
  729. virtual CDrawObj* Clone(void);
  730. virtual void Draw(CDC* pDC);
  731. virtual void DrawText(CDC* pDC);
  732. virtual void Serialize(CArchive& ar);
  733. virtual BOOL OnAttrib(CPropertySheet& sheet);
  734. virtual bool Fresh( CRect &RECT );
  735. };
  736. #endif // !defined(AFX_CDRAWOBJ_H__4539C1EB_10FD_40B5_9BBC_22C008CEAF0F__INCLUDED_)