wxFreeChart
crosshair.h
1 // Name: crosshair.h
3 // Purpose: Crosshair decration
4 // Author: Moskvichev Andrey V.
5 // Created: 14.04.2010
6 // Copyright: (c) 2010 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 
11 #ifndef CROSSHAIR_H_
12 #define CROSSHAIR_H_
13 
14 #include <wx/wxfreechartdefs.h>
15 #include <wx/chartpanel.h>
16 
17 enum {
22  wxCrosshairMoving = 1,
26  wxCrosshairOnClick,
30  wxCrosshairFixed,
31 };
32 
38 class WXDLLIMPEXP_FREECHART Crosshair
39 {
40 public:
41  Crosshair(int style, wxPen *pen = (wxPen *) wxBLACK_PEN);
42  virtual ~Crosshair();
43 
44  void Draw(wxDC &dc, wxRect rcData);
45 
51  void SetHorizontalValueEnabled(int index, bool enabled = true);
52 
53  void SetVerticalValueEnabled(int index, bool enabled = true);
54 
58  void SetPoint(double x, double y);
59 
65  void SetHandleMouseEvents(bool handleMouseEvents);
66 
72  void SetHorizontalAxisBg(int index, AreaDraw *bg);
73 
79  void SetVerticalAxisBg(int index, AreaDraw *bg);
80 
81  //
82  // ChartPanelObserver
83  //
84  virtual void ChartMouseDown(wxPoint &pt, int key);
85  virtual void ChartMouseUp(wxPoint &pt, int key);
86  virtual void ChartMouseMove(wxPoint &pt);
87 
88 private:
89  int m_style;
90  wxPen m_pen;
91 
92  AreaDrawCollection m_horizontalAxesBg;
93  AreaDrawCollection m_verticalAxesBg;
94 };
95 
96 #endif /* CROSSHAIR_H_ */
Collection of areadraws for series.
Definition: areadraw.h:179
Crosshair class.
Definition: crosshair.h:38
Base class for drawing area background.
Definition: areadraw.h:22