zz_colorSelectDialog.h

Sun, 28 Apr 2013 04:04:36 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 28 Apr 2013 04:04:36 +0300
changeset 146
2ab24976acaa
parent 135
c243df39913e
child 160
edcb03f3ef75
permissions
-rw-r--r--

Now capable of calculating coordinates based on mouse x and y and snapping them to the grid

48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
104
6e29bb0e83c5 GL picking stuff
Santeri Piippo <crimsondusk64@gmail.com>
parents: 49
diff changeset
3 * Copyright (C) 2013 Santeri Piippo
48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
135
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
19 #ifndef COLORSELECTOR_H
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
20 #define COLORSELECTOR_H
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
21
48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <qdialog.h>
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #include <qdialogbuttonbox.h>
49
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
24 #include <qgraphicsscene.h>
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
25 #include <qlabel.h>
104
6e29bb0e83c5 GL picking stuff
Santeri Piippo <crimsondusk64@gmail.com>
parents: 49
diff changeset
26 #include "common.h"
48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 class ColorSelectDialog : public QDialog {
49
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
29 Q_OBJECT
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
30
48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 public:
104
6e29bb0e83c5 GL picking stuff
Santeri Piippo <crimsondusk64@gmail.com>
parents: 49
diff changeset
32 explicit ColorSelectDialog (short dDefault = -1, QWidget* parent = null);
6e29bb0e83c5 GL picking stuff
Santeri Piippo <crimsondusk64@gmail.com>
parents: 49
diff changeset
33 static bool staticDialog (short& dValue, short dDefault = -1, QWidget* parent = null);
48
113eb6446c61 Color dialog almost up and running. Need to make it actually selectable now. TODO: make it read LDConfig.ldr
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34
135
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
35 QGraphicsScene* gs_scene;
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
36 QGraphicsView* gv_view;
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
37 QLabel* lb_colorInfo;
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
38 QDialogButtonBox* bbx_buttons;
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
39 short selColor;
49
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
40
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
41 private:
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
42 void drawScene ();
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
43 void drawColorInfo ();
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
44
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
45 private slots:
242f6ea0f5e5 Finished with the color selection dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
46 void mousePressEvent (QMouseEvent* event);
135
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
47 };
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
48
c243df39913e Cleanup and some restructuring
Santeri Piippo <crimsondusk64@gmail.com>
parents: 104
diff changeset
49 #endif // COLORSELECTOR_H

mercurial