Tue, 07 May 2013 23:37:46 +0300
Removed the message log. I'll find a better way to convey messages at some point..
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
104 | 3 | * Copyright (C) 2013 Santeri Piippo |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
135
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
19 | #ifndef ZZ_ADDOBJECTDIALOG_H |
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
20 | #define ZZ_ADDOBJECTDIALOG_H |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include "gui.h" |
157
635da3135bd4
Un-templated ButtonBox and renamed to RadioBox. Much better this way.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
151
diff
changeset
|
23 | #include "radiobox.h" |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | #include <qdialog.h> |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | #include <qlineedit.h> |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | #include <qdialogbuttonbox.h> |
136
13db97be14cb
Converted combo boxes in add object and new part dialogs to radio buttons. Added a convenience widget which makes it easier for me to add groups of radio buttons. My first widget.. :')
Santeri Piippo <crimsondusk64@gmail.com>
parents:
135
diff
changeset
|
27 | #include <qcheckbox.h> |
40
215b9f8f0cd7
Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
39
diff
changeset
|
28 | #include <qspinbox.h> |
136
13db97be14cb
Converted combo boxes in add object and new part dialogs to radio buttons. Added a convenience widget which makes it easier for me to add groups of radio buttons. My first widget.. :')
Santeri Piippo <crimsondusk64@gmail.com>
parents:
135
diff
changeset
|
29 | #include <qlabel.h> |
13db97be14cb
Converted combo boxes in add object and new part dialogs to radio buttons. Added a convenience widget which makes it easier for me to add groups of radio buttons. My first widget.. :')
Santeri Piippo <crimsondusk64@gmail.com>
parents:
135
diff
changeset
|
30 | #include <qradiobutton.h> |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
31 | #include <qlistwidget.h> |
151
15fe6c51de54
Switched the object list from a QTreeWidget to a QListWidget-derivative. Derivative because I'm going to add a context menu.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
150
diff
changeset
|
32 | #include <qtreewidget.h> |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | class AddObjectDialog : public QDialog { |
51
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
35 | Q_OBJECT |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
36 | |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | public: |
168
96691a009dff
Further work on ext programs, LDObjectType_e integrated into LDObject
Santeri Piippo <crimsondusk64@gmail.com>
parents:
160
diff
changeset
|
38 | AddObjectDialog (const LDObject::Type type, LDObject* obj, QWidget* parent = null); |
96691a009dff
Further work on ext programs, LDObjectType_e integrated into LDObject
Santeri Piippo <crimsondusk64@gmail.com>
parents:
160
diff
changeset
|
39 | static void staticDialog (const LDObject::Type type, LDObject* obj); |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
41 | QLabel* lb_typeIcon; |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | |
160
edcb03f3ef75
Mass renaming and cleanup. GLRenderer's and ForgeWindow's members made private. Names of common identifiers shortened, moved logVA to ForgeWindow since it's a GUI-related function (though logf remains under main.cpp for ubiquitous usage)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
157
diff
changeset
|
43 | // Comment line edit |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
44 | QLineEdit* le_comment; |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | |
40
215b9f8f0cd7
Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
39
diff
changeset
|
46 | // Coordinate edits for.. anything with coordinates, really. |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
47 | QDoubleSpinBox* dsb_coords[12]; |
40
215b9f8f0cd7
Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
39
diff
changeset
|
48 | |
51
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
49 | // Color selection dialog button |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
50 | QPushButton* pb_color; |
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
51 | |
150
bcbbdc5454e6
Added new BFC dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
140
diff
changeset
|
52 | // BFC-related widgets |
157
635da3135bd4
Un-templated ButtonBox and renamed to RadioBox. Much better this way.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
151
diff
changeset
|
53 | RadioBox* rb_bfcType; |
150
bcbbdc5454e6
Added new BFC dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
140
diff
changeset
|
54 | |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
55 | // Subfile stuff |
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
56 | QTreeWidget* tw_subfileList; |
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
57 | QLineEdit* le_subfileName; |
51
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
58 | |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
59 | // Radial stuff |
136
13db97be14cb
Converted combo boxes in add object and new part dialogs to radio buttons. Added a convenience widget which makes it easier for me to add groups of radio buttons. My first widget.. :')
Santeri Piippo <crimsondusk64@gmail.com>
parents:
135
diff
changeset
|
60 | QCheckBox* cb_radHiRes; |
157
635da3135bd4
Un-templated ButtonBox and renamed to RadioBox. Much better this way.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
151
diff
changeset
|
61 | RadioBox* rb_radType; |
135
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
62 | QSpinBox* sb_radSegments, *sb_radRingNum; |
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
63 | QLabel* lb_radType, *lb_radResolution, *lb_radSegments, |
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
64 | *lb_radRingNum; |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
65 | |
135
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
66 | QDialogButtonBox* bbx_buttons; |
51
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
67 | |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
68 | private: |
150
bcbbdc5454e6
Added new BFC dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
140
diff
changeset
|
69 | void setButtonBackground (QPushButton* button, short color); |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
70 | char* currentSubfileName (); |
51
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
71 | |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
72 | short dColor; |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
73 | |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
74 | private slots: |
94c434a56961
Added color selectors for the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
75 | void slot_colorButtonClicked (); |
150
bcbbdc5454e6
Added new BFC dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
140
diff
changeset
|
76 | void slot_radialTypeChanged (int type); |
138
d22d5c1d9e8a
Added new subfile dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
136
diff
changeset
|
77 | void slot_subfileTypeChanged (); |
39
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | }; |
110669124caf
Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | |
135
c243df39913e
Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
80 | #endif // ZZ_ADDOBJECTDIALOG_H |