5 //-----------------------------------------------------------------
7 #pragma interface "chart.h"
14 //---------------------------------------------------------------------
15 #include "wx/wxprec.h"
21 //---------------------------------------------------------------------
22 #define MAX_DATASET 10
36 wxDiameterPerimeter = 3,
37 wxMinimumDiameter = 4,
38 wxMaximumDiameter = 5,
39 wxAverageDiameter = 6,
44 //-------------------------------------------------------------------
45 class wxDataSet: public wxObject
51 int m_dataWidth; // Scaled|Fixed
54 int m_displayValues; // def=NONE |IN | OUT
61 // Constructor & Destructor
62 wxDataSet(wxPen *lStype, wxBrush *dStyle,
63 int dWidth, int lWidth, int dGap, int pMark,
65 wxDataSet(wxPen *lStype, wxBrush *dStyle,
66 wxString *lText, bool lDisplay=false);
71 void SetDataStyle(wxBrush* brush) { m_dataStyle = brush;}
72 void SetDataWidth(int width) { m_dataWidth = width;}
73 void SetLineStyle(wxPen* style) { m_lineStyle = style;}
74 void SetPointMark(int mark) { m_pointMark = mark; }
75 void SetText(wxString* string) { m_text = string; }
76 void Show(bool show) { m_display=show; }
79 bool GetShow() { return m_display; }
80 wxBrush* GetDataStyle() { return m_dataStyle; }
81 int GetDataWidth() { return m_dataWidth; }
82 wxPen* GetLineStyle() { return m_lineStyle; }
83 int GetPointMark() { return m_pointMark; }
84 wxString* GetText() { return m_text; }
87 //---------------------------------------------------------------
97 //----------------------------------------------------------------------
98 class wxChart: public wxWindow
104 Table m_table[MAX_DATASET][MAX_ITEM];
105 wxDataSet *m_dataSetArray[MAX_DATASET];
107 double m_MinX, m_MaxX;
108 double m_InfX, m_SupX, m_SupY;
110 double m_StepSizeX, m_StepSizeY, m_StepSizePer;
116 int m_MaxHauteur, m_MaxLargeur;
117 int m_CenterX, m_CenterY;
118 int m_EdgeTop, m_EdgeBottom, m_EdgeLeft, m_EdgeRight;
119 int m_Top,m_Bottom, m_Left, m_Right;
121 int m_EdgeTopLegend, m_EdgeBottomLegend, m_EdgeLeftLegend, m_EdgeRightLegend;
122 int m_TopLegend, m_BottomLegend, m_LeftLegend, m_RightLegend;
124 double m_MinorIncX, m_MajorIncX;
125 double m_MinorIncY, m_MajorIncY;
127 void DrawLine(wxDC &dc, int a);
128 void DrawFond(wxDC& dc);
129 void DrawAxe(wxDC& dc);
130 void DrawAxePer(wxDC& dc);
131 void DrawLegend(wxDC& dc, int nbr);
132 void DrawGrille(wxDC& dc);
134 void SetChartBounds();
135 void SetChartBoundsLegend();
136 void SetCadreLegend(int nbr, int* bottom);
140 double MinCol(double inf);
141 double MaxCol(double sup);
142 void SetInfX(double sup);
143 void SetSupX(double sup);
144 void SetSupY(double sup);
149 // Constructor et Destructor
150 wxChart(wxFrame *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
151 const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE,
152 const wxString& name = wxPanelNameStr);
155 void OnPaint(wxPaintEvent& event);
156 void OnLeftClick(wxDC &dc, double x, double y, int keys);
157 void OnRightClick(wxDC &dc, double x, double y, int keys);
160 bool IsEmpty(int a, int item);
161 double GetDataX(int a, int item);
162 double GetDataY(int a, int item);
163 void SetData(int a, int item, double x, double y);
165 void SetMinX(double MinX);
166 void SetMaxX(double MaxX);
167 void SetMaxWidthHeight(int x,int y);
168 void SetCenterChart(int x, int y);
169 void SetShowPer(bool per);
170 void SetMaxValue(double max);
171 void SetStepSizeX(double sizeX);
172 void SetStepSizeY(double sizeY);
173 void SetStepSizePer(double sizePer);
174 void SetNumDataSet(int NumDataSet);
175 void SetNumItem(int NumItem);
176 void SetIncAxisX(double minor, double major);
177 void SetIncAxisY(double minor, double major);
178 void SetEdgeTop(int top);
179 void SetEdgeBottom(int bottom);
180 void SetEdgeLeft(int left);
181 void SetEdgeRight(int right);
182 void SetEdgeTopLegend(int top);
183 void SetEdgeBottomLegend(int bottom);
184 void SetEdgeLeftLegend(int left);
185 void SetEdgeRightLegend(int right);
186 void ShowDataSet(bool show,int dataset);
188 double GetMinX() { return m_MinX; }
189 double GetMaxX() { return m_MaxX; }
190 int GetMaxValue() { return m_MaxValue; }
191 double GetStepSizeX() { return m_StepSizeX; }
192 double GetStepSizeY() { return m_StepSizeY; }
193 double GetStepSizePer() { return m_StepSizePer;}
194 int GetValueCol() { return m_ValueCol; }
195 int GetNumDataSet() { return m_NumDataSet; }
196 int GetNumItem() { return m_NumItem; }
197 bool GetShowPer() { return m_ShowPer; }
198 int GetLargeur() { return m_MaxLargeur; }
199 int GetHauteur() { return m_MaxHauteur; }
200 int GetEdgeTop() { return m_EdgeTop; }
201 int GetEdgeBottom() { return m_EdgeBottom; }
202 int GetEdgeLeft() { return m_EdgeLeft; }
203 int GetEdgeRight() { return m_EdgeRight; }
204 int GetEdgeTopLegend() { return m_EdgeTopLegend; }
205 int GetEdgeBottomLegend() { return m_EdgeBottomLegend; }
206 int GetEdgeLeftLegend() { return m_EdgeLeftLegend; }
207 int GetEdgeRightLegend() { return m_EdgeRightLegend; }
208 bool GetShowDataSet(int dataset);
210 DECLARE_EVENT_TABLE()