PlugInChartF.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. //---------------------------------------------------------------------------
  48. #pragma warn -8111
  49. /*
  50. *****************************************************************************
  51. * Chart information define
  52. *****************************************************************************
  53. */
  54. typedef enum
  55. {
  56. ctpLine = 0,
  57. ctpBar,
  58. ctpArea,
  59. ctpPoint,
  60. ctpPie,
  61. ctpBubble,
  62. ctpFast_Line,
  63. ctpArrow,
  64. ctpHorizontal_Bar,
  65. ctpHorizontal_Line,
  66. ctpHorizontal_Area,
  67. ctpShape,
  68. ctpGantt,
  69. } SeriesType;
  70. typedef struct
  71. {
  72. SeriesType SrsType;
  73. void *ChartSeries;
  74. } SeriesItem;
  75. /*
  76. *****************************************************************************
  77. * Traffic color information define
  78. *****************************************************************************
  79. */
  80. #define COLOR_SPEED1 (TColor)0x00B0B0FF
  81. #define COLOR_SPEED2 (TColor)0x00B5DAFF
  82. #define COLOR_SPEED3 (TColor)0x00FFE1C4
  83. #define COLOR_SELECTED (TColor)0x00F8ECE4
  84. #define COLOR_FIXEDCOL (TColor)0x00F9F9F9
  85. #define COLOR_CURR_ROW (TColor)0x00F5E6DC
  86. #define COLOR_CURR_COL (TColor)0x00F5E6DC
  87. #define COLOR_TOT (TColor)0x00EEEBDF
  88. #define COLOR_TOT_SUB (TColor)0x00E7F9FE
  89. #define COLOR_AVG (TColor)0x00EEEBDF
  90. //---------------------------------------------------------------------------
  91. class TPlugInChart : public TForm
  92. {
  93. __published: // IDE-managed Components
  94. TPanel *PnlLegendBack;
  95. TPanel *PnlLegend;
  96. TPanel *PnlLegendSet;
  97. TCheckListBox *LstLegend;
  98. TcxButton *BtnChkAll;
  99. TcxButton *BtnReverse;
  100. TcxButton *BtnProperty;
  101. TcxButton *BtnApply;
  102. TPanel *PnlGraphBack;
  103. TPanel *PnlGraphTop;
  104. TcxLabel *cxLabel1;
  105. TcxCheckBox *Chk3D;
  106. TDBChart *DbChart;
  107. TBarSeries *Series1;
  108. TcxCheckBox *ChkDispValue;
  109. TcxSplitter *Splitter;
  110. TcxImageComboBox *CbChartKind;
  111. TcxLabel *LblForm;
  112. TImageList *ImgChartSmall;
  113. TImage *ImgDesc01;
  114. TcxLabel *cxLabel2;
  115. TcxLabel *lblEA;
  116. TcxLabel *lblSel;
  117. TcxLabel *lblSoge;
  118. TPanel *PnlOption;
  119. TImage *ImgDesc02;
  120. TcxLabel *LblOptionName;
  121. TcxComboBox *CbOption;
  122. void __fastcall FormShow(TObject *Sender);
  123. void __fastcall BtnChkAllClick(TObject *Sender);
  124. void __fastcall BtnReverseClick(TObject *Sender);
  125. void __fastcall BtnPropertyClick(TObject *Sender);
  126. void __fastcall Chk3DClick(TObject *Sender);
  127. void __fastcall CbChartKindPropertiesEditValueChanged(TObject *Sender);
  128. void __fastcall LstLegendClickCheck(TObject *Sender);
  129. void __fastcall LstLegendDblClick(TObject *Sender);
  130. void __fastcall LstLegendDrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State);
  131. void __fastcall BtnApplyClick(TObject *Sender);
  132. void __fastcall ChkDispValueClick(TObject *Sender);
  133. void __fastcall DbChartClickSeries(TCustomChart *Sender, TChartSeries *Series, int ValueIndex, TMouseButton Button, TShiftState Shift,
  134. int X, int Y);
  135. void __fastcall DbChartMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
  136. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  137. private: // User declarations
  138. void __fastcall FormInit();
  139. void __fastcall CommClose();
  140. public:
  141. SeriesType __fastcall GetSeriesType(int nIdx);
  142. TColor __fastcall GetSeriesColor(int nIdx);
  143. void __fastcall DrawSeriesType(SeriesType SrsType, TCanvas* pCvs, TRect Rct);
  144. bool __fastcall SetActive(int nIdx);
  145. double __fastcall GetActiveMaxY(void);
  146. void __fastcall ChangeSeriesItem(int nIdx, SeriesType ToSrsType);
  147. void __fastcall ChangeSeries(TDBChart *pDBChart, SeriesType nSeriesTp, int nSeriesCount);
  148. void __fastcall ShowBarChart();
  149. public:
  150. String m_sCaption;
  151. String m_sTitle;
  152. String m_sType;
  153. String m_sTerm;
  154. void __fastcall SetInfo(String sCaption, String sTitle, String sType, String sTerm)
  155. {
  156. m_sCaption = sCaption; m_sTitle = sTitle; m_sType = sType; m_sTerm = sTerm;
  157. }
  158. void __fastcall LoadLocalSkin();
  159. void __fastcall Clear();
  160. void __fastcall ClearData();
  161. void __fastcall ClearChart();
  162. void __fastcall SetChartInfo(String sTitle, String sAxisX, String sAxisY);
  163. void __fastcall BeginDraw(String sTitle, String sAxisX, String sAxisY);
  164. void __fastcall DrawChart1(TcxGridDBTableView *TvList, int nAxisY, int nStColIdx, int nTotColIdx=-1);
  165. void __fastcall DrawChart2(TcxGridDBBandedTableView *TvList, int nAxisY, int nStColIdx,
  166. int nTotColIdx=-1, bool bBarSeries=true, bool bBandText=true, int nEdColIdx=-1);
  167. void __fastcall DrawChart3(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nTotColIdx=-1);
  168. void __fastcall DrawChart4(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nTotColIdx=-1);
  169. void __fastcall DrawChart5(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nAxisY3, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  170. void __fastcall DrawChart5_1(TcxGridTableView *TvList, int nAxisY1, int nAxisY2, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  171. void __fastcall DrawChart6(TcxGridDBTableView *TvList, int nAxisY1, int nAxisY2, int nAxisY3, int nStColIdx, int nEdColIdx=-1,int nTotColIdx=-1);
  172. void __fastcall EndDraw();
  173. SeriesType __fastcall GetChartType();
  174. TChartSeries* __fastcall AddSeriesItem(String sTitle,
  175. SeriesType SrsType,
  176. TColor clSrsColor,
  177. bool bActive=true);
  178. TChartSeries* __fastcall MakeChartSeries(SeriesType nSeriesTp);
  179. public: // User declarations
  180. __fastcall TPlugInChart(TComponent* Owner);
  181. };
  182. //---------------------------------------------------------------------------
  183. //extern PACKAGE TPlugInChart *PlugInChart;
  184. //---------------------------------------------------------------------------
  185. #endif