]>
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 VZ |
39 | bool Ok() const { return IsOk(); } |
40 | bool IsOk() const { return m_isInit; } | |
f75aecd0 VZ |
41 | |
42 | unsigned char Red() const { return m_red; } | |
43 | unsigned char Green() const { return m_green; } | |
44 | unsigned char Blue() const { return m_blue; } | |
c2b9ae5f | 45 | unsigned char Alpha() const { return m_alpha ; } |
f75aecd0 VZ |
46 | |
47 | // comparison | |
48 | bool operator==(const wxColour& colour) const | |
49 | { | |
aad6765c JS |
50 | return m_isInit == colour.m_isInit |
51 | && m_red == colour.m_red | |
52 | && m_green == colour.m_green | |
c2b9ae5f SC |
53 | && m_blue == colour.m_blue |
54 | && m_alpha == colour.m_alpha; | |
f75aecd0 VZ |
55 | } |
56 | ||
57 | bool operator != (const wxColour& colour) const { return !(*this == colour); } | |
58 | ||
59 | WXCOLORREF GetPixel() const { return m_pixel; }; | |
2bda0e17 | 60 | |
aad6765c | 61 | |
8f177c8e | 62 | public: |
f75aecd0 | 63 | WXCOLORREF m_pixel; |
8f177c8e | 64 | |
aad6765c JS |
65 | protected: |
66 | // Helper function | |
67 | void Init(); | |
68 | ||
aea95b1c VZ |
69 | virtual void |
70 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
40989e46 | 71 | |
68dda785 | 72 | private: |
f75aecd0 VZ |
73 | bool m_isInit; |
74 | unsigned char m_red; | |
75 | unsigned char m_blue; | |
76 | unsigned char m_green; | |
c2b9ae5f | 77 | unsigned char m_alpha; |
68dda785 | 78 | |
68dda785 | 79 | private: |
f75aecd0 | 80 | DECLARE_DYNAMIC_CLASS(wxColour) |
2bda0e17 KB |
81 | }; |
82 | ||
2bda0e17 | 83 | #endif |
8f177c8e | 84 | // _WX_COLOUR_H_ |