src/colorSelector.h

Thu, 05 Jun 2014 23:18:13 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Thu, 05 Jun 2014 23:18:13 +0300
changeset 794
c254ddc6618b
parent 655
b376645315ab
child 795
195fa1fff9c3
permissions
-rw-r--r--

- source reformat

655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2013, 2014 Santeri Piippo
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #pragma once
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include <QDialog>
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include "main.h"
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 class LDColor;
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 class Ui_ColorSelUI;
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 class QGraphicsScene;
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 class ColorSelector : public QDialog
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 {
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 Q_OBJECT
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 PROPERTY (private, LDColor*, selection, setSelection, STOCK_WRITE)
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
32 public:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
33 explicit ColorSelector (int defval = -1, QWidget* parent = null);
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
34 virtual ~ColorSelector();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
35 static bool selectColor (int& val, int defval = -1, QWidget* parent = null);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
37 protected:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
38 void mousePressEvent (QMouseEvent* event);
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
39 void resizeEvent (QResizeEvent* ev);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
41 private:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
42 Ui_ColorSelUI* ui;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
43 QGraphicsScene* m_scene;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
44 bool m_firstResize;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
45
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
46 int numRows() const;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
47 int viewportWidth() const;
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
48 void drawScene();
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 655
diff changeset
49 void drawColorInfo();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50 };

mercurial