src/dialogs.cpp

changeset 262
56f8987f4c7c
parent 259
69a842af73f7
child 270
f5f2353af0d9
equal deleted inserted replaced
261:c4ad4e3c6839 262:56f8987f4c7c
24 #include <QLabel> 24 #include <QLabel>
25 #include <QPushButton> 25 #include <QPushButton>
26 #include <QBoxLayout> 26 #include <QBoxLayout>
27 #include <QGridLayout> 27 #include <QGridLayout>
28 #include <qprogressbar.h> 28 #include <qprogressbar.h>
29 #include <QCheckBox>
29 30
30 #include "dialogs.h" 31 #include "dialogs.h"
31 #include "widgets.h" 32 #include "widgets.h"
32 #include "gui.h" 33 #include "gui.h"
33 #include "gldraw.h" 34 #include "gldraw.h"
162 dsb_search->setRange (-10000.0f, 10000.0f); 163 dsb_search->setRange (-10000.0f, 10000.0f);
163 164
164 dsb_replacement = new QDoubleSpinBox; 165 dsb_replacement = new QDoubleSpinBox;
165 dsb_replacement->setRange (-10000.0f, 10000.0f); 166 dsb_replacement->setRange (-10000.0f, 10000.0f);
166 167
168 cb_any = new QCheckBox ("Any");
169 cb_rel = new QCheckBox ("Relative");
170
171 connect (cb_any, SIGNAL (stateChanged (int)), this, SLOT (anyChanged (int)));
172
167 QGridLayout* valueLayout = new QGridLayout; 173 QGridLayout* valueLayout = new QGridLayout;
168 valueLayout->setColumnStretch (1, 1); 174 valueLayout->setColumnStretch (1, 1);
169 valueLayout->addWidget (lb_search, 0, 0); 175 valueLayout->addWidget (lb_search, 0, 0);
170 valueLayout->addWidget (dsb_search, 0, 1); 176 valueLayout->addWidget (dsb_search, 0, 1);
177 valueLayout->addWidget (cb_any, 0, 2);
171 valueLayout->addWidget (lb_replacement, 1, 0); 178 valueLayout->addWidget (lb_replacement, 1, 0);
172 valueLayout->addWidget (dsb_replacement, 1, 1); 179 valueLayout->addWidget (dsb_replacement, 1, 1);
180 valueLayout->addWidget (cb_rel, 1, 2);
173 181
174 QVBoxLayout* layout = new QVBoxLayout; 182 QVBoxLayout* layout = new QVBoxLayout;
175 layout->addWidget (cbg_axes); 183 layout->addWidget (cbg_axes);
176 layout->addLayout (valueLayout); 184 layout->addLayout (valueLayout);
177 layout->addWidget (makeButtonBox (*this)); 185 layout->addWidget (makeButtonBox (*this));
186 return dsb_replacement->value (); 194 return dsb_replacement->value ();
187 } 195 }
188 196
189 vector<int> ReplaceCoordsDialog::axes () const { 197 vector<int> ReplaceCoordsDialog::axes () const {
190 return cbg_axes->checkedValues (); 198 return cbg_axes->checkedValues ();
199 }
200
201 void ReplaceCoordsDialog::anyChanged (int state) {
202 dsb_search->setEnabled (state != Qt::Checked);
203 }
204
205 bool ReplaceCoordsDialog::any () const {
206 return cb_any->isChecked ();
207 }
208
209 bool ReplaceCoordsDialog::rel () const {
210 return cb_rel->isChecked ();
191 } 211 }
192 212
193 // ============================================================================= 213 // =============================================================================
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
195 // ============================================================================= 215 // =============================================================================

mercurial