*ScatterCtrl: Fixes in Properties, added direct buttons

git-svn-id: svn://ultimatepp.org/upp/trunk@10776 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2017-01-27 20:44:52 +00:00
parent b15c4287f2
commit a24b30a914
5 changed files with 56 additions and 7 deletions

View file

@ -637,6 +637,12 @@ void ScatterCtrl::InsertSeries(int id, GridCtrl &data, bool useCols, int idX, in
InsertSeries<GridCtrlSource>(id, data, useCols, idX, idY, beginData, numData);
}
void ScatterCtrl::CheckButtonVisible() {
processButton.Show(showButtons && showProcessDlg);
dataButton.Show(showButtons && showPropDlg);
propertiesButton.Show(showButtons && showPropDlg);
}
ScatterCtrl::ScatterCtrl() : offset(10,12), copyRatio(1), isLeftDown(false)
{
showInfo = mouseHandlingX = mouseHandlingY = isScrolling = isLabelPopUp = isZoomWindow = false;
@ -648,6 +654,7 @@ ScatterCtrl::ScatterCtrl() : offset(10,12), copyRatio(1), isLeftDown(false)
showContextMenu = false;
showPropDlg = false;
showProcessDlg = false;
showButtons = false;
defaultCSVseparator = ";";
Color(graphColor);
BackPaint();
@ -658,6 +665,21 @@ ScatterCtrl::ScatterCtrl() : offset(10,12), copyRatio(1), isLeftDown(false)
highlighting = false;
ShowInfo().ShowContextMenu().ShowPropertiesDlg();
Add(processButton.RightPosZ(0, 15).TopPosZ(0, 15));
processButton.Show(false);
processButton.SetImage(ScatterImg::chart_curve_edit()).Tip(t_("Data processing dialog"));
processButton.WhenAction = THISBACK(DoProcessing);
Add(dataButton.RightPosZ(15, 15).TopPosZ(0, 15));
dataButton.Show(false);
dataButton.SetImage(ScatterImg::Database()).Tip(t_("Raw data table"));
dataButton.WhenAction = THISBACK(DoShowData);
Add(propertiesButton.RightPosZ(30, 15).TopPosZ(0, 15));
propertiesButton.Show(false);
propertiesButton.SetImage(ScatterImg::Gear()).Tip(t_("Plot properties dialog"));
propertiesButton.WhenAction = THISBACK1(DoShowEditDlg, 0);
AddMouseBehavior(false, false, false, true , false, 0, false, ScatterCtrl::SHOW_COORDINATES);
AddMouseBehavior(true, false, false, true , false, 0, false, ScatterCtrl::ZOOM_WINDOW);
AddMouseBehavior(false, false, false, false, false, 0, true , ScatterCtrl::CONTEXT_MENU);

View file

@ -172,9 +172,23 @@ public:
void RemoveKeyBehavior(ScatterAction action);
void ClearKeyBehavior();
ScatterCtrl& ShowContextMenu(bool show = true) {showContextMenu = show; return *this;}
ScatterCtrl& ShowPropertiesDlg(bool show = true) {showPropDlg = show; return *this;}
ScatterCtrl& ShowProcessDlg(bool show = true) {showProcessDlg = show; return *this;}
ScatterCtrl& ShowContextMenu(bool show = true) {showContextMenu = show; return *this;}
ScatterCtrl& ShowPropertiesDlg(bool show = true){
showPropDlg = show;
CheckButtonVisible();
return *this;
}
ScatterCtrl& ShowProcessDlg(bool show = true) {
showProcessDlg = show;
CheckButtonVisible();
return *this;
}
ScatterCtrl& ShowButtons(bool show = true) {
showButtons = show;
CheckButtonVisible();
return *this;
}
void CheckButtonVisible();
ScatterCtrl& SetPopText(const String x, const String y1, const String y2)
{popTextX = x; popTextY = y1; popTextY2 = y2; return *this;}
@ -273,6 +287,7 @@ private:
bool showContextMenu;
bool showPropDlg;
bool showProcessDlg;
bool showButtons;
int lastRefresh_ms;
dword lastRefresh0_ms;
@ -323,6 +338,8 @@ private:
String defaultCSVseparator;
FileSel fileToSave;
Button processButton, dataButton, propertiesButton;
};
template <class T>

View file

@ -128,7 +128,7 @@ LAYOUT(ProcessingTabFit, 580, 400)
ITEM(Option, opMax, SetLabel(t_("Max curve")).RightPosZ(72, 128).TopPosZ(168, 16))
ITEM(Option, opMin, SetLabel(t_("Min curve")).RightPosZ(72, 128).TopPosZ(188, 16))
ITEM(Option, opSpline, SetLabel(t_("Spline")).RightPosZ(72, 128).TopPosZ(124, 16))
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(50).HSizePosZ(0, 208).VSizePosZ(0, 0))
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(50).ShowContextMenu(true).ShowPropertiesDlg(true).ShowProcessDlg(true).ShowButtons(true).HSizePosZ(0, 208).VSizePosZ(0, 0))
ITEM(Label, dv___10, SetLabel(t_("Min:")).RightPosZ(160, 40).TopPosZ(296, 19))
ITEM(Label, dv___11, SetLabel(t_("R2 coeff.")).RightPosZ(0, 48).TopPosZ(4, 19))
ITEM(Label, dv___12, SetLabel(t_("Num decimals:")).RightPosZ(120, 80).TopPosZ(144, 19))
@ -160,7 +160,7 @@ LAYOUT(ProcessingTabFit, 580, 400)
END_LAYOUT
LAYOUT(ProcessingTabFrequency, 524, 276)
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(40).HSizePosZ(0, 100).VSizePosZ(0, 20))
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(40).ShowContextMenu(true).ShowPropertiesDlg(true).ShowProcessDlg(true).ShowButtons(true).HSizePosZ(0, 100).VSizePosZ(0, 20))
ITEM(Label, dv___1, SetLabel(t_("sec")).RightPosZ(4, 28).TopPosZ(20, 19))
ITEM(EditDouble, samplingTime, RightPosZ(36, 56).TopPosZ(20, 19))
ITEM(Button, butFFT, SetLabel(t_("FFT")).RightPosZ(4, 88).TopPosZ(48, 20))
@ -173,7 +173,7 @@ LAYOUT(ProcessingTabFrequency, 524, 276)
END_LAYOUT
LAYOUT(ProcessingTabOp, 544, 328)
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(50).HSizePosZ(0, 116).VSizePosZ(0, 0))
ITEM(ScatterCtrl, scatter, SetPlotAreaLeftMargin(60).SetPlotAreaBottomMargin(50).ShowContextMenu(true).ShowPropertiesDlg(true).ShowProcessDlg(true).ShowButtons(true).HSizePosZ(0, 116).VSizePosZ(0, 0))
ITEM(Label, dv___1, SetLabel(t_("x <")).RightPosZ(76, 24).TopPosZ(44, 19))
ITEM(LabelBox, dv___2, SetLabel(t_("Conditions")).RightPosZ(4, 104).TopPosZ(4, 68))
ITEM(EditDoubleLostFocus, xLower, RightPosZ(8, 68).TopPosZ(44, 19))

View file

@ -143,7 +143,7 @@ frFR("")
T_("Data processing dialog")
caES("")
esES("Dia\303\241logo para procesado de datos")
esES("Di\303\241logo para procesado de datos")
euES("")
frFR("")
@ -867,6 +867,12 @@ esES("Datos estadisticos")
euES("")
frFR("")
T_("RMS:")
caES("")
esES("")
euES("")
frFR("")
T_("sec")
caES("")
esES("seg")

View file

@ -40,6 +40,10 @@ ctrl ScatterCtrl {
bool ShowHGrid = true;
bool ShowVGrid = true;
bool ShowInfo = true;
bool ShowContextMenu = false;
bool ShowPropertiesDlg = false;
bool ShowProcessDlg = false;
bool ShowButtons = false;
bool ShowLegend = true;
LEGEND_POS SetLegendAnchor;
int SetLegendPosX = 5;