#862 Added scale picker to select axis

This commit is contained in:
Magne Sjaastad
2016-10-14 15:06:21 +02:00
parent 71f1966c1c
commit d5213b2a43
7 changed files with 158 additions and 0 deletions

View File

@@ -19,9 +19,12 @@
#include "RiuSummaryQwtPlot.h"
#include "RiaApplication.h"
#include "RimSummaryCurve.h"
#include "RimSummaryPlot.h"
#include "RiuMainPlotWindow.h"
#include "RiuQwtScalePicker.h"
#include "qwt_date_scale_draw.h"
#include "qwt_date_scale_engine.h"
@@ -69,6 +72,9 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot(RimSummaryPlot* plotDefinition, QWidget* pa
m_zoomerRight = new QwtPlotZoomer(canvas());
m_zoomerRight->setAxis(xTop, yRight);
m_zoomerRight->setTrackerMode(QwtPicker::AlwaysOff);
RiuQwtScalePicker* scalePicker = new RiuQwtScalePicker(this);
connect(scalePicker, SIGNAL(clicked(int, double)), this, SLOT(onAxisClicked(int, double)));
}
//--------------------------------------------------------------------------------------------------
@@ -296,3 +302,13 @@ void RiuSummaryQwtPlot::onZoomedSlot()
m_plotDefinition->updateZoomFromQwt();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::onAxisClicked(int axis, double value)
{
if (!m_plotDefinition) return;
m_plotDefinition->selectAxisInPropertyEditor(axis);
}