Move the sources to trunk
[opencv] / otherlibs / _fltk / include / FL / Fl_Chart.H
1 //
2 // "$Id: Fl_Chart.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // Forms chart header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
24 //
25
26 #ifndef Fl_Chart_H
27 #define Fl_Chart_H
28
29 #ifndef Fl_Widget_H
30 #include "Fl_Widget.H"
31 #endif
32
33 // values for type()
34 #define FL_BAR_CHART            0
35 #define FL_HORBAR_CHART         1
36 #define FL_LINE_CHART           2
37 #define FL_FILL_CHART           3
38 #define FL_SPIKE_CHART          4
39 #define FL_PIE_CHART            5
40 #define FL_SPECIALPIE_CHART     6
41
42 #define FL_FILLED_CHART  FL_FILL_CHART  // compatibility
43
44 #define FL_CHART_MAX            128
45 #define FL_CHART_LABEL_MAX      18
46
47 struct FL_CHART_ENTRY {
48    float val;
49    unsigned col;
50    char str[FL_CHART_LABEL_MAX+1];
51 };
52
53 class FL_EXPORT Fl_Chart : public Fl_Widget {
54     int numb;
55     int maxnumb;
56     int sizenumb;
57     FL_CHART_ENTRY *entries;
58     double min,max;
59     uchar autosize_;
60     uchar textfont_,textsize_;
61     unsigned textcolor_;
62 protected:
63     void draw();
64 public:
65     Fl_Chart(int,int,int,int,const char * = 0);
66     ~Fl_Chart();
67     void clear();
68     void add(double, const char * =0, unsigned=0);
69     void insert(int, double, const char * =0, unsigned=0);
70     void replace(int, double, const char * =0, unsigned=0);
71     void bounds(double *a,double *b) const {*a = min; *b = max;}
72     void bounds(double a,double b);
73     int size() const {return numb;}
74     int maxsize() const {return maxnumb;}
75     void maxsize(int);
76     Fl_Font textfont() const {return (Fl_Font)textfont_;}
77     void textfont(uchar s) {textfont_ = s;}
78     uchar textsize() const {return textsize_;}
79     void textsize(uchar s) {textsize_ = s;}
80     Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
81     void textcolor(unsigned n) {textcolor_ = n;}
82     uchar autosize() const {return autosize_;}
83     void autosize(uchar n) {autosize_ = n;}
84 };
85
86 #endif
87
88 //
89 // End of "$Id: Fl_Chart.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
90 //