diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index e98dc761b022a0b47212641c537915d43af81deb..8eca506905980c79020a937dad9a45ab2442d0e6 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -48,6 +48,7 @@ set ( QTIPLOT_SRCS src/ApplicationWindow.cpp src/Graph3D.cpp src/Graph.cpp src/Grid.cpp + src/GridDetails.cpp src/ImageDialog.cpp src/ImageExportDialog.cpp src/ImageMarker.cpp @@ -282,6 +283,7 @@ set ( QTIPLOT_HDRS src/ApplicationWindow.h src/Graph3D.h src/Graph.h src/Grid.h + src/GridDetails.h src/ImageDialog.h src/ImageExportDialog.h src/ImageMarker.h @@ -578,6 +580,7 @@ set ( QTIPLOT_MOC_FILES src/ApplicationWindow.h src/Graph3D.h src/Graph.h src/Grid.h + src/GridDetails.h src/ImageDialog.h src/ImageExportDialog.h src/ImportASCIIDialog.h diff --git a/Code/Mantid/MantidPlot/src/GridDetails.cpp b/Code/Mantid/MantidPlot/src/GridDetails.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0fb65e1546fc84059401b9f10e9c945d2ce202ca --- /dev/null +++ b/Code/Mantid/MantidPlot/src/GridDetails.cpp @@ -0,0 +1,62 @@ +//--------------------------- +// Includes +//-------------------------- + +#include "GridDetails.h" +#include "ApplicationWindow.h" +#include <qwt_scale_widget.h> +//#include <qwt_plot.h> +#include "qwt_compat.h" +#include "Plot.h" +#include "plot2D/ScaleEngine.h" + +#include <QWidget> + +GridDetails::GridDetails(ApplicationWindow* app, Graph* graph, QWidget *parent) : QWidget(parent) +{ + d_app = app; + d_graph = graph; + m_initialised = false; + + initWidgets(); +} + +GridDetails::~GridDetails() +{ + +} + +void GridDetails::initWidgets() +{ + if (m_initialised) + { + return; + } + else + { + Plot *p = d_graph->plotWidget(); + + + + m_modified = false; + m_initialised = true; + } +} + +void GridDetails::setModified() +{ + m_modified = true; +} + +bool GridDetails::valid() +{ + return true; +} + +void GridDetails::apply() +{ + if (!(d_app && d_graph && valid()) || !m_modified) + return; + + m_modified = false; +} \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/src/GridDetails.h b/Code/Mantid/MantidPlot/src/GridDetails.h new file mode 100644 index 0000000000000000000000000000000000000000..9b73d18a877d5bd5d77fe317fe0e2ed858a96ae3 --- /dev/null +++ b/Code/Mantid/MantidPlot/src/GridDetails.h @@ -0,0 +1,57 @@ +/** +This class holds the widgets that hold the details for each axis so the contents are only filled once and switching axis only changes a pointer. + +@author Keith Brown, Placement Student at ISIS Rutherford Appleton Laboratory from the University of Derby +@date 24/09/2013 + +Copyright © 2009 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory + +This file is part of Mantid. + +Mantid is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +Mantid is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + +File change history is stored at: <https://github.com/mantidproject/mantid> +Code Documentation is available at: <http://doxygen.mantidproject.org> +*/ + +#ifndef GRIDDETAILS_H_ +#define GRIDDETAILS_H_ + +#include <QWidget> +#include <QList> +class ApplicationWindow; +class Graph; +//The grid tab +class GridDetails: public QWidget +{ + Q_OBJECT +public: + GridDetails(ApplicationWindow* app, Graph* graph, QWidget *parent = 0); // populate and fill in with existing data + virtual ~GridDetails(); + void initWidgets(); + bool modified(){return m_modified;}; + void apply(); + bool valid(); +public slots: + +private slots: + void setModified(); + +private: + bool m_modified, m_initialised; + + ApplicationWindow* d_app; + Graph* d_graph; +}; +#endif /* GRIDDETAILS_H_ */ \ No newline at end of file