]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/colour.cpp
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[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 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #include "wx/colour.h"
20
21 #ifndef WX_PRECOMP
22 #include "wx/gdicmn.h"
23 #endif
24
25 #include <string.h>
26
27 #if wxUSE_EXTENDED_RTTI
28
29 template<> void wxStringReadValue(const wxString &s , wxColour &data )
30 {
31 if ( !data.Set(s) )
32 {
33 wxLogError(_("String To Colour : Incorrect colour specification : %s"),
34 s.c_str() );
35 data = wxNullColour;
36 }
37 }
38
39 template<> void wxStringWriteValue(wxString &s , const wxColour &data )
40 {
41 s = data.GetAsString(wxC2S_HTML_SYNTAX);
42 }
43
44 wxTO_STRING_IMP( wxColour )
45 wxFROM_STRING_IMP( wxColour )
46
47 IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour , wxObject , "wx/colour.h" , &wxTO_STRING( wxColour ) , &wxFROM_STRING( wxColour ))
48
49 wxBEGIN_PROPERTIES_TABLE(wxColour)
50 wxREADONLY_PROPERTY( Red, unsigned char, Red, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
51 wxREADONLY_PROPERTY( Green, unsigned char, Green, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
52 wxREADONLY_PROPERTY( Blue, unsigned char, Blue, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
53 wxEND_PROPERTIES_TABLE()
54
55 wxCONSTRUCTOR_3( wxColour, unsigned char, Red, unsigned char, Green, unsigned char, Blue )
56
57 wxBEGIN_HANDLERS_TABLE(wxColour)
58 wxEND_HANDLERS_TABLE()
59 #else
60 IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
61 #endif
62
63 // Colour
64
65 void wxColour::Init()
66 {
67 m_isInit = false;
68 m_pixel = 0;
69 m_red =
70 m_blue =
71 m_green = 0;
72 }
73
74 wxColour::wxColour(const wxColour& col)
75 {
76 *this = col;
77 }
78
79 wxColour& wxColour::operator=(const wxColour& col)
80 {
81 m_red = col.m_red;
82 m_green = col.m_green;
83 m_blue = col.m_blue;
84 m_isInit = col.m_isInit;
85 m_pixel = col.m_pixel;
86 return *this;
87 }
88
89 wxColour::~wxColour()
90 {
91 }
92
93 void wxColour::InitWith(unsigned char r, unsigned char g, unsigned char b)
94 {
95 m_red = r;
96 m_green = g;
97 m_blue = b;
98 m_isInit = true;
99 }