]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/colour.h
removed wxSTRING_TEXT() macro in favour of wxS()
[wxWidgets.git] / include / wx / generic / colour.h
CommitLineData
32b8ec41 1/////////////////////////////////////////////////////////////////////////////
3da12c22 2// Name: wx/generic/colour.h
32b8ec41
VZ
3// Purpose: wxColour class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
32b8ec41
VZ
10/////////////////////////////////////////////////////////////////////////////
11
3da12c22
VS
12#ifndef _WX_GENERIC_COLOUR_H_
13#define _WX_GENERIC_COLOUR_H_
32b8ec41 14
32b8ec41
VZ
15#include "wx/object.h"
16
17// Colour
40989e46 18class WXDLLEXPORT wxColour: public wxColourBase
32b8ec41
VZ
19{
20public:
edc536d3
WS
21 // constructors
22 // ------------
40989e46 23 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
32b8ec41 24
edc536d3 25 // copy ctors and assignment operators
32b8ec41 26 wxColour(const wxColour& col);
7f5426f0 27 wxColour& operator=(const wxColour& col);
32b8ec41 28
edc536d3 29 // dtor
d3c7fc99 30 virtual ~wxColour();
32b8ec41 31
32b8ec41 32 // accessors
8f884a0d 33 virtual bool IsOk() const { return m_isInit; }
32b8ec41 34
32b8ec41
VZ
35 unsigned char Red() const { return m_red; }
36 unsigned char Green() const { return m_green; }
37 unsigned char Blue() const { return m_blue; }
7f5426f0 38 unsigned char Alpha() const { return m_alpha; }
32b8ec41
VZ
39
40 // comparison
7f5426f0 41 bool operator==(const wxColour& colour) const
32b8ec41 42 {
edc536d3
WS
43 return (m_red == colour.m_red &&
44 m_green == colour.m_green &&
45 m_blue == colour.m_blue &&
7f5426f0 46 m_alpha == colour.m_alpha &&
edc536d3 47 m_isInit == colour.m_isInit);
32b8ec41 48 }
32b8ec41 49
7f5426f0 50 bool operator!=(const wxColour& colour) const { return !(*this == colour); }
aad6765c
JS
51
52protected:
53
54 // Helper function
55 void Init();
56
aea95b1c
VZ
57 virtual void
58 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
40989e46 59
32b8ec41
VZ
60private:
61 bool m_isInit;
62 unsigned char m_red;
63 unsigned char m_blue;
64 unsigned char m_green;
7f5426f0 65 unsigned char m_alpha;
32b8ec41 66
32b8ec41
VZ
67private:
68 DECLARE_DYNAMIC_CLASS(wxColour)
69};
70
3da12c22 71#endif // _WX_GENERIC_COLOUR_H_