]>
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 | |
40989e46 | 18 | class WXDLLEXPORT wxColour: public wxColourBase |
0e320a79 DW |
19 | { |
20 | public: | |
edc536d3 WS |
21 | // constructors |
22 | // ------------ | |
a0606634 | 23 | |
edc536d3 | 24 | // default |
6b5d2431 | 25 | wxColour(); |
40989e46 | 26 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
a0606634 | 27 | |
a0606634 | 28 | // Copy ctors and assignment operators |
a0606634 DW |
29 | wxColour(const wxColour& rCol); |
30 | wxColour(const wxColour* pCol); | |
31 | wxColour&operator = (const wxColour& rCol); | |
32 | ||
a0606634 | 33 | // Dtor |
d3c7fc99 | 34 | virtual ~wxColour(); |
a0606634 | 35 | |
a0606634 DW |
36 | // Accessors |
37 | bool Ok(void) const {return m_bIsInit; } | |
38 | ||
a0606634 DW |
39 | unsigned char Red(void) const { return m_cRed; } |
40 | unsigned char Green(void) const { return m_cGreen; } | |
41 | unsigned char Blue(void) const { return m_cBlue; } | |
0e320a79 | 42 | |
a0606634 | 43 | // Comparison |
a0606634 DW |
44 | bool operator == (const wxColour& rColour) const |
45 | { | |
edb8604f | 46 | return (m_bIsInit == rColour.m_bIsInit |
aad6765c JS |
47 | && m_cRed == rColour.m_cRed |
48 | && m_cGreen == rColour.m_cGreen | |
49 | && m_cBlue == rColour.m_cBlue | |
a0606634 DW |
50 | ); |
51 | } | |
aad6765c | 52 | |
a0606634 | 53 | bool operator != (const wxColour& rColour) const { return !(*this == rColour); } |
0e320a79 | 54 | |
a0606634 | 55 | WXCOLORREF GetPixel(void) const { return m_vPixel; }; |
0e320a79 | 56 | |
aad6765c | 57 | |
0e320a79 | 58 | private: |
aad6765c JS |
59 | |
60 | // Helper function | |
61 | void Init(); | |
62 | ||
40989e46 WS |
63 | bool m_bIsInit; |
64 | unsigned char m_cRed; | |
65 | unsigned char m_cBlue; | |
66 | unsigned char m_cGreen; | |
67 | ||
68 | virtual void InitWith( unsigned char cRed, unsigned char cGreen, unsigned char cBlue); | |
0e320a79 DW |
69 | |
70 | public: | |
a0606634 | 71 | WXCOLORREF m_vPixel ; |
0e320a79 | 72 | private: |
edc536d3 | 73 | DECLARE_DYNAMIC_CLASS(wxColour) |
a0606634 | 74 | }; // end of class wxColour |
0e320a79 DW |
75 | |
76 | #endif | |
77 | // _WX_COLOUR_H_ |