|      1 /* | 
     1 /* | 
|      2  *  LDForge: LDraw parts authoring CAD | 
     2  *  LDForge: LDraw parts authoring CAD | 
|      3  *  Copyright (C) 2013 Santeri Piippo | 
     3  *  Copyright (C) 2013, 2014 Santeri Piippo | 
|      4  * | 
     4  * | 
|      5  *  This program is free software: you can redistribute it and/or modify | 
     5  *  This program is free software: you can redistribute it and/or modify | 
|      6  *  it under the terms of the GNU General Public License as published by | 
     6  *  it under the terms of the GNU General Public License as published by | 
|      7  *  the Free Software Foundation, either version 3 of the License, or | 
     7  *  the Free Software Foundation, either version 3 of the License, or | 
|      8  *  (at your option) any later version. | 
     8  *  (at your option) any later version. | 
|     18  | 
    18  | 
|     19 #ifndef LDFORGE_COLORSELECTOR_H | 
    19 #ifndef LDFORGE_COLORSELECTOR_H | 
|     20 #define LDFORGE_COLORSELECTOR_H | 
    20 #define LDFORGE_COLORSELECTOR_H | 
|     21  | 
    21  | 
|     22 #include <QDialog> | 
    22 #include <QDialog> | 
|     23 #include "common.h" | 
    23 #include "main.h" | 
|     24  | 
    24  | 
|     25 class LDColor; | 
    25 class LDColor; | 
|     26 class Ui_ColorSelUI; | 
    26 class Ui_ColorSelUI; | 
|     27 class QGraphicsScene; | 
    27 class QGraphicsScene; | 
|     28  | 
    28  | 
|     29 class ColorSelector : public QDialog | 
    29 class ColorSelector : public QDialog | 
|     30 {	Q_OBJECT | 
    30 { | 
|     31 	READ_PROPERTY (LDColor*, sel, setSelection) | 
    31 	Q_OBJECT | 
|         | 
    32 	PROPERTY (private,	LDColor*,	Selection,	NO_OPS,	STOCK_WRITE) | 
|     32  | 
    33  | 
|     33 	public: | 
    34 	public: | 
|     34 		explicit ColorSelector (short defval = -1, QWidget* parent = null); | 
    35 		explicit ColorSelector (int defval = -1, QWidget* parent = null); | 
|     35 		virtual ~ColorSelector(); | 
    36 		virtual ~ColorSelector(); | 
|     36 		static bool getColor (short& val, short defval = -1, QWidget* parent = null); | 
    37 		static bool selectColor (int& val, int defval = -1, QWidget* parent = null); | 
|     37  | 
    38  | 
|     38 	protected: | 
    39 	protected: | 
|     39 		void mousePressEvent (QMouseEvent* event); | 
    40 		void mousePressEvent (QMouseEvent* event); | 
|     40 		void resizeEvent (QResizeEvent* ev); | 
    41 		void resizeEvent (QResizeEvent* ev); | 
|     41  | 
    42  |