ultimatepp/uppsrc/ScatterCtrl/PieCtrl.h
koldo 946d57b521 ScatterCtrl: Legend width and height is automatic
git-svn-id: svn://ultimatepp.org/upp/trunk@10660 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2017-01-06 23:02:34 +00:00

46 lines
1.5 KiB
C++

#ifndef _ScatterDraw_PieCtrl_h
#define _ScatterDraw_PieCtrl_h
#include <CtrlLib/CtrlLib.h>
#include <ScatterDraw/PieDraw.h>
using namespace Upp;
class PieCtrl: public StaticRect, public PieDraw {
public:
typedef PieCtrl CLASSNAME;
PieCtrl();
void Paint(Draw& w);
virtual void Refresh() {Ctrl::Refresh();};
virtual Size GetSize() const {return Ctrl::GetSize();};
void SaveAsMetafile(const char* file);
void SaveToClipboard(bool saveAsMetafile);
PieCtrl& SetCopyRatio(int ratio) {copyRatio = ratio; return *this;}
int GetCopyRatio() {return copyRatio;}
private:
int copyRatio;
public:
PieCtrl& SetTitle(const String& title) {PieDraw::SetTitle(title); return *this;}
PieCtrl& ShowPercent(bool show = true) {PieDraw::ShowPercent(show); return *this;}
PieCtrl& SetPercentBack(const Upp::Color& pbcolor) {PieDraw::SetPercentBack(pbcolor); return *this;}
PieCtrl& ShowLegend(bool show = true) {PieDraw::ShowLegend(show); return *this;}
PieCtrl& SetLegendFont(const Upp::Font& font) {PieDraw::SetLegendFont(font); return *this;}
PieCtrl& SetLegendTextColor(const Upp::Color& color){PieDraw::SetLegendTextColor(color); return *this;}
PieCtrl& SetLegendBackColor(const Upp::Color& color){PieDraw::SetLegendBackColor(color); return *this;}
PieCtrl& SetLegendLeft(const int& h) {PieDraw::SetLegendLeft(h); return *this;}
PieCtrl& SetLegendTop(const int& v) {PieDraw::SetLegendTop(v); return *this;}
};
#endif