HyperspaceExplorer 0.7.1
ValuesDialog.h
00001 /*
00002 Hyperspace Explorer - visualizing higher-dimensional geometry
00003 Copyright (C) 2010  Lene Preuss <lene.preuss@gmail.com>
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License along
00016 with this program; if not, write to the Free Software Foundation, Inc.,
00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 */
00020 
00021 /********************************************************************************
00022 ** Form originally  generated from reading ui file 'ValuesDialog.ui'
00023 **
00024 ** Created: Fri Apr 25 15:22:18 2008
00025 **      by: Qt User Interface Compiler version 4.3.4
00026 **
00027 ********************************************************************************/
00028 
00029 #ifndef UI_VALUESDIALOG_H
00030 #define UI_VALUESDIALOG_H
00031 
00032 #include <Qt3Support/Q3MimeSourceFactory>
00033 #include <QtCore/QVariant>
00034 #include <QtGui/QAction>
00035 #include <QtGui/QApplication>
00036 #include <QtGui/QButtonGroup>
00037 #include <QtGui/QComboBox>
00038 #include <QtGui/QDialog>
00039 #include <QtGui/QGridLayout>
00040 #include <QtGui/QHBoxLayout>
00041 #include <QtGui/QLabel>
00042 #include <QtGui/QLineEdit>
00043 #include <QtGui/QPushButton>
00044 #include <QtGui/QSlider>
00045 #include <QtGui/QVBoxLayout>
00046 
00047 #include "UI/ParameterInput.h"
00048 
00049 namespace UI {
00050 
00052     namespace Dialogs {
00054 
00059         class ValuesDialog {
00060             protected:
00062                 static const unsigned maxNumDimensions = 3;
00064                 static const unsigned maxNumParameters = 4;
00066                 static const unsigned parametersPerLine = 2;
00067 
00069                 void setupUi(QDialog *ValuesDialog) {
00070                     QFont font;
00071 
00072                     //  global initializations, layout and header
00073                     {
00074                         if (ValuesDialog->objectName().isEmpty())
00075                             ValuesDialog->setObjectName(
00076                                     QString::fromUtf8("ValuesDialog"));
00077                         ValuesDialog->resize(343, 410);
00078                         QSizePolicy sizePolicy(QSizePolicy::Minimum,
00079                                             QSizePolicy::Minimum);
00080                         sizePolicy.setHorizontalStretch(0);
00081                         sizePolicy.setVerticalStretch(0);
00082                         sizePolicy.setHeightForWidth(
00083                                 ValuesDialog->sizePolicy().hasHeightForWidth());
00084                         ValuesDialog->setSizePolicy(sizePolicy);
00085                         ValuesDialog->setSizeGripEnabled(false);
00086                         gridLayout = new QGridLayout(ValuesDialog);
00087                         gridLayout->setSpacing(6);
00088                         gridLayout->setMargin(11);
00089                         gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
00090                         AllBoundsLayout = new QVBoxLayout();
00091                         AllBoundsLayout->setSpacing(6);
00092                         AllBoundsLayout->setObjectName(
00093                                 QString::fromUtf8("AllBoundsLayout"));
00094                         gridLabel = new QLabel(ValuesDialog);
00095                         gridLabel->setObjectName(QString::fromUtf8("gridLabel"));
00096                         font.setBold(true);
00097                         font.setWeight(75);
00098                         gridLabel->setFont(font);
00099                         gridLabel->setAlignment(Qt::AlignCenter);
00100 
00101                         AllBoundsLayout->addWidget(gridLabel);
00102                     }
00103                     //  defining the grid resolution and bounds
00104                     for (unsigned i = 0; i < maxNumDimensions; i++) {
00105                         SliderLayout[i] = new QHBoxLayout();
00106                         SliderLayout[i]->setSpacing(6);
00107                         SliderLayout[i]->setObjectName(
00108                                 QString::fromUtf8("SliderLayout[i]"));
00109                         SliderLayout[i]->setContentsMargins(0, 0, 0, 0);
00110                         Label[i] = new QLabel(ValuesDialog);
00111                         Label[i]->setObjectName(QString::fromUtf8("Label[i]"));
00112 
00113                         SliderLayout[i]->addWidget(Label[i]);
00114 
00115                         Slider[i] = new QSlider(ValuesDialog);
00116                         Slider[i]->setObjectName(QString::fromUtf8("Slider[i]"));
00117                         Slider[i]->setMinimum(1);
00118                         Slider[i]->setMaximum(50);
00119                         Slider[i]->setPageStep(5);
00120                         Slider[i]->setValue(5);
00121                         Slider[i]->setOrientation(Qt::Horizontal);
00122                         Slider[i]->setTickInterval(5);
00123 
00124                         SliderLayout[i]->addWidget(Slider[i]);
00125 
00126                         Steps[i] = new QLabel(ValuesDialog);
00127                         Steps[i]->setObjectName(QString::fromUtf8("Steps[i]"));
00128 
00129                         SliderLayout[i]->addWidget(Steps[i]);
00130 
00131                         AllBoundsLayout->addLayout(SliderLayout[i]);
00132 
00133                         BoundsLayout[i] = new QHBoxLayout();
00134                         BoundsLayout[i]->setSpacing(6);
00135                         BoundsLayout[i]->setObjectName(
00136                                 QString::fromUtf8("BoundsLayout[i]"));
00137                         BoundsLayout[i]->setContentsMargins(0, 0, 0, 0);
00138                         MinLayout[i] = new QHBoxLayout();
00139                         MinLayout[i]->setSpacing(6);
00140                         MinLayout[i]->setObjectName(QString::fromUtf8("MinLayout[i]"));
00141                         MinLayout[i]->setContentsMargins(0, 0, 0, 0);
00142                         MinLabel[i] = new QLabel(ValuesDialog);
00143                         MinLabel[i]->setObjectName(QString::fromUtf8("MinLabel[i]"));
00144 
00145                         MinLayout[i]->addWidget(MinLabel[i]);
00146 
00147                         Min[i] = new QLineEdit(ValuesDialog);
00148                         Min[i]->setObjectName(QString::fromUtf8("Min[i]"));
00149 
00150                         MinLayout[i]->addWidget(Min[i]);
00151 
00152                         BoundsLayout[i]->addLayout(MinLayout[i]);
00153 
00154                         MaxLayout[i] = new QHBoxLayout();
00155                         MaxLayout[i]->setSpacing(6);
00156                         MaxLayout[i]->setObjectName(QString::fromUtf8("MaxLayout[i]"));
00157                         MaxLayout[i]->setContentsMargins(0, 0, 0, 0);
00158                         MaxLabel[i] = new QLabel(ValuesDialog);
00159                         MaxLabel[i]->setObjectName(QString::fromUtf8("MaxLabel[i]"));
00160 
00161                         MaxLayout[i]->addWidget(MaxLabel[i]);
00162 
00163                         Max[i] = new QLineEdit(ValuesDialog);
00164                         Max[i]->setObjectName(QString::fromUtf8("Max[i]"));
00165 
00166                         MaxLayout[i]->addWidget(Max[i]);
00167 
00168                         BoundsLayout[i]->addLayout(MaxLayout[i]);
00169 
00170                         AllBoundsLayout->addLayout(BoundsLayout[i]);
00171                     }
00172 
00173                     gridLayout->addLayout(AllBoundsLayout, 0, 0, 1, 1);
00174 
00175                     //  function parameters - heading and layout
00176                     {
00177                         functionLabel = new QLabel(ValuesDialog);
00178                         functionLabel->setObjectName(QString::fromUtf8("functionLabel"));
00179                         functionLabel->setFont(font);
00180                         functionLabel->setAlignment(Qt::AlignCenter);
00181 
00182                         gridLayout->addWidget(functionLabel, 2, 0, 1, 1);
00183 
00184                         AllParametersLayout = new QVBoxLayout();
00185                         AllParametersLayout->setSpacing(6);
00186                         AllParametersLayout->setObjectName(
00187                                 QString::fromUtf8("AllParametersLayout"));
00188                         AllParametersLayout->setContentsMargins(0, 0, 0, 0);
00189                     }
00190 
00191                     //  function parameters - input fields
00192                     for (unsigned j = 0; j < maxNumParameters/parametersPerLine; j++) {
00193                         ParameterLineLayout[j] = new QHBoxLayout();
00194                         ParameterLineLayout[j]->setSpacing(6);
00195                         ParameterLineLayout[j]->setObjectName(
00196                                 QString::fromUtf8("ParameterLineLayout[j]"));
00197                         ParameterLineLayout[j]->setContentsMargins(0, 0, 0, 0);
00198                         for (unsigned i = parametersPerLine*j;
00199                             i < parametersPerLine*j+parametersPerLine; i++) {
00200                             ParameterLayout[i] = new QHBoxLayout();
00201                             ParameterLayout[i]->setSpacing(6);
00202                             ParameterLayout[i]->setObjectName(
00203                                     QString::fromUtf8("ParameterLayout[i]"));
00204                             ParameterLayout[i]->setContentsMargins(0, 0, 0, 0);
00205                             ParameterLabel[i] = new QLabel(ValuesDialog);
00206                             ParameterLabel[i]->setObjectName(
00207                                     QString::fromUtf8("ParameterLabel[i]"));
00208 
00209                             ParameterLayout[i]->addWidget(ParameterLabel[i]);
00210 
00211                             Parameter[i] = new ParameterLineEdit(ValuesDialog);
00212                             dynamic_cast<QWidget *>(Parameter[i])->setObjectName(
00213                                     QString::fromUtf8("Parameter[i]"));
00214 
00215                             ParameterLayout[i]->addWidget(
00216                                     dynamic_cast<QWidget *>(Parameter[i]));
00217 
00218                             ParameterLineLayout[j]->addLayout(ParameterLayout[i]);
00219                         }
00220 
00221 
00222                         AllParametersLayout->addLayout(ParameterLineLayout[j]);
00223                     }
00224 
00225                     gridLayout->addLayout(AllParametersLayout, 4, 0, 1, 1);
00226 
00227                     //  "Apply" button
00228                     {
00229                         ButtonLayout = new QHBoxLayout();
00230                         ButtonLayout->setSpacing(6);
00231                         ButtonLayout->setObjectName(QString::fromUtf8("ButtonLayout"));
00232                         ButtonLayout->setContentsMargins(0, 0, 0, 0);
00233                         buttonApply = new QPushButton(ValuesDialog);
00234                         buttonApply->setObjectName(QString::fromUtf8("buttonApply"));
00235                         buttonApply->setAutoDefault(true);
00236 
00237                         ButtonLayout->addWidget(buttonApply);
00238                         gridLayout->addLayout(ButtonLayout, 5, 0, 1, 1);
00239                     }
00240 
00241                     //  tab order
00242                     for (unsigned i = 0; i < maxNumDimensions; ++i) {
00243                         QWidget::setTabOrder(Slider[i], Min[i]);
00244                         QWidget::setTabOrder(Min[i], Max[i]);
00245                         if (i < maxNumDimensions-1)
00246                             QWidget::setTabOrder(Max[i], Slider[i+1]);
00247                     }
00248                     QWidget::setTabOrder(Max[maxNumDimensions-1],
00249                                          dynamic_cast<QWidget *>(Parameter[0]));
00250                     for (unsigned i = 0; i < maxNumParameters-1; ++i) {
00251                         QWidget::setTabOrder(dynamic_cast<QWidget *>(Parameter[i]),
00252                                              dynamic_cast<QWidget *>(Parameter[i+1]));
00253                     }
00254                     QWidget::setTabOrder(
00255                             dynamic_cast<QWidget *>(Parameter[maxNumParameters-1]),
00256                             buttonApply);
00257 
00258                     retranslateUi(ValuesDialog);
00259 
00260                     //  signal/slot connections
00261                     for (unsigned i = 0; i < maxNumDimensions; ++i) {
00262                         QObject::connect(Slider[i], SIGNAL(valueChanged(int)),
00263                                         Steps[i], SLOT(setNum(int)));
00264                         for (unsigned j = i+1; j < maxNumDimensions; ++j) {
00265                             QObject::connect(Slider[i], SIGNAL(valueChanged(int)),
00266                                             Slider[j], SLOT(setValue(int)));
00267                         }
00268                     }
00269                     QObject::connect(buttonApply, SIGNAL(clicked()),
00270                                     ValuesDialog, SLOT(accept()));
00271 
00272                     QMetaObject::connectSlotsByName(ValuesDialog);
00273                 } // setupUi
00274 
00276                 void retranslateUi(QDialog *ValuesDialog) {
00277                     ValuesDialog->setWindowTitle(
00278                             QApplication::translate("ValuesDialog",
00279                                 "Enter Values for the Function", 0,
00280                                 QApplication::UnicodeUTF8));
00281                     ValuesDialog->setWhatsThis(QApplication::translate("ValuesDialog",
00282                         "In this dialog window the user can enter up to four parameters"
00283                         "to the displayed four-dimensional function or object.\n"
00284                         "She can also change the resolution of the grid.", 0,
00285                         QApplication::UnicodeUTF8));
00286                     gridLabel->setText(QApplication::translate("ValuesDialog",
00287                         "Grid size and bounds", 0, QApplication::UnicodeUTF8));
00288                     Label[0]->setText(QApplication::translate("ValuesDialog",
00289                         "Steps in t", 0, QApplication::UnicodeUTF8));
00290                     MinLabel[0]->setText(QApplication::translate("ValuesDialog",
00291                         "tmin", 0, QApplication::UnicodeUTF8));
00292                     MaxLabel[0]->setText(QApplication::translate("ValuesDialog",
00293                         "tmax", 0, QApplication::UnicodeUTF8));
00294                     Label[1]->setText(QApplication::translate("ValuesDialog",
00295                         "Steps in u", 0, QApplication::UnicodeUTF8));
00296                     MinLabel[1]->setText(QApplication::translate("ValuesDialog",
00297                         "umin", 0, QApplication::UnicodeUTF8));
00298                     MaxLabel[1]->setText(QApplication::translate("ValuesDialog",
00299                         "umax", 0, QApplication::UnicodeUTF8));
00300                     Label[2]->setText(QApplication::translate("ValuesDialog",
00301                         "Steps in v", 0, QApplication::UnicodeUTF8));
00302                     MinLabel[2]->setText(QApplication::translate("ValuesDialog",
00303                         "vmin", 0, QApplication::UnicodeUTF8));
00304                     MaxLabel[2]->setText(QApplication::translate("ValuesDialog",
00305                         "vmax", 0, QApplication::UnicodeUTF8));
00306                     for (unsigned i = 0; i < maxNumDimensions; ++i) {
00307                         Steps[i]->setText(QApplication::translate("ValuesDialog",
00308                             "1", 0, QApplication::UnicodeUTF8));
00309                         Min[i]->setToolTip(QApplication::translate("ValuesDialog",
00310                             "enter '-pi' if you mean -3.1415...", 0,
00311                             QApplication::UnicodeUTF8));
00312                         Min[i]->setText(QApplication::translate("ValuesDialog",
00313                             "-1", 0, QApplication::UnicodeUTF8));
00314                         Max[i]->setToolTip(QApplication::translate("ValuesDialog",
00315                             "or 'pi' if you want 3.1415...", 0,
00316                             QApplication::UnicodeUTF8));
00317                         Max[i]->setText(QApplication::translate("ValuesDialog",
00318                             "1", 0, QApplication::UnicodeUTF8));
00319                     }
00320                     functionLabel->setText(QApplication::translate("ValuesDialog",
00321                         "Function Parameters", 0, QApplication::UnicodeUTF8));
00322                     for (unsigned i = 0; i < maxNumParameters; ++i) {
00323                         ParameterLabel[i]->setText(QApplication::translate(
00324                             "ValuesDialog", "Parameter", 0,
00325                              QApplication::UnicodeUTF8));
00326                         //  set 1 as default value (casted to QString)
00327                         Parameter[i]->setValue(QApplication::translate(
00328                             "ValuesDialog", "1", 0, QApplication::UnicodeUTF8));
00329                     }
00330                     buttonApply->setToolTip(QApplication::translate("ValuesDialog",
00331                         "Accept changes and redraw", 0, QApplication::UnicodeUTF8));
00332                     buttonApply->setText(QApplication::translate("ValuesDialog",
00333                         "&Apply", 0, QApplication::UnicodeUTF8));
00334                     Q_UNUSED(ValuesDialog);
00335                 } // retranslateUi
00336 
00337             protected:
00338                 //  these members should be private and referred to only by accessors,
00339                 //  but this is the way uic created the class and the derived class
00340                 //  depends too much on them. so i didn't bother.
00341                 QGridLayout *gridLayout;            
00342                 QVBoxLayout *AllBoundsLayout;       
00343                 QVBoxLayout *AllParametersLayout;   
00344                 QHBoxLayout *ButtonLayout;          
00345 
00346                 QLabel *gridLabel;                  
00347 
00349                 QHBoxLayout *SliderLayout[maxNumDimensions];
00351                 QHBoxLayout *BoundsLayout[maxNumDimensions];
00353                 QHBoxLayout *MinLayout[maxNumDimensions];
00355                 QHBoxLayout *MaxLayout[maxNumDimensions];
00356 
00357                 QLabel *Label[maxNumDimensions];    
00358                 QSlider *Slider[maxNumDimensions];  
00359                 QLabel *Steps[maxNumDimensions];    
00360                 QLabel *MinLabel[maxNumDimensions]; 
00361                 QLineEdit *Min[maxNumDimensions];   
00362                 QLabel *MaxLabel[maxNumDimensions]; 
00363                 QLineEdit *Max[maxNumDimensions];   
00364 
00366                 QLabel *functionLabel;
00367 
00369                 QHBoxLayout *ParameterLayout[maxNumParameters];
00371                 QHBoxLayout *ParameterLineLayout[maxNumParameters/parametersPerLine];
00372 
00374                 QLabel *ParameterLabel[maxNumParameters];
00376                 ParameterInput *Parameter[maxNumParameters];
00377 
00378                 QPushButton *buttonApply;                   
00379 
00380         };
00381     }
00382 }
00383 
00384 #endif // UI_VALUESDIALOG_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:16 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo