]>
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 | ||
aad6765c | 39 | bool Ok() 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; } | |
44 | ||
45 | // comparison | |
46 | bool operator==(const wxColour& colour) const | |
47 | { | |
aad6765c JS |
48 | return m_isInit == colour.m_isInit |
49 | && m_red == colour.m_red | |
50 | && m_green == colour.m_green | |
51 | && m_blue == colour.m_blue; | |
f75aecd0 VZ |
52 | } |
53 | ||
54 | bool operator != (const wxColour& colour) const { return !(*this == colour); } | |
55 | ||
56 | WXCOLORREF GetPixel() const { return m_pixel; }; | |
2bda0e17 | 57 | |
aad6765c | 58 | |
8f177c8e | 59 | public: |
f75aecd0 | 60 | WXCOLORREF m_pixel; |
8f177c8e | 61 | |
aad6765c JS |
62 | protected: |
63 | // Helper function | |
64 | void Init(); | |
65 | ||
40989e46 WS |
66 | virtual void InitWith(unsigned char red, unsigned char green, unsigned char blue); |
67 | ||
68dda785 | 68 | private: |
f75aecd0 VZ |
69 | bool m_isInit; |
70 | unsigned char m_red; | |
71 | unsigned char m_blue; | |
72 | unsigned char m_green; | |
68dda785 | 73 | |
68dda785 | 74 | private: |
f75aecd0 | 75 | DECLARE_DYNAMIC_CLASS(wxColour) |
2bda0e17 KB |
76 | }; |
77 | ||
2bda0e17 | 78 | #endif |
8f177c8e | 79 | // _WX_COLOUR_H_ |