DrawObj.h 19 KB

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