src/addObjectDialog.cpp

changeset 198
f246725199dc
parent 192
c414924a647c
child 199
10dd5909a50e
equal deleted inserted replaced
197:82a868e9e929 198:f246725199dc
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #include <qgridlayout.h> 19 #include <qgridlayout.h>
20 #include <qradiobutton.h>
21 #include <qcheckbox.h> 20 #include <qcheckbox.h>
21 #include <qdialogbuttonbox.h>
22 #include <qspinbox.h>
23 #include <qlabel.h>
24 #include <qlistwidget.h>
25 #include <qtreewidget.h>
26 #include <qlineedit.h>
27 #include <qpushbutton.h>
22 #include "gui.h" 28 #include "gui.h"
23 #include "addObjectDialog.h" 29 #include "addObjectDialog.h"
24 #include "file.h" 30 #include "file.h"
25 #include "colors.h" 31 #include "colors.h"
26 #include "colorSelectDialog.h" 32 #include "colorSelectDialog.h"
27 #include "history.h" 33 #include "history.h"
28 #include "setContentsDialog.h" 34 #include "setContentsDialog.h"
35 #include "radiobox.h"
29 36
30 #define APPLY_COORDS(OBJ, N) \ 37 #define APPLY_COORDS(OBJ, N) \
31 for (short i = 0; i < N; ++i) \ 38 for (short i = 0; i < N; ++i) \
32 for (const Axis ax : g_Axes) \ 39 for (const Axis ax : g_Axes) \
33 OBJ->coords[i][ax] = dlg.dsb_coords[(i * 3) + ax]->value (); 40 OBJ->coords[i][ax] = dlg.dsb_coords[(i * 3) + ax]->value ();
206 dsb_coords[i]->setDecimals (5); 213 dsb_coords[i]->setDecimals (5);
207 dsb_coords[i]->setMinimum (-10000.0); 214 dsb_coords[i]->setMinimum (-10000.0);
208 dsb_coords[i]->setMaximum (10000.0); 215 dsb_coords[i]->setMaximum (10000.0);
209 } 216 }
210 217
211 IMPLEMENT_DIALOG_BUTTONS
212
213 QGridLayout* const layout = new QGridLayout; 218 QGridLayout* const layout = new QGridLayout;
214 layout->addWidget (lb_typeIcon, 0, 0); 219 layout->addWidget (lb_typeIcon, 0, 0);
215 220
216 switch (type) { 221 switch (type) {
217 case LDObject::Line: 222 case LDObject::Line:
289 qCoordLayout->addWidget (dsb_coords[i], (i / 3), (i % 3)); 294 qCoordLayout->addWidget (dsb_coords[i], (i / 3), (i % 3));
290 295
291 layout->addLayout (qCoordLayout, 0, 1, (coordCount / 3), 3); 296 layout->addLayout (qCoordLayout, 0, 1, (coordCount / 3), 3);
292 } 297 }
293 298
294 layout->addWidget (bbx_buttons, 5, 0, 1, 4); 299 layout->addWidget (makeButtonBox (*this), 5, 0, 1, 4);
295 setLayout (layout); 300 setLayout (layout);
296 setWindowTitle (fmt (APPNAME ": New %s", 301 setWindowTitle (fmt (APPNAME ": New %s",
297 g_saObjTypeNames[type]).chars()); 302 g_saObjTypeNames[type]).chars());
298 303
299 setWindowIcon (icon); 304 setWindowIcon (icon);

mercurial