~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmithContribItems/wxchart/wxchart-1.0/include/wx/chartpoints.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        chartpoints.h
 
3
// Purpose:     wxChart
 
4
// Author:      Paolo Gava
 
5
// Modified by:
 
6
// Created:
 
7
// Copyright:   (C) 2006, Paolo Gava
 
8
// RCS-ID:      $Id: chartpoints.h 4669 2007-11-24 14:54:50Z killerbot $
 
9
// Licence:     wxWindows licence
 
10
/////////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#if !defined( __CHARTPOINTS_H__ )
 
13
#define __CHARTPOINTS_H__
 
14
 
 
15
//----------------------------------------------------------------------------
 
16
// Headers
 
17
//----------------------------------------------------------------------------
 
18
 
 
19
#include "wx/charttypes.h"
 
20
#include "wx/chartpointstypes.h"
 
21
 
 
22
//+++-S-te-------------------------------------------------------------------
 
23
//  NAME:       wxDISPLAY_LABEL
 
24
//  DESC:       Specify how to display Label on Chart.
 
25
//
 
26
//----------------------------------------------------------------------E-+++
 
27
enum wxDISPLAY_LABEL
 
28
{
 
29
    NONE,   // no label
 
30
    XVALUE, // display x value
 
31
    YVALUE, // display y value
 
32
    NAME    // display custom label
 
33
};
 
34
 
 
35
 
 
36
//+++-S-cd-------------------------------------------------------------------
 
37
//      NAME:           wxChartPoints
 
38
//      DESC:           Generic chart points description
 
39
//      INTERFACE:
 
40
//
 
41
//----------------------------------------------------------------------E-+++
 
42
class WXDLLIMPEXP_CHART wxChartPoints
 
43
{
 
44
 
 
45
public:
 
46
        wxChartPoints(wxChartPointsTypes t) : m_Type(t) {};
 
47
        virtual ~wxChartPoints() {};
 
48
 
 
49
        // Draw the series of points
 
50
        // pure virtual function
 
51
        //--------------------------
 
52
        virtual void Draw(CHART_HPAINT hp, CHART_HRECT hr) = 0;
 
53
 
 
54
        // Get n-th point information
 
55
        // pure virtual functions
 
56
        //---------------------------
 
57
        virtual ChartValue GetXVal(int n) const = 0;
 
58
        virtual ChartValue GetYVal(int n) const = 0;
 
59
    virtual wxString GetName(int n) const = 0;
 
60
        virtual ChartColor GetColor(int n) const = 0;
 
61
 
 
62
        // Get stat values
 
63
        // pure virtual functions
 
64
        //-----------------------
 
65
        virtual int GetCount() const = 0;
 
66
        virtual ChartValue GetMaxX() const = 0;
 
67
        virtual ChartValue GetMaxY() const = 0;
 
68
        virtual ChartValue GetMinX() const = 0;
 
69
        virtual ChartValue GetMinY() const = 0;
 
70
 
 
71
        // Get/Set zoom
 
72
        // pure virtual functions
 
73
        //-----------------------
 
74
        virtual void SetZoom(double z) = 0;
 
75
        virtual double GetZoom() = 0;
 
76
 
 
77
        // Set sizes for drawing
 
78
        // pure virtual functions
 
79
        //-----------------------
 
80
        virtual void SetSizes(ChartSizes sizes) = 0;
 
81
        virtual const ChartSizes& GetSizes() const = 0;
 
82
 
 
83
        // Get/Set Color
 
84
        // pure virtual functions
 
85
        //-----------------------
 
86
        virtual ChartColor GetColor() const = 0;
 
87
        virtual void SetColor(ChartColor c) = 0;
 
88
 
 
89
        // Get/Set Name
 
90
        // pure virtual functions
 
91
        //-----------------------
 
92
    virtual wxString GetName() const = 0;
 
93
    virtual void SetName(wxString name) = 0;
 
94
 
 
95
        // Add point
 
96
        //----------
 
97
    virtual void Add(wxString name, ChartValue x, ChartValue y) = 0;
 
98
    virtual void Add(wxString name, ChartValue x, ChartValue y,
 
99
                                     ChartColor c) = 0;
 
100
 
 
101
        // Set/Get Display option
 
102
        //-----------------------
 
103
        virtual void SetDisplayTag(wxDISPLAY_LABEL d) = 0;
 
104
        virtual wxDISPLAY_LABEL GetDisplayTag() const = 0;
 
105
 
 
106
        // Get type
 
107
        //---------
 
108
        const wxChartPointsTypes GetType() const { return m_Type; }
 
109
 
 
110
private:
 
111
 
 
112
        // chart points type: bar, bar3d, ...
 
113
        //-----------------------------------
 
114
        const wxChartPointsTypes m_Type;
 
115
 
 
116
        // copy ctor & op= NOT allow
 
117
        //--------------------------
 
118
        wxChartPoints(const wxChartPoints&);
 
119
        wxChartPoints& operator=(const wxChartPoints&);
 
120
 
 
121
};
 
122
 
 
123
 
 
124
//+++-S-cf-------------------------------------------------------------------
 
125
//      NAME:           op==()
 
126
//      DESC:
 
127
//      PARAMETERS:     const wxChartPoints& c,
 
128
//                              const wxChartPointsTypes& t
 
129
//      RETURN:         bool
 
130
//----------------------------------------------------------------------E-+++
 
131
inline bool operator==(
 
132
        const wxChartPoints& c,
 
133
        const wxChartPointsTypes& t
 
134
)
 
135
{
 
136
        return ( c.GetType() == t );
 
137
}
 
138
 
 
139
#endif // __CHARTPOINTS_H__
 
140