src/dialogs.cpp

changeset 329
76db02dc7f60
parent 319
d0f41342ef51
child 332
3013acb1df53
equal deleted inserted replaced
328:b6a814a608c6 329:76db02dc7f60
151 void OverlayDialog::slot_dimensionsChanged () { 151 void OverlayDialog::slot_dimensionsChanged () {
152 bool enable = (dsb_lwidth->value () != 0) || (dsb_lheight->value () != 0); 152 bool enable = (dsb_lwidth->value () != 0) || (dsb_lheight->value () != 0);
153 dbb_buttons->button (QDialogButtonBox::Ok)->setEnabled (enable); 153 dbb_buttons->button (QDialogButtonBox::Ok)->setEnabled (enable);
154 } 154 }
155 155
156 ReplaceCoordsDialog::ReplaceCoordsDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) {
157 cbg_axes = makeAxesBox ();
158
159 lb_search = new QLabel ("Search:");
160 lb_replacement = new QLabel ("Replacement:");
161
162 dsb_search = new QDoubleSpinBox;
163 dsb_search->setRange (-10000.0f, 10000.0f);
164 dsb_search->setDecimals (6);
165
166 dsb_replacement = new QDoubleSpinBox;
167 dsb_replacement->setRange (-10000.0f, 10000.0f);
168 dsb_replacement->setDecimals (6);
169
170 cb_any = new QCheckBox ("Any");
171 cb_rel = new QCheckBox ("Relative");
172
173 connect (cb_any, SIGNAL (stateChanged (int)), this, SLOT (anyChanged (int)));
174
175 QGridLayout* valueLayout = new QGridLayout;
176 valueLayout->setColumnStretch (1, 1);
177 valueLayout->addWidget (lb_search, 0, 0);
178 valueLayout->addWidget (dsb_search, 0, 1);
179 valueLayout->addWidget (cb_any, 0, 2);
180 valueLayout->addWidget (lb_replacement, 1, 0);
181 valueLayout->addWidget (dsb_replacement, 1, 1);
182 valueLayout->addWidget (cb_rel, 1, 2);
183
184 QVBoxLayout* layout = new QVBoxLayout;
185 layout->addWidget (cbg_axes);
186 layout->addLayout (valueLayout);
187 layout->addWidget (makeButtonBox (*this));
188 setLayout (layout);
189 }
190
191 double ReplaceCoordsDialog::searchValue () const {
192 return dsb_search->value ();
193 }
194
195 double ReplaceCoordsDialog::replacementValue () const {
196 return dsb_replacement->value ();
197 }
198
199 vector<int> ReplaceCoordsDialog::axes () const {
200 return cbg_axes->checkedValues ();
201 }
202
203 void ReplaceCoordsDialog::anyChanged (int state) {
204 dsb_search->setEnabled (state != Qt::Checked);
205 }
206
207 bool ReplaceCoordsDialog::any () const {
208 return cb_any->isChecked ();
209 }
210
211 bool ReplaceCoordsDialog::rel () const {
212 return cb_rel->isChecked ();
213 }
214
215 // ============================================================================= 156 // =============================================================================
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
217 // ============================================================================= 158 // =============================================================================
218 SetContentsDialog::SetContentsDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { 159 SetContentsDialog::SetContentsDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) {
219 lb_error = new QLabel; 160 lb_error = new QLabel;

mercurial