ScatterCtrl: Included ZoomToFit. Some fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@9299 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2015-12-18 20:58:44 +00:00
parent a36f4d5b91
commit 9717835e83
2 changed files with 11 additions and 10 deletions

View file

@ -25,12 +25,13 @@ void MeasuresTab::Init(ScatterCtrl& scatter) {
pscatter = &scatter;
xMin <<= scatter.GetXMin();
xMax <<= scatter.GetXRange() + scatter.GetXMin();
yMin <<= scatter.GetYMin();
yMax <<= scatter.GetYRange() + scatter.GetYMin();
yMin2 <<= scatter.GetYMin2();
yMax2 <<= scatter.GetY2Range() + scatter.GetYMin2();
double kkxMin = xMin <<= scatter.GetXMin();
double kkxMax = xMax <<= scatter.GetXRange() + scatter.GetXMin();
double kkyMin = yMin <<= scatter.GetYMin();
double kkyMax = yMax <<= scatter.GetYRange() + scatter.GetYMin();
double kkyMin2 = yMin2 <<= scatter.GetYMin2();
double kkyMax2 = yMax2 <<= scatter.GetY2Range() + scatter.GetYMin2();
butUpdate.WhenAction = THISBACK(Change);
@ -41,7 +42,7 @@ void MeasuresTab::Change() {
ScatterCtrl &scatter = *pscatter;
scatter.SetXYMin(xMin, yMin, yMin2);
scatter.SetMinUnits(xMin, yMin);
//scatter.SetMinUnits(xMin, yMin);
scatter.SetRange(xMax - xMin, yMax - yMin, yMax2 - yMin2);
scatter.SetModify();

View file

@ -378,7 +378,7 @@ bool ScatterCtrl::Key(dword key, int count)
else if (key == K_CTRL_D)
DoShowData();
else if (key == K_CTRL_C)
SaveToClipboard(false);
SaveToClipboard(true);
else if (key == K_CTRL_S)
SaveToFile(Null);
else
@ -536,7 +536,7 @@ ScatterCtrl &ScatterCtrl::SetMouseHandling(bool valx, bool valy)
void ScatterCtrl::ContextMenu(Bar& bar)
{
if (mouseHandlingX || mouseHandlingY) {
bar.Add(t_("Fit to data"), ScatterImg::ShapeHandles(), THISBACK2(FitToData, mouseHandlingY, 0));
bar.Add(t_("Fit to data"), ScatterImg::ShapeHandles(), THISBACK3(ZoomToFit, mouseHandlingX, mouseHandlingY, 0));
bar.Add(t_("Zoom +"), ScatterImg::ZoomPlus(), THISBACK3(Zoom, 1/1.2, true, mouseHandlingY));
bar.Add(t_("Zoom -"), ScatterImg::ZoomMinus(), THISBACK3(Zoom, 1.2, true, mouseHandlingY));
}
@ -560,7 +560,7 @@ void ScatterCtrl::ContextMenu(Bar& bar)
bar.Add(t_("Data"), ScatterImg::Database(), THISBACK(DoShowData)).Key(K_CTRL_D);
bar.Separator();
}
bar.Add(t_("Copy"), ScatterImg::Copy(), THISBACK1(SaveToClipboard, false)).Key(K_CTRL_C);
bar.Add(t_("Copy"), ScatterImg::Copy(), THISBACK1(SaveToClipboard, true)).Key(K_CTRL_C);
bar.Add(t_("Save to file"), ScatterImg::Save(), THISBACK1(SaveToFile, Null)).Key(K_CTRL_S);
}