]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/colour.h
allow wxRB_GROUP to be changed after creation (patch 1544686)
[wxWidgets.git] / include / wx / msw / colour.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
f75aecd0 2// Name: wx/msw/colour.h
2bda0e17
KB
3// Purpose: wxColour class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_COLOUR_H_
13#define _WX_COLOUR_H_
2bda0e17 14
2d996ed1 15#include "wx/object.h"
2bda0e17 16
f75aecd0 17// ----------------------------------------------------------------------------
2bda0e17 18// Colour
f75aecd0
VZ
19// ----------------------------------------------------------------------------
20
40989e46 21class WXDLLEXPORT wxColour : public wxColourBase
2bda0e17 22{
2bda0e17 23public:
f75aecd0
VZ
24 // constructors
25 // ------------
26
e4a81a2e 27 // default
f75aecd0 28 wxColour() { Init(); }
40989e46 29 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
f75aecd0 30
e4a81a2e 31
e4a81a2e 32 // dtor
d3c7fc99 33 virtual ~wxColour();
f75aecd0
VZ
34
35
f75aecd0
VZ
36 // accessors
37 // ---------
38
aad6765c 39 bool Ok() const { return m_isInit; }
f75aecd0
VZ
40
41 unsigned char Red() const { return m_red; }
42 unsigned char Green() const { return m_green; }
43 unsigned char Blue() const { return m_blue; }
44
45 // comparison
46 bool operator==(const wxColour& colour) const
47 {
aad6765c
JS
48 return m_isInit == colour.m_isInit
49 && m_red == colour.m_red
50 && m_green == colour.m_green
51 && m_blue == colour.m_blue;
f75aecd0
VZ
52 }
53
54 bool operator != (const wxColour& colour) const { return !(*this == colour); }
55
56 WXCOLORREF GetPixel() const { return m_pixel; };
2bda0e17 57
aad6765c 58
8f177c8e 59public:
f75aecd0 60 WXCOLORREF m_pixel;
8f177c8e 61
aad6765c
JS
62protected:
63 // Helper function
64 void Init();
65
aea95b1c
VZ
66 virtual void
67 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
40989e46 68
68dda785 69private:
f75aecd0
VZ
70 bool m_isInit;
71 unsigned char m_red;
72 unsigned char m_blue;
73 unsigned char m_green;
68dda785 74
68dda785 75private:
f75aecd0 76 DECLARE_DYNAMIC_CLASS(wxColour)
2bda0e17
KB
77};
78
2bda0e17 79#endif
8f177c8e 80 // _WX_COLOUR_H_