]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
f75aecd0 | 2 | // Name: wx/msw/colour.h |
2bda0e17 KB |
3 | // Purpose: wxColour class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
bbcdf8bc | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
2bda0e17 KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
bbcdf8bc JS |
11 | #ifndef _WX_COLOUR_H_ |
12 | #define _WX_COLOUR_H_ | |
2bda0e17 | 13 | |
2d996ed1 | 14 | #include "wx/object.h" |
2bda0e17 | 15 | |
f75aecd0 | 16 | // ---------------------------------------------------------------------------- |
2bda0e17 | 17 | // Colour |
f75aecd0 VZ |
18 | // ---------------------------------------------------------------------------- |
19 | ||
53a2db12 | 20 | class WXDLLIMPEXP_CORE wxColour : public wxColourBase |
2bda0e17 | 21 | { |
2bda0e17 | 22 | public: |
f75aecd0 VZ |
23 | // constructors |
24 | // ------------ | |
40989e46 | 25 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
f75aecd0 | 26 | |
f75aecd0 VZ |
27 | // accessors |
28 | // --------- | |
29 | ||
8f884a0d | 30 | virtual bool IsOk() const { return m_isInit; } |
f75aecd0 VZ |
31 | |
32 | unsigned char Red() const { return m_red; } | |
33 | unsigned char Green() const { return m_green; } | |
34 | unsigned char Blue() const { return m_blue; } | |
c2b9ae5f | 35 | unsigned char Alpha() const { return m_alpha ; } |
f75aecd0 VZ |
36 | |
37 | // comparison | |
38 | bool operator==(const wxColour& colour) const | |
39 | { | |
aad6765c JS |
40 | return m_isInit == colour.m_isInit |
41 | && m_red == colour.m_red | |
42 | && m_green == colour.m_green | |
c2b9ae5f SC |
43 | && m_blue == colour.m_blue |
44 | && m_alpha == colour.m_alpha; | |
f75aecd0 VZ |
45 | } |
46 | ||
9ef6890f | 47 | bool operator!=(const wxColour& colour) const { return !(*this == colour); } |
f75aecd0 | 48 | |
47b378bd | 49 | WXCOLORREF GetPixel() const { return m_pixel; } |
2bda0e17 | 50 | |
8f177c8e | 51 | public: |
f75aecd0 | 52 | WXCOLORREF m_pixel; |
8f177c8e | 53 | |
aad6765c JS |
54 | protected: |
55 | // Helper function | |
56 | void Init(); | |
57 | ||
aea95b1c VZ |
58 | virtual void |
59 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
40989e46 | 60 | |
68dda785 | 61 | private: |
f75aecd0 VZ |
62 | bool m_isInit; |
63 | unsigned char m_red; | |
64 | unsigned char m_blue; | |
65 | unsigned char m_green; | |
c2b9ae5f | 66 | unsigned char m_alpha; |
68dda785 | 67 | |
68dda785 | 68 | private: |
f75aecd0 | 69 | DECLARE_DYNAMIC_CLASS(wxColour) |
2bda0e17 KB |
70 | }; |
71 | ||
9ef6890f | 72 | #endif // _WX_COLOUR_H_ |