]>
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 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_COLOUR_H_ |
13 | #define _WX_COLOUR_H_ | |
2bda0e17 | 14 | |
2d996ed1 | 15 | #include "wx/object.h" |
2bda0e17 | 16 | |
f75aecd0 | 17 | // ---------------------------------------------------------------------------- |
2bda0e17 | 18 | // Colour |
f75aecd0 VZ |
19 | // ---------------------------------------------------------------------------- |
20 | ||
40989e46 | 21 | class WXDLLEXPORT wxColour : public wxColourBase |
2bda0e17 | 22 | { |
2bda0e17 | 23 | public: |
f75aecd0 VZ |
24 | // constructors |
25 | // ------------ | |
26 | ||
e4a81a2e | 27 | // default |
f75aecd0 | 28 | wxColour() { Init(); } |
40989e46 | 29 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
f75aecd0 | 30 | |
e4a81a2e | 31 | |
e4a81a2e | 32 | // dtor |
d3c7fc99 | 33 | virtual ~wxColour(); |
f75aecd0 VZ |
34 | |
35 | ||
f75aecd0 VZ |
36 | // accessors |
37 | // --------- | |
38 | ||
b7cacb43 | 39 | bool IsOk() const { return m_isInit; } |
f75aecd0 VZ |
40 | |
41 | unsigned char Red() const { return m_red; } | |
42 | unsigned char Green() const { return m_green; } | |
43 | unsigned char Blue() const { return m_blue; } | |
c2b9ae5f | 44 | unsigned char Alpha() const { return m_alpha ; } |
f75aecd0 VZ |
45 | |
46 | // comparison | |
47 | bool operator==(const wxColour& colour) const | |
48 | { | |
aad6765c JS |
49 | return m_isInit == colour.m_isInit |
50 | && m_red == colour.m_red | |
51 | && m_green == colour.m_green | |
c2b9ae5f SC |
52 | && m_blue == colour.m_blue |
53 | && m_alpha == colour.m_alpha; | |
f75aecd0 VZ |
54 | } |
55 | ||
56 | bool operator != (const wxColour& colour) const { return !(*this == colour); } | |
57 | ||
47b378bd | 58 | WXCOLORREF GetPixel() const { return m_pixel; } |
2bda0e17 | 59 | |
aad6765c | 60 | |
8f177c8e | 61 | public: |
f75aecd0 | 62 | WXCOLORREF m_pixel; |
8f177c8e | 63 | |
aad6765c JS |
64 | protected: |
65 | // Helper function | |
66 | void Init(); | |
67 | ||
aea95b1c VZ |
68 | virtual void |
69 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
40989e46 | 70 | |
68dda785 | 71 | private: |
f75aecd0 VZ |
72 | bool m_isInit; |
73 | unsigned char m_red; | |
74 | unsigned char m_blue; | |
75 | unsigned char m_green; | |
c2b9ae5f | 76 | unsigned char m_alpha; |
68dda785 | 77 | |
68dda785 | 78 | private: |
f75aecd0 | 79 | DECLARE_DYNAMIC_CLASS(wxColour) |
2bda0e17 KB |
80 | }; |
81 | ||
2bda0e17 | 82 | #endif |
8f177c8e | 83 | // _WX_COLOUR_H_ |