mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-17 06:06:00 -06:00
ScatterCtrl: Added trend lines and pie (experimental)
git-svn-id: svn://ultimatepp.org/upp/trunk@6010 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
799256ce41
commit
110f48ff01
11 changed files with 672 additions and 130 deletions
52
uppsrc/ScatterCtrl/PieCtrl.cpp
Normal file
52
uppsrc/ScatterCtrl/PieCtrl.cpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include "PieCtrl.h"
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
PieCtrl::PieCtrl() : copyRatio(1) {
|
||||
Transparent();
|
||||
BackPaint();
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
||||
void PieCtrl::SaveAsMetafile(const char* file)
|
||||
{
|
||||
GuiLock __;
|
||||
WinMetaFileDraw wmfd;
|
||||
wmfd.Create(copyRatio*GetSize().cx, copyRatio*GetSize().cy, "Pie", "PieChart", file);
|
||||
PaintPie(wmfd, copyRatio);
|
||||
wmfd.Close();
|
||||
}
|
||||
|
||||
void PieCtrl::SaveToClipboard(bool saveAsMetafile)
|
||||
{
|
||||
GuiLock __;
|
||||
if (saveAsMetafile) {
|
||||
WinMetaFileDraw wmfd;
|
||||
wmfd.Create(copyRatio*GetSize().cx, copyRatio*GetSize().cy, "ScatterCtrl", "chart");
|
||||
PaintPie(wmfd, copyRatio);
|
||||
WinMetaFile wmf = wmfd.Close();
|
||||
wmf.WriteClipboard();
|
||||
} else {
|
||||
Image img = GetImage(copyRatio);
|
||||
WriteClipboardImage(img);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void PieCtrl::SaveToClipboard(bool)
|
||||
{
|
||||
GuiLock __;
|
||||
Image img = GetImage(copyRatio);
|
||||
WriteClipboardImage(img);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void PieCtrl::Paint(Draw& w)
|
||||
{
|
||||
PaintPie(w, 1);
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
48
uppsrc/ScatterCtrl/PieCtrl.h
Normal file
48
uppsrc/ScatterCtrl/PieCtrl.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifndef _ScatterDraw_PieCtrl_h
|
||||
#define _ScatterDraw_PieCtrl_h
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <ScatterDraw/PieDraw.h>
|
||||
|
||||
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 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;}
|
||||
PieCtrl& SetLegendHeight(const int& height) {PieDraw::SetLegendHeight(height); return *this;};
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -31,6 +31,10 @@ void GeneralTab::Init(ScatterCtrl& scatter)
|
|||
yLabel <<= THISBACK(Change);
|
||||
yLabel2 <<= scatter.GetLabelY2();
|
||||
yLabel2 <<= THISBACK(Change);
|
||||
showLegend <<= scatter.GetShowLegend();
|
||||
showLegend <<= THISBACK(Change);
|
||||
setLegendWidth <<= scatter.GetLegendWidth();
|
||||
setLegendWidth <<= THISBACK(Change);
|
||||
}
|
||||
|
||||
void GeneralTab::Change()
|
||||
|
|
@ -39,6 +43,8 @@ void GeneralTab::Change()
|
|||
|
||||
scatter.SetTitle(title);
|
||||
scatter.SetLabels(xLabel, yLabel, yLabel2);
|
||||
scatter.ShowLegend(showLegend);
|
||||
scatter.SetLegendWidth(setLegendWidth);
|
||||
|
||||
scatter.SetModify();
|
||||
scatter.Refresh();
|
||||
|
|
|
|||
|
|
@ -65,18 +65,11 @@ void ScatterCtrl::Paint(Draw& w)
|
|||
ImageBuffer ib(GetSize());
|
||||
BufferPainter bp(ib, mode);
|
||||
SetDrawing(bp, 1);
|
||||
//bp.Translate(0, 0);
|
||||
w.DrawImage(0, 0, ib);
|
||||
}
|
||||
lastRefresh_ms = t.Elapsed();
|
||||
}
|
||||
|
||||
ScatterCtrl &ScatterCtrl::ShowInfo(bool show)
|
||||
{
|
||||
paintInfo = show;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void ScatterCtrl::ProcessPopUp(const Point & pt)
|
||||
{
|
||||
double _x = (popLT.x - hPlotLeft)*xRange/(GetSize().cx - (hPlotLeft + hPlotRight)-1) + xMin;
|
||||
|
|
@ -349,7 +342,7 @@ void ScatterCtrl::MouseLeave()
|
|||
void ScatterCtrl::MouseZoom(int zdelta, bool hor, bool ver)
|
||||
{
|
||||
double scale = zdelta > 0 ? zdelta/100. : -100./zdelta;
|
||||
if (((lastxRange < xRange*scale) || (lastyRange < yRange*scale)) && (lastRefresh_ms > maxRefresh_ms))
|
||||
if (((lastxRange < xRange*scale) || (lastyRange < yRange*scale)) && (lastRefresh_ms > maxRefresh_ms))
|
||||
return;
|
||||
Zoom(scale, mouseHandlingX, mouseHandlingY);
|
||||
}
|
||||
|
|
@ -383,7 +376,7 @@ void ScatterCtrl::ContextMenu(Bar& bar)
|
|||
bar.Separator();
|
||||
}
|
||||
#ifndef _DEBUG
|
||||
if (showEditDlg)
|
||||
if (showPropDlg)
|
||||
#endif
|
||||
{
|
||||
bar.Add(t_("Properties"), ScatterImg::Gear(), THISBACK(DoShowEditDlg));
|
||||
|
|
@ -436,13 +429,13 @@ ScatterCtrl::ScatterCtrl() : offset(10,12), copyRatio(1)
|
|||
popTextY2 = "y2";
|
||||
popLT = popRB = Null;
|
||||
showContextMenu = false;
|
||||
showEditDlg = false;
|
||||
showPropDlg = false;
|
||||
Color(graphColor);
|
||||
BackPaint();
|
||||
popText.SetColor(SColorFace);
|
||||
SetMouseBehavior(defaultMouse);
|
||||
lastRefresh_ms = Null;
|
||||
maxRefresh_ms = 200;
|
||||
maxRefresh_ms = 500;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
@ -12,55 +12,23 @@ class ArrayCtrlSource : public DataSource {
|
|||
private:
|
||||
ArrayCtrl *data;
|
||||
bool useCols;
|
||||
int idX, idY, idZ;
|
||||
Vector<int> ids;
|
||||
int beginData;
|
||||
ptrdiff_t numData;
|
||||
int64 numData;
|
||||
|
||||
public:
|
||||
ArrayCtrlSource() : data(0), useCols(true), idX(0), idY(1), idZ(2), beginData(0), numData(Null) {};
|
||||
ArrayCtrlSource(ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int _numData = Null) :
|
||||
data(&data), useCols(useCols), idX(idX), idY(idY), idZ(idZ), beginData(beginData), numData(_numData)
|
||||
{
|
||||
if (IsNull(_numData)) {
|
||||
if (!useCols)
|
||||
numData = data.GetColumnCount() - beginData;
|
||||
else
|
||||
numData = data.GetCount() - beginData;
|
||||
}
|
||||
ArrayCtrlSource() : data(0), useCols(true), beginData(0), numData(Null) {ids << 0 << 1;}
|
||||
ArrayCtrlSource(ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int beginData = 0, int numData = Null) :
|
||||
data(&data), useCols(useCols), beginData(beginData), numData(numData) {
|
||||
Init(data, ids, useCols, beginData, numData);
|
||||
}
|
||||
virtual inline double z(int id) {return useCols ? data->Get(beginData + id, idZ) : data->Get(idZ, beginData + id);};
|
||||
virtual inline double y(int id) {return useCols ? data->Get(beginData + id, idY) : data->Get(idY, beginData + id);};
|
||||
virtual inline double x(int id) {
|
||||
if (IsNull(idX))
|
||||
return id;
|
||||
else
|
||||
return useCols ? data->Get(beginData + id, idX) : data->Get(idX, beginData + id);
|
||||
}
|
||||
virtual inline ptrdiff_t GetCount() {return numData;};
|
||||
};
|
||||
|
||||
class GridCtrlSource : public DataSource {
|
||||
private:
|
||||
GridCtrl *data;
|
||||
bool useCols;
|
||||
int idX, idY, idZ;
|
||||
int beginData;
|
||||
ptrdiff_t numData;
|
||||
|
||||
public:
|
||||
GridCtrlSource() : data(0), useCols(true), idX(0), idY(1), idZ(2), beginData(0), numData(Null) {};
|
||||
GridCtrlSource(GridCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int _numData = Null) :
|
||||
data(&data), useCols(useCols), idX(idX), idY(idY), idZ(idZ), beginData(beginData), numData(_numData)
|
||||
{
|
||||
Init(data, useCols, idX, idY, idZ, beginData, _numData);
|
||||
}
|
||||
void Init(GridCtrl &_data, bool _useCols = true, int _idX = 0, int _idY = 1, int _idZ = 2, int _beginData = 0, int _numData = Null)
|
||||
{
|
||||
void Init(ArrayCtrl &_data, Vector<int> &_ids, bool _useCols = true, int _beginData = 0, int _numData = Null) {
|
||||
data = &_data;
|
||||
useCols = _useCols;
|
||||
idX = _idX;
|
||||
idY = _idY;
|
||||
idZ = _idZ;
|
||||
|
||||
ids.SetCount(_ids.GetCount());
|
||||
for (int i = 0; i < ids.GetCount(); ++i)
|
||||
ids[i] = _ids[i];
|
||||
beginData = _beginData;
|
||||
numData = _numData;
|
||||
if (IsNull(_numData)) {
|
||||
|
|
@ -68,17 +36,68 @@ public:
|
|||
numData = data->GetColumnCount() - beginData;
|
||||
else
|
||||
numData = data->GetCount() - beginData;
|
||||
}
|
||||
}
|
||||
void Init(ArrayCtrl &_data, int idY, int idX, bool _useCols = true, int _beginData = 0, int _numData = Null) {
|
||||
Vector<int> ids;
|
||||
ids << idY << idX;
|
||||
Init(_data, ids, _useCols, _beginData, _numData);
|
||||
}
|
||||
virtual inline double y(int64 id) {return useCols ? data->Get(beginData + int(id), ids[0]) : data->Get(ids[0], beginData + int(id));};
|
||||
virtual inline double x(int64 id) {
|
||||
if (IsNull(ids[1]))
|
||||
return double(id);
|
||||
else
|
||||
return useCols ? data->Get(beginData + int(id), ids[1]) : data->Get(ids[1], beginData + int(id));
|
||||
}
|
||||
virtual inline double xn(int n, int64 id) {return useCols ? data->Get(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));}
|
||||
virtual inline int64 GetCount() {return numData;};
|
||||
};
|
||||
|
||||
class GridCtrlSource : public DataSource {
|
||||
private:
|
||||
GridCtrl *data;
|
||||
bool useCols;
|
||||
Vector<int> ids;
|
||||
int beginData;
|
||||
int64 numData;
|
||||
|
||||
public:
|
||||
GridCtrlSource() : data(0), useCols(true), beginData(0), numData(Null) {ids << 0 << 1;}
|
||||
GridCtrlSource(GridCtrl &data, Vector<int> &_ids, bool useCols = true, int beginData = 0, int numData = Null) :
|
||||
data(&data), useCols(useCols), beginData(beginData), numData(numData) {
|
||||
Init(data, ids, useCols, beginData, numData);
|
||||
}
|
||||
void Init(GridCtrl &_data, Vector<int> &_ids, bool _useCols = true, int _beginData = 0, int _numData = Null) {
|
||||
data = &_data;
|
||||
useCols = _useCols;
|
||||
|
||||
ids.SetCount(_ids.GetCount());
|
||||
for (int i = 0; i < ids.GetCount(); ++i)
|
||||
ids[i] = _ids[i];
|
||||
beginData = _beginData;
|
||||
numData = _numData;
|
||||
if (IsNull(_numData)) {
|
||||
if (!useCols)
|
||||
numData = data->GetColumnCount() - beginData;
|
||||
else
|
||||
numData = data->GetRowCount() - beginData;
|
||||
}
|
||||
}
|
||||
virtual inline double z(int id) {return useCols ? data->Get(beginData + id, idZ) : data->Get(idZ, beginData + id);};
|
||||
virtual inline double y(int id) {return useCols ? data->Get(beginData + id, idY) : data->Get(idY, beginData + id);};
|
||||
virtual inline double x(int id) {
|
||||
if (IsNull(idX))
|
||||
return id;
|
||||
void Init(GridCtrl &_data, int idY, int idX, bool _useCols = true, int _beginData = 0, int _numData = Null) {
|
||||
Vector<int> ids;
|
||||
ids << idY << idX;
|
||||
Init(_data, ids, _useCols, _beginData, _numData);
|
||||
}
|
||||
virtual inline double y(int64 id) {return useCols ? data->Get(beginData + int(id), ids[0]) : data->Get(ids[0], beginData + int(id));};
|
||||
virtual inline double x(int64 id) {
|
||||
if (IsNull(ids[1]))
|
||||
return double(id);
|
||||
else
|
||||
return useCols ? data->Get(beginData + id, idX) : data->Get(idX, beginData + id);
|
||||
return useCols ? data->Get(beginData + int(id), ids[1]) : data->Get(ids[1], beginData + int(id));
|
||||
}
|
||||
virtual inline ptrdiff_t GetCount() {return numData;};
|
||||
virtual inline double xn(int n, int64 id) {return useCols ? data->Get(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));}
|
||||
virtual inline int64 GetCount() {return numData;};
|
||||
};
|
||||
|
||||
class ScatterCtrl : public StaticRect, public ScatterDraw {
|
||||
|
|
@ -102,12 +121,11 @@ public:
|
|||
#define MAX_MOUSEBEHAVIOR 20
|
||||
|
||||
bool SetMouseBehavior(MouseBehaviour *_mouseBehavior);
|
||||
ScatterCtrl& ShowLegend(const bool& show = true);
|
||||
ScatterCtrl& ShowContextMenu(const bool& show = true) {showContextMenu = show; return *this;}
|
||||
ScatterCtrl& ShowEditDlg(const bool& show = true) {showEditDlg = show; return *this;}
|
||||
ScatterCtrl& ShowPropertiesDlg(const bool& show = true) {showPropDlg = show; return *this;}
|
||||
void SetPopText(const String x, const String y1, const String y2) {popTextX = x; popTextY = y1; popTextY2 = y2;}
|
||||
ScatterCtrl& SetMouseHandling(bool valx = true, bool valy = false);
|
||||
ScatterCtrl &ShowInfo(bool show = true);
|
||||
ScatterCtrl& ShowInfo(bool show = true) {paintInfo = show; return *this;}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
void SaveAsMetafile(const char* file);
|
||||
|
|
@ -123,6 +141,7 @@ public:
|
|||
ScatterCtrl& SetGridWidth(const int& grid_width) {ScatterDraw::SetGridWidth(grid_width); return *this;};
|
||||
ScatterCtrl& SetPlotAreaColor(const Upp::Color& p_a_color) {ScatterDraw::SetPlotAreaColor(p_a_color); return *this;};
|
||||
ScatterCtrl& SetLegendWidth(const int& width) {ScatterDraw::SetLegendWidth(width); return *this;};
|
||||
int GetLegendWidth() {return ScatterDraw::GetLegendWidth();};
|
||||
ScatterCtrl& SetAxisColor(const Upp::Color& axis_color) {ScatterDraw::SetAxisColor(axis_color); return *this;};
|
||||
ScatterCtrl& SetAxisWidth(const int& axis_width) {ScatterDraw::SetAxisWidth(axis_width); return *this;};
|
||||
ScatterCtrl& SetTitle(const String& title) {ScatterDraw::SetTitle(title); return *this;};
|
||||
|
|
@ -136,10 +155,13 @@ public:
|
|||
ScatterCtrl& SetPlotAreaMargin(const int hLeft, const int hRight, const int vTop, const int vBottom)
|
||||
{ScatterDraw::SetPlotAreaMargin(hLeft, hRight, vTop, vBottom); return *this;};
|
||||
ScatterCtrl& SetPlotAreaLeftMargin(const int margin) {ScatterDraw::SetPlotAreaLeftMargin(margin);return *this;};
|
||||
ScatterCtrl& SetPlotAreaTopMargin(const int margin) {ScatterDraw::SetPlotAreaTopMargin(margin);return *this;};
|
||||
ScatterCtrl& SetPlotAreaTopMargin(const int margin) {ScatterDraw::SetPlotAreaTopMargin(margin); return *this;};
|
||||
ScatterCtrl& SetPlotAreaRightMargin(const int margin) {ScatterDraw::SetPlotAreaRightMargin(margin);return *this;};
|
||||
ScatterCtrl& SetPlotAreaBottomMargin(const int margin) {ScatterDraw::SetPlotAreaBottomMargin(margin);return *this;};
|
||||
|
||||
ScatterCtrl& ShowLegend(const bool& show = true) {ScatterDraw::ShowLegend(show); return *this;}
|
||||
bool GetShowLegend() {return ScatterDraw::GetShowLegend();}
|
||||
|
||||
using ScatterDraw::AddSeries;
|
||||
ScatterCtrl &AddSeries(ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null);
|
||||
using ScatterDraw::InsertSeries;
|
||||
|
|
@ -165,7 +187,7 @@ private:
|
|||
|
||||
bool mouseHandlingX, mouseHandlingY;
|
||||
bool showContextMenu;
|
||||
bool showEditDlg;
|
||||
bool showPropDlg;
|
||||
|
||||
int lastRefresh_ms;
|
||||
int maxRefresh_ms;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ LAYOUT(Properties, 536, 336)
|
|||
ITEM(Button, close, SetLabel(t_("Close")).Tip(t_("Close this dialog")).RightPosZ(4, 68).BottomPosZ(4, 20))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(General, 216, 100)
|
||||
LAYOUT(General, 216, 184)
|
||||
ITEM(Label, dv___0, SetLabel(t_("Label Y2:")).LeftPosZ(4, 56).TopPosZ(76, 21))
|
||||
ITEM(EditString, yLabel2, HSizePosZ(64, 4).TopPosZ(76, 19))
|
||||
ITEM(EditString, yLabel, HSizePosZ(64, 4).TopPosZ(52, 19))
|
||||
|
|
@ -12,6 +12,9 @@ LAYOUT(General, 216, 100)
|
|||
ITEM(Label, dv___5, SetLabel(t_("Label X:")).LeftPosZ(4, 56).TopPosZ(28, 21))
|
||||
ITEM(EditString, xLabel, HSizePosZ(64, 4).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___7, SetLabel(t_("Label Y:")).LeftPosZ(4, 56).TopPosZ(52, 21))
|
||||
ITEM(Option, showLegend, SetLabel(t_("ShowLegend")).LeftPosZ(4, 92).TopPosZ(112, 16))
|
||||
ITEM(Label, dv___9, SetLabel(t_("SetLegendWidth:")).LeftPosZ(4, 92).TopPosZ(132, 21))
|
||||
ITEM(EditInt, setLegendWidth, Min(0).LeftPosZ(96, 44).TopPosZ(132, 19))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(Series, 420, 180)
|
||||
|
|
|
|||
|
|
@ -96,6 +96,18 @@ esES("Sin marca")
|
|||
euES("Marka gabe")
|
||||
frFR("Sans marque")
|
||||
|
||||
T_("Select all")
|
||||
caES("Seleccionar tot")
|
||||
esES("Seleccionar todo")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
||||
T_("Select all rows")
|
||||
caES("")
|
||||
esES("")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
||||
T_("Copy selected rows")
|
||||
caES("Copiar les files seleccionades")
|
||||
esES("Copiar las filas seleccionadas")
|
||||
|
|
@ -165,6 +177,18 @@ esES("Etiqueta Y:")
|
|||
euES("Etiketa Y:")
|
||||
frFR("\303\211tiquette Y:")
|
||||
|
||||
T_("ShowLegend")
|
||||
caES("")
|
||||
esES("")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
||||
T_("SetLegendWidth:")
|
||||
caES("")
|
||||
esES("")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
||||
T_("Rename")
|
||||
caES("Rebatejar")
|
||||
esES("Renombrar")
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ file
|
|||
PopUpText.cpp,
|
||||
PopUpText.h,
|
||||
ScatterCtrl.lay,
|
||||
PieCtrl.cpp,
|
||||
PieCtrl.h,
|
||||
ScatterCtrl.t,
|
||||
ScatterCtrl.usc,
|
||||
src.tpp;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ ctrl ScatterCtrl {
|
|||
int SetGridWidth = 1;
|
||||
bool ShowHGrid = true;
|
||||
bool ShowVGrid = true;
|
||||
bool ShowInfo = true;
|
||||
bool ShowLegend = true;
|
||||
int SetLegendWidth = 80;
|
||||
bool SetFastViewX = false;
|
||||
|
|
@ -70,3 +71,220 @@ ctrl ScatterCtrl {
|
|||
}
|
||||
};
|
||||
|
||||
fn atan_base(z) {
|
||||
return z - z*z*z/3 + z*z*z*z*z/5 - z*z*z*z*z*z*z/7 + z*z*z*z*z*z*z*z*z/9
|
||||
- z*z*z*z*z*z*z*z*z*z*z/11 + z*z*z*z*z*z*z*z*z*z*z*z*z/13;
|
||||
}
|
||||
|
||||
fn atan(z) {
|
||||
if (z*z < 1)
|
||||
return atan_base(z);
|
||||
else if (z > 0)
|
||||
return Pi()/2 - atan_base(1/z);
|
||||
else
|
||||
return 3*Pi()/2 - atan_base(1/z);
|
||||
}
|
||||
|
||||
fn Pi() {
|
||||
return 3.14159265358979323846;
|
||||
}
|
||||
|
||||
fn ToRad(angle) {
|
||||
if (angle > 0)
|
||||
return angle*Pi()/180;
|
||||
else
|
||||
return (360+angle)*Pi()/180;
|
||||
}
|
||||
fn abs(a) {
|
||||
if (a > 0)
|
||||
return a;
|
||||
else
|
||||
return -a;
|
||||
}
|
||||
fn double(n) {
|
||||
n += 1.1;
|
||||
n -= 1.1;
|
||||
return n;
|
||||
}
|
||||
|
||||
fn PaintRect(w, left, top, right, bottom, width, color)
|
||||
{
|
||||
w.DrawLine(left, top, right, top, width, color);
|
||||
w.DrawLine(right, top, right, bottom, width, color);
|
||||
w.DrawLine(right, bottom, left, bottom, width, color);
|
||||
w.DrawLine(left, bottom, left, top, width, color);
|
||||
}
|
||||
|
||||
fn PaintEllipse(w, left, top, right, bottom, width, color)
|
||||
{
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
a = (right-left)/2.;
|
||||
b = (bottom-top)/2.;
|
||||
width_2 = width/2.;
|
||||
delta = Pi()/20.;
|
||||
maxi = 2.*Pi();
|
||||
for (i = 0; i < maxi; i += delta) {
|
||||
if (i == 0) {
|
||||
x0 = left + a + (a - width_2);
|
||||
y0 = top + b;
|
||||
} else {
|
||||
x0 = x1;
|
||||
y0 = y1;
|
||||
}
|
||||
x1 = left + a + (a - width_2) * cos(i + delta);
|
||||
y1 = top + b + (b - width_2) * sin(i + delta);
|
||||
w.DrawLine(x0, y0, x1, y1, width, color);
|
||||
}
|
||||
}
|
||||
|
||||
fn DrawCircle(w, cx, cy, R, width, color) {
|
||||
PaintEllipse(w, cx-R-width/2., cy-R-width/2., cx+R+width/2., cy+R+width/2., width, color);
|
||||
}
|
||||
|
||||
fn PaintArc(w, cx, cy, R, ang0, ang1, direction, width, color)
|
||||
{
|
||||
if (direction == -1) {
|
||||
c = ang0;
|
||||
ang0 = ang1;
|
||||
ang1 = c;
|
||||
}
|
||||
ang0 = ang0*Pi()/180;
|
||||
ang1 = ang1*Pi()/180;
|
||||
delta = 3*Pi()/180;
|
||||
if (ang0 > ang1)
|
||||
ang1 += 2*Pi();
|
||||
for (i = ang0; i < ang1; i += delta) {
|
||||
if (i == ang0) {
|
||||
x0 = cx + R*cos(i);
|
||||
y0 = cy - R*sin(i);
|
||||
} else {
|
||||
x0 = x1;
|
||||
y0 = y1;
|
||||
}
|
||||
x1 = cx + R*cos(i + delta);
|
||||
y1 = cy - R*sin(i + delta);
|
||||
w.DrawLine(x0, y0, x1, y1, width, color);
|
||||
}
|
||||
}
|
||||
|
||||
fn FillEllipse(w, left, top, right, bottom, background)
|
||||
{
|
||||
a = (right-left)/2.;
|
||||
b = (bottom-top)/2.;
|
||||
if (a <= 0.5 || b <= 0.5) {
|
||||
w.DrawLine(left, top, right, bottom, 1, background);
|
||||
return;
|
||||
}
|
||||
delta = Pi()/10.;
|
||||
x0 = left + a;
|
||||
y0 = top + b;
|
||||
|
||||
for (i = delta; i < Pi()/2.; i += delta) {
|
||||
x1 = a * cos(i);
|
||||
y1 = b * sin(i);
|
||||
w.DrawRect(x0-x1 , y0-y1, 2*x1 , 2*y1, background);
|
||||
}
|
||||
width = min(a, b)/4.;
|
||||
if (width > 1)
|
||||
PaintEllipse(w, left, top, right, bottom, width, background);
|
||||
}
|
||||
|
||||
fn FillCircle(w, cx, cy, R, color) {
|
||||
FillEllipse(w, cx-R, cy-R, cx+R, cy+R, color);
|
||||
}
|
||||
|
||||
enum_property titlePosition {
|
||||
"0" : "BOTTOM",
|
||||
"1" : "TOP"
|
||||
};
|
||||
|
||||
ctrl PieCtrl {
|
||||
group "Extra";
|
||||
|
||||
GetMinSize() {sz.cx = 50; sz.cy = 50; return sz; }
|
||||
GetStdSize() {sz.cx = 200; sz.cy = 200; return sz; }
|
||||
|
||||
Frame SetFrame @20;
|
||||
Color SetColor = :White @1;
|
||||
Text SetTitle @5;
|
||||
Font SetTitleFont = StdFont(16)@6;
|
||||
Color SetTitleColor = :Black @7;
|
||||
titlePosition SetTitlePos = 1;
|
||||
int SetTitleGap = 2;
|
||||
bool ShowPercent = true;
|
||||
Color SetPercentBack = Null;
|
||||
bool ShowLegend = true;
|
||||
Font SetLegendFont;
|
||||
Color SetLegendTextColor = :Black;
|
||||
Color SetLegendBackColor = Null;
|
||||
int SetLegendLeft = 10;
|
||||
int SetLegendWidth = 60;
|
||||
int SetLegendTop = Null;
|
||||
int SetLegendHeight = 120;
|
||||
double SetPieAngle = 0;
|
||||
int SetPieMarginLeft = 40;
|
||||
int SetPieMarginTop = 40;
|
||||
int SetPieMarginRight = 40;
|
||||
int SetPieMarginBottom = 40;
|
||||
|
||||
Paint(w) {
|
||||
r = GetRect();
|
||||
w.DrawRect(r, .SetColor);
|
||||
DrawCtrlFrame(w, r, .SetFrame);
|
||||
sz = GetSize();
|
||||
textsize = GetTextSize(.SetTitle, .SetTitleFont);
|
||||
Gap = 0;
|
||||
if(.SetTitleGap > 0)
|
||||
Gap = .SetTitleGap;
|
||||
if(.SetTitlePos == "1")
|
||||
w.DrawText((sz.cx - textsize.cx)/2, Gap, .SetTitle, .SetTitleFont, .SetTitleColor);
|
||||
else
|
||||
w.DrawText((sz.cx - textsize.cx)/2, sz.cy-textsize.cy - Gap, .SetTitle, .SetTitleFont, .SetTitleColor);
|
||||
|
||||
if(.SetTitle == "")
|
||||
textsize.cy = 0;
|
||||
|
||||
lcx = 0;
|
||||
lcy = 0;
|
||||
legendBk = .SetColor;
|
||||
if(.SetLegendBackColor != Null)
|
||||
legendBk = .SetLegendBackColor;
|
||||
if(.SetLegendWidth > 0 && .ShowLegend)
|
||||
lcx = .SetLegendWidth;
|
||||
if(.SetLegendHeight > 0 && .ShowLegend)
|
||||
lcy = .SetLegendHeight;
|
||||
left = - .SetLegendLeft + sz.cx - lcx;
|
||||
if (.SetLegendTop <= :IntNull)
|
||||
top = (sz.cy - Gap - textsize.cy - lcy)/2;
|
||||
else
|
||||
top = .SetLegendTop;
|
||||
if(.ShowLegend) {
|
||||
w.DrawRect(left, top, lcx, lcy, legendBk);
|
||||
PaintRect(w, left, top, left + lcx, top + lcy, 2, :Gray);
|
||||
w.DrawText(left + 2, top + 2, "Legend", .SetLegendFont, .SetLegendTextColor);
|
||||
}
|
||||
|
||||
circWidth = sz.cx - .SetPieMarginLeft - .SetPieMarginRight;
|
||||
if (circWidth < 0)
|
||||
circWidth = 0;
|
||||
circHeight = sz.cy - .SetPieMarginTop - textsize.cy - .SetPieMarginBottom;
|
||||
if (circHeight < 0)
|
||||
circHeight = 0;
|
||||
if (circWidth > circHeight)
|
||||
circ_r = circHeight/2;
|
||||
else
|
||||
circ_r = circWidth/2;
|
||||
circ_x = .SetPieMarginLeft + circWidth/2.;
|
||||
if(.SetTitlePos == "1")
|
||||
circ_y = .SetPieMarginTop + textsize.cy + circHeight/2.;
|
||||
else
|
||||
circ_y = .SetPieMarginTop + circHeight/2.;
|
||||
|
||||
FillCircle(w, circ_x, circ_y, circ_r, Color(150, 255, 150));
|
||||
DrawCircle(w, circ_x, circ_y, circ_r, 2, :SBlack);
|
||||
w.DrawLine(circ_x, circ_y, circ_x + circ_r*cos(-.SetPieAngle + 0.5*Pi()), circ_y - circ_r*sin(-.SetPieAngle + 0.5*Pi()), 2, :SBlack);
|
||||
w.DrawLine(circ_x, circ_y, circ_x + circ_r*cos(-.SetPieAngle - 0.25*Pi()), circ_y - circ_r*sin(-.SetPieAngle - 0.25*Pi()), 2, :SBlack);
|
||||
w.DrawLine(circ_x, circ_y, circ_x + circ_r*cos(-.SetPieAngle + Pi()), circ_y - circ_r*sin(-.SetPieAngle + Pi()), 2, :SBlack);
|
||||
}
|
||||
};
|
||||
71
uppsrc/ScatterCtrl/src.tpp/MouseBehavior$en-us.tpp
Normal file
71
uppsrc/ScatterCtrl/src.tpp/MouseBehavior$en-us.tpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
topic "";
|
||||
[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[0 $$1,0#96390100711032703541132217272105:end]
|
||||
[i448;a25;kKO9;2 $$2,0#37138531426314131252341829483380:class]
|
||||
[b42;2 $$3,3#13035079074754324216151401829390:normal]
|
||||
[i448;a25;kKO9;2 $$4,0#37138531426314131252341829483370:item]
|
||||
[l288;2 $$5,0#27521748481378242620020725143825:desc]
|
||||
[H6;0 $$6,0#05600065144404261032431302351956:begin]
|
||||
[{_}
|
||||
[s1; &]
|
||||
[ {{10000@3 [s0;%% [*@(229)4 ScatterCtrl`::MouseBehavior]]}}&]
|
||||
[s1;%% &]
|
||||
[s2;:ScatterCtrl`:`:MouseBehaviour`:`:struct: [@(0.0.255)3 struct][3 _][*3 MouseBehavior]&]
|
||||
[s3;%% This structure is used to describe the behavior of the mouse
|
||||
when used in ScatterCtrl. It includes the keyboard and mouse
|
||||
conditions that, when complied, will launch the indicated action.&]
|
||||
[s3;%% It is used by SetMouseBehavior(MouseBehaviour `*`_mouseBehavior)
|
||||
function to set an array of MouseBehavior items that will be
|
||||
used to launch actions as zooming or scrolling when mouse is
|
||||
used.&]
|
||||
[s3;%% The default array is in ScatterCtrl`::MouseBehaviour defaultMouse.&]
|
||||
[s1;%% &]
|
||||
[s0; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
|
||||
[s1;%% &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:ctrl: [@(0.0.255) bool]_[* ctrl]&]
|
||||
[s5;%% Set to true if Ctrl has to be pressed.&]
|
||||
[s1;%% &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:alt: [@(0.0.255) bool]_[* alt]&]
|
||||
[s5;%% Set to true if Alt has to be pressed.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:shift: [@(0.0.255) bool]_[* shift]&]
|
||||
[s5;%% Set to true if Shift has to be pressed.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:left: [@(0.0.255) bool]_[* left]&]
|
||||
[s5;%% Set to true if mouse left button has to be pressed.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:middle: [@(0.0.255) bool]_[* middle]&]
|
||||
[s5;%% Set to true if mouse middle button has to be pressed.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:middleWheel: [@(0.0.255) int]_[* middleWheel]&]
|
||||
[s5;%% Set to true if mouse middle wheel has to be rolled.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:right: [@(0.0.255) bool]_[* right]&]
|
||||
[s5;%% Set to true if mouse right button has to be pressed.&]
|
||||
[s1; &]
|
||||
[s6; &]
|
||||
[s4;:ScatterCtrl`:`:MouseBehaviour`:`:action: MouseAction_[* action]&]
|
||||
[s5;%% Is the action to be launched if the previous conditions are
|
||||
complied. It can be:&]
|
||||
[s5;i150;O0;~~~1248;%% NO`_ACTION-|No action. It serves to mark the
|
||||
end of MouseBehavior array.&]
|
||||
[s5;i150;O0;~~~1248;%% SCROLL-|Scrolls the graphs.&]
|
||||
[s5;i150;O0;~~~1248;%% ZOOM`_H`_ENL-|Zooms horizontally enlarging
|
||||
the graphs. &]
|
||||
[s5;i150;O0;~~~1248;%% ZOOM`_H`_RED-|Zooms horizontally reducing the
|
||||
graphs.&]
|
||||
[s5;i150;O0;~~~1248;%% ZOOM`_V`_ENL-|Zooms vertically enlarging the
|
||||
graphs.&]
|
||||
[s5;i150;O0;~~~1248;%% ZOOM`_V`_RED-|Zooms horizontally reducing the
|
||||
graphs.&]
|
||||
[s5;i150;O0;~~~1248;%% SHOW`_INFO-|Shows an info label including mouse
|
||||
real X and Y coordinates.&]
|
||||
[s1;%% &]
|
||||
[s0;%% ]]
|
||||
|
|
@ -1196,74 +1196,177 @@ ool]_[* SetMouseBehavior]([_^ScatterCtrl`:`:MouseBehaviour^ MouseBehaviour]_`*[*
|
|||
eBehavior])&]
|
||||
[s3; Sets [%-*@3 mouseBehavior] as the behavior of the mouse when used
|
||||
in ScatterCtrl.&]
|
||||
[s3; See [^topic`:`/`/ScatterCtrl`/src`/ScatterCtrl`$en`-us`#ScatterCtrl`:`:MouseBehaviour`:`:struct^ S
|
||||
catterCtrl`::MouseBehavior].&]
|
||||
[s3; See [^topic`:`/`/ScatterCtrl`/src`/MouseBehavior`$en`-us^ ScatterCtrl`::MouseBehavi
|
||||
or].&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:ShowContextMenu`(const bool`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* ShowContextMenu]([@(0.0.255) const]_[@(0.0.255) bool`&]_[*@3 show]_`=_[@(0.0.255) true
|
||||
])&]
|
||||
[s3; If [%-*@3 show] is true the context menu can be opened (right
|
||||
clicking by default).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:ShowPropertiesDlg`(const bool`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* ShowPropertiesDlg]([@(0.0.255) const]_[@(0.0.255) bool`&]_[*@3 show]_`=_[@(0.0.255) tr
|
||||
ue])&]
|
||||
[s3; If [%-*@3 show] is true, the context menu will have a `"Properties`"
|
||||
dialog.&]
|
||||
[s3; In DEBUG mode the `"Properties`" menu will always appear.&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:ShowInfo`(bool`):%- [_^ScatterCtrl^ ScatterCtrl]_`&[* ShowInfo]([@(0.0.255) b
|
||||
ool]_[*@3 show]_`=_[@(0.0.255) true])&]
|
||||
[s3; If [%-*@3 show] is true it shows a legend with mouse location
|
||||
when mouse is clicked.&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SaveAsMetafile`(const char`*`):%- [@(0.0.255) void]_[* SaveAsMetafile
|
||||
]([@(0.0.255) const]_[@(0.0.255) char`*]_[*@3 file])&]
|
||||
[s0;%- [*@(28.0.200)1 Windows]&]
|
||||
[s3; Saves the control as a windows metafile in [%-*@3 file].&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SaveToClipboard`(bool`):%- [@(0.0.255) void]_[* SaveToClipboard]([@(0.0.255) b
|
||||
ool]_[*@3 saveAsMetafile]_`=_[@(0.0.255) false])&]
|
||||
[s3; Saves the control to the clipboard as a bitmap.&]
|
||||
[s0;%- [*@(28.0.200)1 Windows]&]
|
||||
[s3; If [%-*@3 saveAsMetafile] is true it saves a windows metafile.&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SaveToFile`(String`):%- [@(0.0.255) void]_[* SaveToFile]([_^String^ Str
|
||||
ing]_[*@3 fileName]_`=_Null)&]
|
||||
[s3; Saves the control to [%-*@3 fileName] as a bitmap depending of
|
||||
file extension.&]
|
||||
[s3; JPEG and PNG are supported&]
|
||||
[s3; If [%-*@3 fileName] is Null a FileSel is opened to ask the user
|
||||
for the name of the file.&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:Refresh`(`):%- [@(0.0.255) virtual] [@(0.0.255) void]_[* Refresh]()&]
|
||||
[s3; Calls to Ctrl`::Refresh().&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:GetSize`(`)const:%- [@(0.0.255) virtual] [_^Size^ Size]_[* GetSize]()_[@(0.0.255) c
|
||||
onst]&]
|
||||
[s3; Returns the control Size.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 color])&]
|
||||
[s3; Calls to ScatterDraw`::SetColor(color).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetGridColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetGridColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 grid`_color
|
||||
])&]
|
||||
[s3; Calls to ScatterDraw`::SetGridColor(grid`_color).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetGridWidth`(const int`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetGridWidth]([@(0.0.255) const]_[@(0.0.255) int`&]_[*@3 grid`_width])&]
|
||||
[s3; Calls to ScatterDraw`::SetGridWidth(grid`_width).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetPlotAreaColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 p`_a`_c
|
||||
olor])&]
|
||||
[s3; Calls to ScatterDraw`::SetPlotAreaColor(p`_a`_color).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLegendWidth`(const int`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLegendWidth]([@(0.0.255) const]_[@(0.0.255) int`&]_[*@3 width])&]
|
||||
[s3; Calls to ScatterDraw`::SetLegendWidth(width).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetAxisColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetAxisColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 axis`_color
|
||||
])&]
|
||||
[s3; Calls to ScatterDraw`::SetAxisColor(axis`_color).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetAxisWidth`(const int`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetAxisWidth]([@(0.0.255) const]_[@(0.0.255) int`&]_[*@3 axis`_width])&]
|
||||
[s3; ScatterDraw`::SetAxisWidth(axis`_width)&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetTitle`(const String`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetTitle]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 title])&]
|
||||
[s3; Calls to ScatterDraw`::SetTitle(title); &]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetTitleFont`(const Font`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetTitleFont]([@(0.0.255) const]_[_^Font^ Font][@(0.0.255) `&]_[*@3 fontTitle])&]
|
||||
[s3; Calls to ScatterDraw`::SetTitleFont(fontTitle).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetTitleColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetTitleColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 colorTitle
|
||||
])&]
|
||||
[s3; Calls to ScatterDraw`::SetTitleColor(colorTitle).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLabelsFont`(const Font`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLabelsFont]([@(0.0.255) const]_[_^Font^ Font][@(0.0.255) `&]_[*@3 fontLabels])&]
|
||||
[s3; Calls to ScatterDraw`::SetLabelsFont(fontLabels).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLabelsColor`(const Color`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLabelsColor]([@(0.0.255) const]_[_^Color^ Upp`::Color][@(0.0.255) `&]_[*@3 colorLabe
|
||||
ls])&]
|
||||
[s3; Calls to ScatterDraw`::SetLabelsColor(colorLabels).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLabelX`(const String`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLabelX]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 xLabel])&]
|
||||
[s3; Calls to ScatterDraw`::SetLabelX(xLabel).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLabelY`(const String`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLabelY]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 yLabel])&]
|
||||
[s3; Calls to ScatterDraw`::SetLabelY(yLabel).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetLabelY2`(const String`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetLabelY2]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 yLabel])&]
|
||||
[s3; Calls to ScatterDraw`::SetLabelY(yLabel).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaMargin`(const int`,const int`,const int`,const int`):%- [_^ScatterCtrl^ S
|
||||
catterCtrl][@(0.0.255) `&]_[* SetPlotAreaMargin]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 h
|
||||
Left], [@(0.0.255) const]_[@(0.0.255) int]_[*@3 hRight], [@(0.0.255) const]_[@(0.0.255) int
|
||||
]_[*@3 vTop], [@(0.0.255) const]_[@(0.0.255) int]_[*@3 vBottom])&]
|
||||
[s3; Calls to ScatterDraw`::SetPlotAreaMargin(hLeft, hRight, vTop,
|
||||
vBottom).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaLeftMargin`(const int`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetPlotAreaLeftMargin]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 margin])&]
|
||||
[s3; Calls ScatterDraw`::SetPlotAreaLeftMargin(margin).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaTopMargin`(const int`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetPlotAreaTopMargin]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 margin])&]
|
||||
[s3; Calls to ScatterDraw`::SetPlotAreaTopMargin(margin).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaRightMargin`(const int`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* SetPlotAreaRightMargin]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 margin])&]
|
||||
[s3; Calls to ScatterDraw`::SetPlotAreaRightMargin(margin).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:SetPlotAreaBottomMargin`(const int`):%- [_^ScatterCtrl^ ScatterCtrl
|
||||
][@(0.0.255) `&]_[* SetPlotAreaBottomMargin]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 margi
|
||||
n])&]
|
||||
[s3; Calls to ScatterDraw`::SetPlotAreaBottomMargin(margin).&]
|
||||
[s1; &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:ShowLegend`(const bool`&`):%- [_^ScatterCtrl^ ScatterCtrl][@(0.0.255) `&
|
||||
]_[* ShowLegend]([@(0.0.255) const]_[@(0.0.255) bool`&]_[*@3 show]_`=_[@(0.0.255) true])&]
|
||||
[s3; If [%-*@3 show] is true it shows a legend with mouse location
|
||||
when mouse is clicked.&]
|
||||
[s1;%- &]
|
||||
[s0;2%- &]
|
||||
[ {{10000@3 [s0; [*@(229)4 ScatterCtrl`::MouseBehavior]]}}&]
|
||||
[s3; Calls to ScatterDraw`::ShowLegend(show).&]
|
||||
[s1; &]
|
||||
[s2;:ScatterCtrl`:`:MouseBehaviour`:`:struct:%- [@(0.0.255)3 struct][3 _][*3 MouseBehavior]&]
|
||||
[s4; This structure is used to describe the behavior of the mouse
|
||||
when used in ScatterCtrl. It includes the keyboard and mouse
|
||||
conditions that, when complied, will launch the indicated action.&]
|
||||
[s4; It is used by SetMouseBehavior(MouseBehaviour `*`_mouseBehavior)
|
||||
function to set an array of MouseBehavior items that will be
|
||||
used to launch actions as zooming or scrolling when mouse is
|
||||
used.&]
|
||||
[s4; The default array is in ScatterCtrl`::MouseBehaviour defaultMouse.&]
|
||||
[s1; &]
|
||||
[s0;%- &]
|
||||
[ {{10000F(128)G(128)@1 [s0; [* Public Member List]]}}&]
|
||||
[s1; &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:ctrl:%- [@(0.0.255) bool]_[* ctrl]&]
|
||||
[s3; Set to true if Ctrl has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:alt:%- [@(0.0.255) bool]_[* alt]&]
|
||||
[s3; Set to true if Alt has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:shift:%- [@(0.0.255) bool]_[* shift]&]
|
||||
[s3; Set to true if Shift has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:left:%- [@(0.0.255) bool]_[* left]&]
|
||||
[s3; Set to true if mouse left button has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:middle:%- [@(0.0.255) bool]_[* middle]&]
|
||||
[s3; Set to true if mouse middle button has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:middleWheel:%- [@(0.0.255) int]_[* middleWheel]&]
|
||||
[s3; Set to true if mouse middle wheel has to be rolled.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:right:%- [@(0.0.255) bool]_[* right]&]
|
||||
[s3; Set to true if mouse right button has to be pressed.&]
|
||||
[s1;%- &]
|
||||
[s6;%- &]
|
||||
[s5;:ScatterCtrl`:`:MouseBehaviour`:`:action:%- MouseAction_[* action]&]
|
||||
[s3; Is the action to be launched if the previous conditions are
|
||||
complied. It can be:&]
|
||||
[s3;i150;O0;~~~1248; NO`_ACTION-|No action. It serves to mark the
|
||||
end of MouseBehavior array.&]
|
||||
[s3;i150;O0;~~~1248; SCROLL-|Scrolls the graphs.&]
|
||||
[s3;i150;O0;~~~1248; ZOOM`_H`_ENL-|Zooms horizontally enlarging the
|
||||
graphs. &]
|
||||
[s3;i150;O0;~~~1248; ZOOM`_H`_RED-|Zooms horizontally reducing the
|
||||
graphs.&]
|
||||
[s3;i150;O0;~~~1248; ZOOM`_V`_ENL-|Zooms vertically enlarging the
|
||||
graphs.&]
|
||||
[s3;i150;O0;~~~1248; ZOOM`_V`_RED-|Zooms horizontally reducing the
|
||||
graphs.&]
|
||||
[s3;i150;O0;~~~1248; SHOW`_INFO-|Shows an info label including mouse
|
||||
real X and Y coordinates.&]
|
||||
[s5;:ScatterCtrl`:`:GetShowLegend`(`):%- [@(0.0.255) bool]_[* GetShowLegend]()&]
|
||||
[s3; Returns ScatterDraw`::GetShowLegend().&]
|
||||
[s1; &]
|
||||
[s1; ]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue