Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Legend.h

Go to the documentation of this file.
00001 //LabPlot: Legend.h
00002 
00003 #ifndef LEGEND_H
00004 #define LEGEND_H
00005 
00006 #include <qfont.h>
00007 #include <qpainter.h>
00008 #include "GraphList.h"
00009 #include "Symbol.h"
00010 
00011 class Legend {
00012 public:
00013         Legend();
00014         void save(QTextStream *t);
00015         void open(QTextStream *t, int version);
00016         void setFont(QFont font) { f = font; }
00017         QFont Font() { return f; }
00018         void enable(bool b=true) { e = b; }
00019         bool enabled() { return e; }
00020         void setPosition(double X, double Y) { x = X; y = Y; }
00021         double X() { return x; }
00022         double Y() { return y; }
00023         void enableBorder(bool b=true) { border = b; }
00024         bool borderEnabled() { return border; }
00025         bool getOrientation() { return orientation; }
00026         void setOrientation(bool o) { orientation=o; }
00027         void draw(QPainter *p, PType type, GraphList *graphlist, Point pos, Point size,int w, int h);
00028         bool inside(int X, int Y);
00029         int TicLabelLength() { return ticlabellength; }
00030         void setTicLabelLength(int l) { ticlabellength = l; }
00031 private:
00032         double x,y;                     // position 0..1
00033         int x1, y1, x2, y2;             // legend box
00034         QFont f;                                // legend font
00035         bool border;                    // border enabled
00036         bool e;                         // legend enabled
00037         int namelength;         // legend width
00038         bool orientation;               // 0: BottomTop, 1:LeftRight
00039         int ticlabellength;             // max length of tic label. used for border 
00040 };
00041 
00042 #endif //LEGEND_H

Generated on Fri Aug 19 21:34:44 2005 for LabPlot by doxygen 1.3.6