]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/colour.h
Use wxGetTranslation() instead of _() in the public headers.
[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
32b8ec41 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
32b8ec41
VZ
9/////////////////////////////////////////////////////////////////////////////
10
3da12c22
VS
11#ifndef _WX_GENERIC_COLOUR_H_
12#define _WX_GENERIC_COLOUR_H_
32b8ec41 13
32b8ec41
VZ
14#include "wx/object.h"
15
16// Colour
53a2db12 17class WXDLLIMPEXP_CORE wxColour: public wxColourBase
32b8ec41
VZ
18{
19public:
edc536d3
WS
20 // constructors
21 // ------------
40989e46 22 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
32b8ec41 23
edc536d3 24 // copy ctors and assignment operators
001828ed
VZ
25 wxColour(const wxColour& col)
26 {
27 *this = col;
28 }
32b8ec41 29
001828ed 30 wxColour& operator=(const wxColour& col);
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_