QtiPlot 0.9.7.3

LayerDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : LayerDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2004-2010 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : Arrange layers dialog
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef LAYERDIALOG_H
00030 #define LAYERDIALOG_H
00031 
00032 #include <MultiLayer.h>
00033 
00034 #include <QDialog>
00035 
00036 class DoubleSpinBox;
00037 class QGroupBox;
00038 class QPushButton;
00039 class QSpinBox;
00040 class QCheckBox;
00041 class QComboBox;
00042 
00044 class LayerDialog : public QDialog
00045 {
00046     Q_OBJECT
00047 
00048 public:
00049     LayerDialog(QWidget* parent, bool okMode = false, Qt::WFlags fl = 0);
00050     void setMultiLayer(MultiLayer *g);
00051     void setLayers(int layers);
00052     void setLayerCanvasSize(int w, int h, int unit);
00053     void setMargins(int, int, int, int);
00054     void setRows(int);
00055     void setColumns(int);
00056     void setSharedAxes(bool = true);
00057 
00058 protected slots:
00059     void accept();
00060     void update();
00061     void enableLayoutOptions(bool ok);
00062     void swapLayers();
00063     void updateSizes(int unit);
00064     void adjustCanvasHeight(double width);
00065     void adjustCanvasWidth(double height);
00066     void showCommonAxesBox();
00067 
00068 private:
00069     void closeEvent(QCloseEvent*);
00070     int convertToPixels(double w, FrameWidget::Unit unit, int dimension);
00071     double convertFromPixels(int w, FrameWidget::Unit unit, int dimension);
00072 
00073     MultiLayer *multi_layer;
00074 
00075     QPushButton* buttonOk;
00076     QPushButton* buttonCancel;
00077     QPushButton* buttonApply;
00078     QPushButton* buttonSwapLayers;
00079     QGroupBox *GroupCanvasSize, *GroupGrid;
00080     QSpinBox *boxX, *boxY, *boxColsGap, *boxRowsGap;
00081     QSpinBox *boxRightSpace, *boxLeftSpace, *boxTopSpace, *boxBottomSpace;
00082     DoubleSpinBox *boxCanvasWidth, *boxCanvasHeight;
00083     QSpinBox *layersBox;
00084     QSpinBox *boxLayerDest, *boxLayerSrc;
00085     QCheckBox *fitBox;
00086     QComboBox *alignHorBox, *alignVertBox;
00087     QComboBox *unitBox;
00088     QCheckBox *keepRatioBox;
00089     QComboBox *alignPolicyBox;
00090     QCheckBox *commonAxesBox;
00091     QCheckBox *fixedSizeBox;
00092     QCheckBox *linkXAxesBox;
00093 
00094     double aspect_ratio;
00095 };
00096 
00097 #endif