]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/colour.cpp
oops, typo in last commit
[wxWidgets.git] / src / palmos / colour.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/colour.cpp
3 // Purpose: wxColour class
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by:
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 #include "wx/colour.h"
16
17 #ifdef __BORLANDC__
18 #pragma hdrstop
19 #endif
20
21 #include "wx/gdicmn.h"
22
23 #include <string.h>
24
25 #if wxUSE_EXTENDED_RTTI
26
27 template<> void wxStringReadValue(const wxString &s , wxColour &data )
28 {
29 if ( !data.Set(s) )
30 {
31 wxLogError(_("String To Colour : Incorrect colour specification : %s"),
32 s.c_str() );
33 data = wxNullColour;
34 }
35 }
36
37 template<> void wxStringWriteValue(wxString &s , const wxColour &data )
38 {
39 s = data.GetAsString(wxC2S_HTML_SYNTAX);
40 }
41
42 wxTO_STRING_IMP( wxColour )
43 wxFROM_STRING_IMP( wxColour )
44
45 IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour , wxObject , "wx/colour.h" , &wxTO_STRING( wxColour ) , &wxFROM_STRING( wxColour ))
46
47 wxBEGIN_PROPERTIES_TABLE(wxColour)
48 wxREADONLY_PROPERTY( Red, unsigned char, Red, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
49 wxREADONLY_PROPERTY( Green, unsigned char, Green, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
50 wxREADONLY_PROPERTY( Blue, unsigned char, Blue, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
51 wxEND_PROPERTIES_TABLE()
52
53 wxCONSTRUCTOR_3( wxColour, unsigned char, Red, unsigned char, Green, unsigned char, Blue )
54
55 wxBEGIN_HANDLERS_TABLE(wxColour)
56 wxEND_HANDLERS_TABLE()
57 #else
58 IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
59 #endif
60
61 // Colour
62
63 void wxColour::Init()
64 {
65 m_isInit = false;
66 m_pixel = 0;
67 m_red =
68 m_blue =
69 m_green = 0;
70 }
71
72 wxColour::wxColour(const wxColour& col)
73 {
74 *this = col;
75 }
76
77 wxColour& wxColour::operator=(const wxColour& col)
78 {
79 m_red = col.m_red;
80 m_green = col.m_green;
81 m_blue = col.m_blue;
82 m_isInit = col.m_isInit;
83 m_pixel = col.m_pixel;
84 return *this;
85 }
86
87 wxColour::~wxColour()
88 {
89 }
90
91 void wxColour::InitWith(unsigned char r, unsigned char g, unsigned char b)
92 {
93 m_red = r;
94 m_green = g;
95 m_blue = b;
96 m_isInit = true;
97 }