"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "uppsrc/ScatterCtrl/ScatterCtrl.h" between
upp-x11-src-13648.tar.gz and upp-x11-src-13659.tar.gz

About: Ultimate++ is a C++ cross-platform rapid application development framework. Stable release.

ScatterCtrl.h  (upp-x11-src-13648):ScatterCtrl.h  (upp-x11-src-13659)
skipping to change at line 63 skipping to change at line 63
numData = min(_numData, data->GetColumnCount()); numData = min(_numData, data->GetColumnCount());
else else
numData = min(_numData, data->GetCount()); numData = min(_numData, data->GetCount());
} }
numData -= beginData; numData -= beginData;
} }
void Init(ArrayCtrl &_data, int idY, int idX, bool _useCols = true, int _ beginData = 0, int _numData = Null) { void Init(ArrayCtrl &_data, int idY, int idX, bool _useCols = true, int _ beginData = 0, int _numData = Null) {
ids << idY << idX; ids << idY << idX;
Init(_data, ids, _useCols, _beginData, _numData); Init(_data, ids, _useCols, _beginData, _numData);
} }
virtual inline double y(int64 id) {return useCols ? data->Get(begin virtual inline double y(int64 id) {return useCols ? data->Get(begin
Data + int(id), ids[0]) : data->Get(ids[0], beginData + int(id));}; Data + int(id), ids[0]) : data->Get(ids[0], beginData + int(id));};
virtual inline double x(int64 id) { virtual inline double x(int64 id) {
if (IsNull(ids[1])) if (IsNull(ids[1]))
return double(id); return double(id);
else else
return useCols ? data->Get(beginData + int(id), ids[1]) : data->Get(ids[1], beginData + int(id)); 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->G et(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));} virtual inline double xn(int n, int64 id) {return useCols ? data->G et(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));}
virtual inline int64 GetCount() {return numData;}; virtual inline int64 GetCount() const {return numData;};
}; };
class GridCtrlSource : public DataSource { class GridCtrlSource : public DataSource {
private: private:
GridCtrl *data; GridCtrl *data;
bool useCols; bool useCols;
Vector<int> ids; Vector<int> ids;
int beginData; int beginData;
int64 numData; int64 numData;
skipping to change at line 115 skipping to change at line 115
else else
numData = min(_numData, data->GetRowCount()); numData = min(_numData, data->GetRowCount());
} }
numData -= beginData; numData -= beginData;
} }
void Init(GridCtrl &_data, int idY, int idX, bool _useCols = true, int _b eginData = 0, int _numData = Null) { void Init(GridCtrl &_data, int idY, int idX, bool _useCols = true, int _b eginData = 0, int _numData = Null) {
Vector<int> _ids; Vector<int> _ids;
_ids << idY << idX; _ids << idY << idX;
Init(_data, _ids, _useCols, _beginData, _numData); Init(_data, _ids, _useCols, _beginData, _numData);
} }
double GetVal(int64 id, int idx) { double GetVal(int64 id, int idx) const {
if (IsNull(ids[idx])) if (IsNull(ids[idx]))
return double(id); return double(id);
else { else {
int r, c; int r, c;
if (useCols) { if (useCols) {
r = beginData + int(id); r = beginData + int(id);
c = ids[idx]; c = ids[idx];
} else { } else {
r = ids[idx]; r = ids[idx];
c = beginData + int(id); c = beginData + int(id);
} }
const Value &val = data->Get(r, c); const Value &val = data->Get(r, c);
if (val.Is<double>()) if (val.Is<double>())
return double(val); return double(val);
else else
return ScanDouble(val.ToString()); return ScanDouble(val.ToString());
} }
} }
virtual inline double y(int64 id) {return GetVal(id, 0);} virtual inline double y(int64 id) {return GetVal(id, 0);}
virtual inline double x(int64 id) {return GetVal(id, 1);} virtual inline double x(int64 id) {return GetVal(id, 1);}
virtual inline double xn(int n, int64 id) {return useCols ? data->G et(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));} virtual inline double xn(int n, int64 id) {return useCols ? data->G et(beginData + int(id), ids[n]) : data->Get(ids[n], beginData + int(id));}
virtual inline int64 GetCount() {return numData;}; virtual inline int64 GetCount() const {return numData;};
}; };
class ScatterCtrl : public Ctrl, public ScatterDraw { class ScatterCtrl : public Ctrl, public ScatterDraw {
public: public:
typedef ScatterCtrl CLASSNAME; typedef ScatterCtrl CLASSNAME;
ScatterCtrl(); ScatterCtrl();
virtual ~ScatterCtrl() {}; virtual ~ScatterCtrl() {RemoveInstance(this);};
enum ScatterAction {NO_ACTION = 0, SCROLL, ZOOM_H_ENL, ZOOM_H_RED, ZOOM_V enum ScatterAction {NO_ACTION = 0, SCROLL, ZOOM_H_ENL, ZOOM_H_RED, ZOOM_V
_ENL, ZOOM_V_RED, SHOW_COORDINATES, CONTEXT_MENU, ZOOM_WINDOW, _ENL, ZOOM_V_RED,
SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, S SHOW_COORDINATES, CONTEXT_MENU, Z
CROLL_DOWN, ZOOM_FIT}; OOM_WINDOW,
SCROLL_LEFT, SCROLL_RIGHT, SCROLL
_UP, SCROLL_DOWN, ZOOM_FIT};
#define SHOW_INFO SHOW_COORDINATES #define SHOW_INFO SHOW_COORDINATES
struct MouseBehavior { struct MouseBehavior {
MouseBehavior(bool _ctrl, bool _alt, bool _shift, bool _left, boo l _middle, int _middleWheel, bool _right, ScatterAction _action) : MouseBehavior(bool _ctrl, bool _alt, bool _shift, bool _left, boo l _middle, int _middleWheel, bool _right, ScatterAction _action) :
ctrl(_ctrl), alt(_alt), shift(_shift), left(_left), middl e(_middle), middleWheel(_middleWheel), right(_right), action(_action) {} ctrl(_ctrl), alt(_alt), shift(_shift), left(_left), middl e(_middle), middleWheel(_middleWheel), right(_right), action(_action) {}
bool ctrl; bool ctrl;
bool alt; bool alt;
bool shift; bool shift;
bool left; bool left;
bool middle; bool middle;
skipping to change at line 280 skipping to change at line 281
Upp::Color& GetLegendFillColor() {return ScatterDraw::GetLegendFillColor();} Upp::Color& GetLegendFillColor() {return ScatterDraw::GetLegendFillColor();}
Upp::Color& GetLegendBorderColor() {return ScatterDraw::GetLegendBorderColor();} Upp::Color& GetLegendBorderColor() {return ScatterDraw::GetLegendBorderColor();}
using ScatterDraw::AddSeries; 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); ScatterCtrl &AddSeries(ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null);
ScatterCtrl &AddSeries(GridCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null); ScatterCtrl &AddSeries(GridCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null);
using ScatterDraw::InsertSeries; using ScatterDraw::InsertSeries;
void InsertSeries(int id, ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null); void InsertSeries(int id, ArrayCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null);
void InsertSeries(int id, GridCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null); void InsertSeries(int id, GridCtrl &data, bool useCols = true, int idX = 0, int idY = 1, int idZ = 2, int beginData = 0, int numData = Null);
void RemoveAllSeries() {
GuiLock __;
ScatterDraw::RemoveAllSeries();
}
ScatterCtrl& SetMaxRefreshTime(int _maxRefresh_ms) {maxRefresh_ms = _maxRefresh_ms; return *this;} ScatterCtrl& SetMaxRefreshTime(int _maxRefresh_ms) {maxRefresh_ms = _maxRefresh_ms; return *this;}
int GetMaxRefreshTime() {return maxRefresh_ms;} int GetMaxRefreshTime() {return maxRefresh_ms;}
ScatterCtrl& SetDefaultCSVSeparator(String sep) {defaultCSVsepara tor = sep; return *this;} ScatterCtrl& SetDefaultCSVSeparator(String sep) {defaultCSVsepara tor = sep; return *this;}
String GetDefaultCSVSeparator() { return defaultCSVseparator;} String GetDefaultCSVSeparator() { return defaultCSVseparator;}
ScatterCtrl &SetMouseHandling(bool valx = true, bool valy = false) {ScatterDraw::SetMouseHandling(valx, valy); r eturn *this;} ScatterCtrl &SetMouseHandling(bool valx = true, bool valy = false) {ScatterDraw::SetMouseHandling(valx, valy); r eturn *this;}
ScatterCtrl &SetMouseHandlingLinked(bool valx = true, bool valy = false) {ScatterDraw::SetMouseHandlingLinked(valx, valy); return *this;} ScatterCtrl &SetMouseHandlingLinked(bool valx = true, bool valy = false) {ScatterDraw::SetMouseHandlingLinked(valx, valy); return *this;}
ScatterCtrl &SetSaveSize(Size &_size) {saveSize = _size; return *this;} ScatterCtrl &SetSaveSize(Size &_size) {saveSize = _size; return *this;}
skipping to change at line 340 skipping to change at line 346
virtual void MouseMove(Point, dword); virtual void MouseMove(Point, dword);
virtual void MiddleUp(Point, dword); virtual void MiddleUp(Point, dword);
virtual void RightDown(Point, dword); virtual void RightDown(Point, dword);
virtual void RightUp(Point, dword); virtual void RightUp(Point, dword);
virtual void MouseLeave(); virtual void MouseLeave();
virtual void MouseWheel(Point, int zdelta, dword); virtual void MouseWheel(Point, int zdelta, dword);
virtual bool Key(dword key, int count); virtual bool Key(dword key, int count);
virtual void GotFocus(); virtual void GotFocus();
virtual void LostFocus(); virtual void LostFocus();
static int GetInstancesCount() {return instances.GetCoun
t();}
static ScatterCtrl &GetInstance(int i) {return *(instances[i]);}
private: private:
bool showInfo; bool showInfo;
PopUpInfo popTextBegin, popTextVert, popTextHoriz, popTextEnd; PopUpInfo popTextBegin, popTextVert, popTextHoriz, popTextEnd;
String popTextX, popTextY, popTextY2, popTextZ; String popTextX, popTextY, popTextY2, popTextZ;
Point popLT, popRB; Point popLT, popRB;
bool isZoomWindow; bool isZoomWindow;
const Point popOffset; const Point popOffset;
MouseAction mouseAction; MouseAction mouseAction;
int butDownX, butDownY; int butDownX, butDownY;
skipping to change at line 369 skipping to change at line 378
dword lastRefresh0_ms; dword lastRefresh0_ms;
int maxRefresh_ms; int maxRefresh_ms;
bool highlighting; bool highlighting;
Upp::Array<MouseBehavior> mouseBehavior; Upp::Array<MouseBehavior> mouseBehavior;
Upp::Array<KeyBehavior> keyBehavior; Upp::Array<KeyBehavior> keyBehavior;
void Paint0(Draw& w, const Size &sz); void Paint0(Draw& w, const Size &sz);
void ProcessPopUp(const Point &pt); void ProcessPopUp(Point &pt);
//void ProcessClickSeries(const Point &pt);
void DoMouseAction(bool down, Point pt, ScatterAction action, int wheel); void DoMouseAction(bool down, Point pt, ScatterAction action, int wheel);
void DoKeyAction(ScatterAction action); void DoKeyAction(ScatterAction action);
void ProcessMouse(bool down, Point &pt, bool ctrl, bool alt, bool shift, bool left, bool middle, int middleWheel, bool right); void ProcessMouse(bool down, Point &pt, bool ctrl, bool alt, bool shift, bool left, bool middle, int middleWheel, bool right);
bool ProcessKey(int key); bool ProcessKey(int key);
void LabelPopUp(bool down, Point &pt); void LabelPopUp(bool down, Point &pt);
void Scrolling(bool down, Point &pt, bool isOut = false); void Scrolling(bool down, Point &pt, bool isOut = false);
void MouseZoom(int zdelta, bool hor, bool ver); void MouseZoom(int zdelta, bool hor, bool ver);
void ZoomWindow(bool down, Point &pt); void ZoomWindow(bool down, Point &pt);
void ContextMenu(Bar& bar); void ContextMenu(Bar& bar);
void DoShowEditDlg(int itab); void DoShowEditDlg(int itab);
void DoShowData(); void DoShowData();
void DoProcessing(); void DoProcessing();
void Closest(double &x, double &y, double &y2);
virtual Image CursorImage(Point p, dword keyflags); virtual Image CursorImage(Point p, dword keyflags);
template <class T> template <class T>
void SetDrawing(T& w, const Size &sz, bool ctrl = true); void SetDrawing(T& w, const Size &sz, bool ctrl = true);
void TimerCallback(); void TimerCallback();
String defaultCSVseparator; String defaultCSVseparator;
String defaultFileNamePlot; String defaultFileNamePlot;
void OnTypeImage(FileSel *_fs); void OnTypeImage(FileSel *_fs);
skipping to change at line 408 skipping to change at line 418
void OnTypeDataFile(FileSel *_fs); void OnTypeDataFile(FileSel *_fs);
Button processButton, dataButton, propertiesButton; Button processButton, dataButton, propertiesButton;
Size saveSize; Size saveSize;
int jpgQuality; int jpgQuality;
int rotate; int rotate;
Point &MousePointRot(Point &pt); Point &MousePointRot(Point &pt);
Point &MousePointUnrot(Point &pt); Point &MousePointUnrot(Point &pt);
static Vector<ScatterCtrl *> instances;
static void AddInstance(ScatterCtrl *instance) {instances << instance;}
static void RemoveInstance(ScatterCtrl *instance) {
instances.RemoveIf([&](int i) {return instance == instances[i];})
;
}
}; };
template <class T> template <class T>
void ScatterCtrl::SetDrawing(T& w, const Size &sz, bool ctrl) { void ScatterCtrl::SetDrawing(T& w, const Size &sz, bool ctrl) {
ScatterDraw::SetSize(sz); ScatterDraw::SetSize(sz);
ScatterDraw::SetDrawing(w, ctrl); ScatterDraw::SetDrawing(w, ctrl);
if (!IsNull(popLT) && popLT != popRB) { if (!IsNull(popLT) && popLT != popRB) {
if (isZoomWindow) { if (isZoomWindow) {
DrawLine(w, popLT.x, popLT.y, popLT.x, popRB.y, 1, SColor Highlight()); DrawLine(w, popLT.x, popLT.y, popLT.x, popRB.y, 1, SColor Highlight());
DrawLine(w, popRB.x, popLT.y, popRB.x, popRB.y, 1, SColor Highlight()); DrawLine(w, popRB.x, popLT.y, popRB.x, popRB.y, 1, SColor Highlight());
 End of changes. 12 change blocks. 
15 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)