]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/colour.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/colour.cpp
3 // Purpose: wxColour class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/colour.h"
22 #include "wx/gdicmn.h"
25 #include "wx/msw/private.h"
29 #if wxUSE_EXTENDED_RTTI
31 template<> void wxStringReadValue(const wxString
&s
, wxColour
&data
)
35 wxLogError(_("String To Colour : Incorrect colour specification : %s"),
41 template<> void wxStringWriteValue(wxString
&s
, const wxColour
&data
)
43 s
= data
.GetAsString(wxC2S_HTML_SYNTAX
);
46 wxTO_STRING_IMP( wxColour
)
47 wxFROM_STRING_IMP( wxColour
)
49 IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour
, wxObject
, "wx/colour.h" , &wxTO_STRING( wxColour
) , &wxFROM_STRING( wxColour
))
51 wxBEGIN_PROPERTIES_TABLE(wxColour
)
52 wxREADONLY_PROPERTY( Red
, unsigned char, Red
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
53 wxREADONLY_PROPERTY( Green
, unsigned char, Green
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
54 wxREADONLY_PROPERTY( Blue
, unsigned char, Blue
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
55 wxEND_PROPERTIES_TABLE()
57 wxDIRECT_CONSTRUCTOR_3( wxColour
, unsigned char, Red
, unsigned char, Green
, unsigned char, Blue
)
59 wxBEGIN_HANDLERS_TABLE(wxColour
)
60 wxEND_HANDLERS_TABLE()
62 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
77 void wxColour::InitRGBA(unsigned char r
, unsigned char g
, unsigned char b
,
85 m_pixel
= PALETTERGB(m_red
, m_green
, m_blue
);