]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
edc536d3 | 2 | // Name: wx/os2/colour.h |
0e320a79 | 3 | // Purpose: wxColour class |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_COLOUR_H_ | |
13 | #define _WX_COLOUR_H_ | |
14 | ||
0e320a79 | 15 | #include "wx/object.h" |
0e320a79 DW |
16 | |
17 | // Colour | |
53a2db12 | 18 | class WXDLLIMPEXP_CORE wxColour: public wxColourBase |
0e320a79 DW |
19 | { |
20 | public: | |
edc536d3 WS |
21 | // constructors |
22 | // ------------ | |
40989e46 | 23 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
a0606634 | 24 | |
a0606634 | 25 | // Copy ctors and assignment operators |
a0606634 DW |
26 | wxColour(const wxColour& rCol); |
27 | wxColour(const wxColour* pCol); | |
28 | wxColour&operator = (const wxColour& rCol); | |
29 | ||
a0606634 | 30 | // Dtor |
d3c7fc99 | 31 | virtual ~wxColour(); |
a0606634 | 32 | |
a0606634 | 33 | // Accessors |
8f884a0d | 34 | virtual bool IsOk(void) const { return m_bIsInit; } |
a0606634 | 35 | |
a0606634 DW |
36 | unsigned char Red(void) const { return m_cRed; } |
37 | unsigned char Green(void) const { return m_cGreen; } | |
38 | unsigned char Blue(void) const { return m_cBlue; } | |
0e320a79 | 39 | |
a0606634 | 40 | // Comparison |
a0606634 DW |
41 | bool operator == (const wxColour& rColour) const |
42 | { | |
edb8604f | 43 | return (m_bIsInit == rColour.m_bIsInit |
aad6765c JS |
44 | && m_cRed == rColour.m_cRed |
45 | && m_cGreen == rColour.m_cGreen | |
46 | && m_cBlue == rColour.m_cBlue | |
a0606634 DW |
47 | ); |
48 | } | |
aad6765c | 49 | |
a0606634 | 50 | bool operator != (const wxColour& rColour) const { return !(*this == rColour); } |
0e320a79 | 51 | |
a0606634 | 52 | WXCOLORREF GetPixel(void) const { return m_vPixel; }; |
0e320a79 | 53 | |
aad6765c | 54 | |
0e320a79 | 55 | private: |
aad6765c JS |
56 | |
57 | // Helper function | |
58 | void Init(); | |
59 | ||
40989e46 WS |
60 | bool m_bIsInit; |
61 | unsigned char m_cRed; | |
62 | unsigned char m_cBlue; | |
63 | unsigned char m_cGreen; | |
64 | ||
aea95b1c VZ |
65 | virtual void |
66 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
0e320a79 DW |
67 | |
68 | public: | |
a0606634 | 69 | WXCOLORREF m_vPixel ; |
0e320a79 | 70 | private: |
edc536d3 | 71 | DECLARE_DYNAMIC_CLASS(wxColour) |
a0606634 | 72 | }; // end of class wxColour |
0e320a79 DW |
73 | |
74 | #endif | |
75 | // _WX_COLOUR_H_ |