blob: 42b622502abbf1a234e6621458d5003b2ba26d15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#ifndef COLORDIALOG_H
#define COLORDIALOG_H
#include <tqdialog.h>
#include <tqrect.h>
#include <tqimage.h>
class TQPushButton;
class TQComboBox;
class TQGroupBox;
class TQPainter;
class ColorDialog;
class TQImage;
class TQPixmap;
enum Colors { Back = 0, Button, Base, Text, High, HighText, ButText, Alternate, NUMCOLORS };
class DemoWindow : public TQWidget
{
Q_OBJECT
public:
DemoWindow( ColorDialog* parent = 0, const char* name = 0);
~DemoWindow();
private slots:
void smartRepaint();
protected:
void mousePressEvent ( TQMouseEvent * e );
void paintEvent ( TQPaintEvent * );
private:
TQPainter *p;
TQPainter *pp;
TQPixmap *pm;
ColorDialog* colorDialog_;
TQRect baseRect;
TQRect buttonRect;
TQRect buttonTextRect;
TQRect highlightRect;
TQRect textRect;
TQRect highTextRect;
TQRect alternateRect;
TQImage baseImage;
TQImage dest;
private:
TQImage & tintButton(TQImage &src, TQColor & c);
signals:
void selected(Colors c);
};
class ColorPicker;
class ColorDialog : public TQDialog
{
friend class DemoWindow;
friend class AppSetter;
Q_OBJECT
public:
ColorDialog( TQWidget* parent = 0, const char* name = 0);
~ColorDialog();
TQPushButton *buttonOk;
TQPushButton *buttonCancel;
void show();
protected:
ColorPicker *picker[NUMCOLORS];
void mouseReleaseEvent(TQMouseEvent* me);
DemoWindow *demo;
private:
TQPushButton *buttonCP;
bool gettingColorFromScreen;
TQComboBox *other;
private slots:
void grabColor();
void getFromOther( const TQString & string );
signals:
void colorChanged(TQColor color);
};
#endif // COLORPICKER_H
|