1
/////////////////////////////////////////////////////////////////////////////
7
// Copyright: (C) 2006, Paolo Gava
8
// RCS-ID: $Id: legend.h 4669 2007-11-24 14:54:50Z killerbot $
9
// Licence: wxWindows licence
10
/////////////////////////////////////////////////////////////////////////////
12
#if !defined( __LEGEND_H__ )
15
//----------------------------------------------------------------------------
17
//----------------------------------------------------------------------------
19
// For compilers that support precompilation, includes "wx.h".
20
#include <wx/wxprec.h>
27
#include <wx/dynarray.h>
30
#include "wx/charttypes.h"
32
//----------------------------------------------------------------------------
34
//----------------------------------------------------------------------------
38
#define ROW_SIZE 20 // pixels
40
//----------------------------------------------------------------------------
42
//----------------------------------------------------------------------------
50
DescLegend(wxString lbl, ChartColor col) : m_lbl(lbl), m_col(col) {};
53
// Arrow Up/Down descriptor
54
//-------------------------
55
struct ArrowDescriptor
61
ArrowDescriptor() : m_x(0), m_y(0), m_d(0), m_sel(false) {};
64
//----------------------------------------------------------------------------
65
// Declare Array/List of Legend Descriptor
66
//----------------------------------------------------------------------------
67
WX_DECLARE_OBJARRAY(DescLegend, ListLegendDesc);
69
//+++-S-cd-------------------------------------------------------------------
74
//----------------------------------------------------------------------E-+++
75
class WXDLLIMPEXP_CHART wxLegend
86
void Draw(CHART_HPAINT hp, CHART_HRECT hr);
88
// Redraw arraw whne mouse over
89
//-----------------------------
90
void DrawArrow(CHART_HPAINT hp, int pos, bool over);
98
bool IsInArrowUp(int x, int y);
99
bool IsInArrowDown(int x, int y);
101
// List descriptos utilities
102
//--------------------------
103
void Add(const wxString &lbl, const ChartColor &col);
105
int GetCount() const;
106
ChartColor GetColor(int n) const;
107
wxString GetLabel(int n) const;
110
ListLegendDesc m_lDescs;
112
ArrowDescriptor m_ArrowUp;
113
ArrowDescriptor m_ArrowDown;
117
void DrawArrow(CHART_HPAINT hp, int x, int y, int size,
119
void WriteLabel(CHART_HPAINT hp, int x, int y, int page);
121
// Get number of pages
122
//--------------------
123
int NumPages() const;
127
#endif // __LEGEND_H__