PlugInChartF.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. //---------------------------------------------------------------------------
  2. #ifndef PlugInChartFH
  3. #define PlugInChartFH
  4. //---------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <Classes.hpp>
  7. #include <Controls.hpp>
  8. #include <StdCtrls.hpp>
  9. #include <Forms.hpp>
  10. #include <DB.hpp>
  11. #include <DBClient.hpp>
  12. //---------------------------------------------------------------------------
  13. #include "DataTypesF.h"
  14. #include <Forms.hpp>
  15. #include <ExtCtrls.hpp>
  16. #include <CheckLst.hpp>
  17. #include <Menus.hpp>
  18. #include "DBChart.hpp"
  19. #include "Chart.hpp"
  20. #include "Series.hpp"
  21. #include "TeeShape.hpp"
  22. #include "ArrowCha.hpp"
  23. #include "BubbleCh.hpp"
  24. #include "GanttCh.hpp"
  25. #include "DBChart.hpp"
  26. #include "Series.hpp"
  27. #include "TeEngine.hpp"
  28. #include "TeeProcs.hpp"
  29. #include <ImgList.hpp>
  30. #include "cxButtons.hpp"
  31. #include "cxCheckBox.hpp"
  32. #include "cxContainer.hpp"
  33. #include "cxControls.hpp"
  34. #include "cxDropDownEdit.hpp"
  35. #include "cxEdit.hpp"
  36. #include "cxGraphics.hpp"
  37. #include "cxImageComboBox.hpp"
  38. #include "cxLabel.hpp"
  39. #include "cxLookAndFeelPainters.hpp"
  40. #include "cxLookAndFeels.hpp"
  41. #include "cxMaskEdit.hpp"
  42. #include "cxSplitter.hpp"
  43. #include "cxTextEdit.hpp"
  44. #include "dxSkinBlack.hpp"
  45. #include "dxSkinBlue.hpp"
  46. #include "dxSkinsCore.hpp"
  47. #include "dxSkinMcSkin.hpp"
  48. //---------------------------------------------------------------------------
  49. #pragma warn -8111
  50. /*
  51. *****************************************************************************
  52. * Chart information define
  53. *****************************************************************************
  54. */
  55. typedef enum
  56. {
  57. ctpLine = 0,
  58. ctpBar,
  59. ctpArea,
  60. ctpPoint,
  61. ctpPie,
  62. ctpBubble,
  63. ctpFast_Line,
  64. ctpArrow,
  65. ctpHorizontal_Bar,
  66. ctpHorizontal_Line,
  67. ctpHorizontal_Area,
  68. ctpShape,
  69. ctpGantt,
  70. } SeriesType;
  71. typedef struct
  72. {
  73. SeriesType SrsType;
  74. void *ChartSeries;
  75. } SeriesItem;
  76. /*
  77. *****************************************************************************
  78. * Traffic color information define
  79. *****************************************************************************
  80. */
  81. #define COLOR_SPEED1 (TColor)0x00B0B0FF
  82. #define COLOR_SPEED2 (TColor)0x00B5DAFF
  83. #define COLOR_SPEED3 (TColor)0x00FFE1C4
  84. #define COLOR_SELECTED (TColor)0x00F8ECE4
  85. #define COLOR_FIXEDCOL (TColor)0x00F9F9F9
  86. #define COLOR_CURR_ROW (TColor)0x00F5E6DC
  87. #define COLOR_CURR_COL (TColor)0x00F5E6DC
  88. #define COLOR_TOT (TColor)0x00EEEBDF
  89. #define COLOR_TOT_SUB (TColor)0x00E7F9FE
  90. #define COLOR_AVG (TColor)0x00EEEBDF
  91. //---------------------------------------------------------------------------
  92. class TPlugInChart : public TForm
  93. {
  94. __published: // IDE-managed Components
  95. TPanel *PnlLegendBack;
  96. TPanel *PnlLegend;
  97. TPanel *PnlLegendSet;
  98. TCheckListBox *LstLegend;
  99. TcxButton *BtnChkAll;
  100. TcxButton *BtnReverse;
  101. TcxButton *BtnProperty;
  102. TcxButton *BtnApply;
  103. TPanel *PnlGraphBack;
  104. TPanel *PnlGraphTop;
  105. TcxLabel *cxLabel1;
  106. TcxCheckBox *Chk3D;
  107. TDBChart *DbChart;
  108. TBarSeries *Series1;
  109. TcxCheckBox *ChkDispValue;
  110. TcxSplitter *Splitter;
  111. TcxImageComboBox *CbChartKind;
  112. TcxLabel *LblForm;
  113. TImageList *ImgChartSmall;
  114. TImage *ImgDesc01;
  115. TcxLabel *cxLabel2;
  116. TcxLabel *lblEA;
  117. TcxLabel *lblSel;
  118. TcxLabel *lblSoge;
  119. TPanel *PnlOption;
  120. TImage *ImgDesc02;
  121. TcxLabel *LblOptionName;
  122. TcxComboBox *CbOption;
  123. void __fastcall FormShow(TObject *Sender);
  124. void __fastcall BtnChkAllClick(TObject *Sender);
  125. void __fastcall BtnReverseClick(TObject *Sender);
  126. void __fastcall BtnPropertyClick(TObject *Sender);
  127. void __fastcall Chk3DClick(TObject *Sender);
  128. void __fastcall CbChartKindPropertiesEditValueChanged(TObject *Sender);
  129. void __fastcall LstLegendClickCheck(TObject *Sender);
  130. void __fastcall LstLegendDblClick(TObject *Sender);
  131. void __fastcall LstLegendDrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State);
  132. void __fastcall BtnApplyClick(TObject *Sender);
  133. void __fastcall ChkDispValueClick(TObject *Sender);
  134. void __fastcall DbChartClickSeries(TCustomChart *Sender, TChartSeries *Series, int ValueIndex, TMouseButton Button, TShiftState Shift,
  135. int X, int Y);
  136. void __fastcall DbChartMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
  137. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  138. private: // User declarations
  139. void __fastcall FormInit();
  140. void __fastcall CommClose();
  141. public:
  142. SeriesType __fastcall GetSeriesType(int nIdx);
  143. TColor __fastcall GetSeriesColor(int nIdx);
  144. void __fastcall DrawSeriesType(SeriesType SrsType, TCanvas* pCvs, TRect Rct);
  145. bool __fastcall SetActive(int nIdx);
  146. double __fastcall GetActiveMaxY(void);
  147. void __fastcall ChangeSeriesItem(int nIdx, SeriesType ToSrsType);
  148. void __fastcall ChangeSeries(TDBChart *pDBChart, SeriesType nSeriesTp, int nSeriesCount);
  149. void __fastcall ShowBarChart();
  150. public:
  151. String m_sCaption;
  152. String m_sTitle;
  153. String m_sType;
  154. String m_sTerm;
  155. void __fastcall SetInfo(String sCaption, String sTitle, String sType, String sTerm)
  156. {
  157. m_sCaption = sCaption; m_sTitle = sTitle; m_sType = sType; m_sTerm = sTerm;
  158. }
  159. void __fastcall LoadLocalSkin();
  160. void __fastcall Clear();
  161. void __fastcall ClearData();
  162. void __fastcall ClearChart();
  163. void __fastcall SetChartInfo(String sTitle, String sAxisX, String sAxisY);
  164. void __fastcall BeginDraw(String sTitle, String sAxisX, String sAxisY);
  165. void __fastcall DrawChart1(TcxGridDBTableView *TvList, int nAxisY, int nStColIdx, int nTotColIdx=-1);
  166. void __fastcall DrawChart2(TcxGridDBBandedTableView *TvList, int nAxisY, int nStColIdx,
  167. int nTotColIdx=-1, bool bBarSeries=true, bool bBandText=true, int nEdColIdx=-1);
  168. void __fastcall DrawChart3(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nTotColIdx=-1);
  169. void __fastcall DrawChart4(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nTotColIdx=-1);
  170. void __fastcall DrawChart5(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nAxisY3, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  171. void __fastcall DrawChart5_1(TcxGridTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  172. void __fastcall DrawChart6(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nAxisY3, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  173. void __fastcall EndDraw();
  174. SeriesType __fastcall GetChartType();
  175. TChartSeries* __fastcall AddSeriesItem(String sTitle,
  176. SeriesType SrsType,
  177. TColor clSrsColor,
  178. bool bActive=true);
  179. TChartSeries* __fastcall MakeChartSeries(SeriesType nSeriesTp);
  180. public: // User declarations
  181. __fastcall TPlugInChart(TComponent* Owner);
  182. };
  183. //---------------------------------------------------------------------------
  184. //extern PACKAGE TPlugInChart *PlugInChart;
  185. //---------------------------------------------------------------------------
  186. #endif