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