]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/colour.cpp
8d667f730e86f9ac6d70e55f65ae22e8d1705463
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"
21 #include "wx/gdicmn.h"
22 #include "wx/msw/private.h"
26 #if wxUSE_EXTENDED_RTTI
28 template<> void wxStringReadValue(const wxString
&s
, wxColour
&data
)
32 wxLogError(_("String To Colour : Incorrect colour specification : %s"),
38 template<> void wxStringWriteValue(wxString
&s
, const wxColour
&data
)
40 s
= data
.GetAsString(wxC2S_HTML_SYNTAX
);
43 wxTO_STRING_IMP( wxColour
)
44 wxFROM_STRING_IMP( wxColour
)
46 IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour
, wxObject
, "wx/colour.h" , &wxTO_STRING( wxColour
) , &wxFROM_STRING( wxColour
))
48 wxBEGIN_PROPERTIES_TABLE(wxColour
)
49 wxREADONLY_PROPERTY( Red
, unsigned char, Red
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
50 wxREADONLY_PROPERTY( Green
, unsigned char, Green
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
51 wxREADONLY_PROPERTY( Blue
, unsigned char, Blue
, EMPTY_MACROVALUE
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
52 wxEND_PROPERTIES_TABLE()
54 wxCONSTRUCTOR_3( wxColour
, unsigned char, Red
, unsigned char, Green
, unsigned char, Blue
)
56 wxBEGIN_HANDLERS_TABLE(wxColour
)
57 wxEND_HANDLERS_TABLE()
59 IMPLEMENT_DYNAMIC_CLASS(wxColour
, wxObject
)
77 void wxColour::InitWith(unsigned char r
, unsigned char g
, unsigned char b
)
83 m_pixel
= PALETTERGB(m_red
, m_green
, m_blue
);