]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/os2/colour.h | |
3 | // Purpose: wxColour class | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/13/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_COLOUR_H_ | |
13 | #define _WX_COLOUR_H_ | |
14 | ||
15 | #include "wx/object.h" | |
16 | ||
17 | // Colour | |
18 | class WXDLLEXPORT wxColour: public wxColourBase | |
19 | { | |
20 | public: | |
21 | // constructors | |
22 | // ------------ | |
23 | ||
24 | // default | |
25 | wxColour(); | |
26 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS | |
27 | ||
28 | // Copy ctors and assignment operators | |
29 | wxColour(const wxColour& rCol); | |
30 | wxColour(const wxColour* pCol); | |
31 | wxColour&operator = (const wxColour& rCol); | |
32 | ||
33 | // Dtor | |
34 | ~wxColour(); | |
35 | ||
36 | // Accessors | |
37 | bool Ok(void) const {return m_bIsInit; } | |
38 | ||
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; } | |
42 | ||
43 | // Comparison | |
44 | bool operator == (const wxColour& rColour) const | |
45 | { | |
46 | return (m_bIsInit == rColour.m_bIsInit | |
47 | && m_cRed == rColour.m_cRed | |
48 | && m_cGreen == rColour.m_cGreen | |
49 | && m_cBlue == rColour.m_cBlue | |
50 | ); | |
51 | } | |
52 | ||
53 | bool operator != (const wxColour& rColour) const { return !(*this == rColour); } | |
54 | ||
55 | WXCOLORREF GetPixel(void) const { return m_vPixel; }; | |
56 | ||
57 | ||
58 | private: | |
59 | ||
60 | // Helper function | |
61 | void Init(); | |
62 | ||
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); | |
69 | ||
70 | public: | |
71 | WXCOLORREF m_vPixel ; | |
72 | private: | |
73 | DECLARE_DYNAMIC_CLASS(wxColour) | |
74 | }; // end of class wxColour | |
75 | ||
76 | #endif | |
77 | // _WX_COLOUR_H_ |