]> git.saurik.com Git - wxWidgets.git/blob - src/qt/colour.cpp
Oops, compile errors...
[wxWidgets.git] / src / qt / colour.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: colour.cpp
3 // Purpose: wxColour class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "colour.h"
14 #endif
15
16 #include "wx/gdicmn.h"
17 #include "wx/colour.h"
18
19 IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
20
21 // Colour
22
23 wxColour::wxColour ()
24 {
25 m_isInit = FALSE;
26 m_red = m_blue = m_green = 0;
27 /* TODO
28 m_pixel = 0;
29 */
30 }
31
32 wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b)
33 {
34 m_red = r;
35 m_green = g;
36 m_blue = b;
37 m_isInit = TRUE;
38 /* TODO
39 m_pixel = PALETTERGB (m_red, m_green, m_blue);
40 */
41 }
42
43 wxColour::wxColour (const wxColour& col)
44 {
45 m_red = col.m_red;
46 m_green = col.m_green;
47 m_blue = col.m_blue;
48 m_isInit = col.m_isInit;
49 /* TODO
50 m_pixel = col.m_pixel;
51 */
52 }
53
54 wxColour& wxColour::operator =(const wxColour& col)
55 {
56 m_red = col.m_red;
57 m_green = col.m_green;
58 m_blue = col.m_blue;
59 m_isInit = col.m_isInit;
60 /* TODO
61 m_pixel = col.m_pixel;
62 */
63 return *this;
64 }
65
66 wxColour::wxColour (const wxString& col)
67 {
68 wxColour *the_colour = wxTheColourDatabase->FindColour (col);
69 if (the_colour)
70 {
71 m_red = the_colour->Red ();
72 m_green = the_colour->Green ();
73 m_blue = the_colour->Blue ();
74 m_isInit = TRUE;
75 }
76 else
77 {
78 m_red = 0;
79 m_green = 0;
80 m_blue = 0;
81 m_isInit = FALSE;
82 }
83 /* TODO
84 m_pixel = PALETTERGB (m_red, m_green, m_blue);
85 */
86 }
87
88 wxColour::~wxColour ()
89 {
90 }
91
92 wxColour& wxColour::operator = (const wxString& col)
93 {
94 wxColour *the_colour = wxTheColourDatabase->FindColour (col);
95 if (the_colour)
96 {
97 m_red = the_colour->Red ();
98 m_green = the_colour->Green ();
99 m_blue = the_colour->Blue ();
100 m_isInit = TRUE;
101 }
102 else
103 {
104 m_red = 0;
105 m_green = 0;
106 m_blue = 0;
107 m_isInit = FALSE;
108 }
109 /* TODO
110 m_pixel = PALETTERGB (m_red, m_green, m_blue);
111 */
112 return (*this);
113 }
114
115 void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
116 {
117 m_red = r;
118 m_green = g;
119 m_blue = b;
120 m_isInit = TRUE;
121 /* TODO
122 m_pixel = PALETTERGB (m_red, m_green, m_blue);
123 */
124 }