]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/colour.h
Don't create multiple parent-less top level frames in layout sample.
[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
53a2db12 21class WXDLLIMPEXP_CORE wxColour : public wxColourBase
2bda0e17 22{
2bda0e17 23public:
f75aecd0
VZ
24 // constructors
25 // ------------
40989e46 26 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
f75aecd0 27
f75aecd0
VZ
28 // accessors
29 // ---------
30
8f884a0d 31 virtual bool IsOk() const { return m_isInit; }
f75aecd0
VZ
32
33 unsigned char Red() const { return m_red; }
34 unsigned char Green() const { return m_green; }
35 unsigned char Blue() const { return m_blue; }
c2b9ae5f 36 unsigned char Alpha() const { return m_alpha ; }
f75aecd0
VZ
37
38 // comparison
39 bool operator==(const wxColour& colour) const
40 {
aad6765c
JS
41 return m_isInit == colour.m_isInit
42 && m_red == colour.m_red
43 && m_green == colour.m_green
c2b9ae5f
SC
44 && m_blue == colour.m_blue
45 && m_alpha == colour.m_alpha;
f75aecd0
VZ
46 }
47
9ef6890f 48 bool operator!=(const wxColour& colour) const { return !(*this == colour); }
f75aecd0 49
47b378bd 50 WXCOLORREF GetPixel() const { return m_pixel; }
2bda0e17 51
8f177c8e 52public:
f75aecd0 53 WXCOLORREF m_pixel;
8f177c8e 54
aad6765c
JS
55protected:
56 // Helper function
57 void Init();
58
aea95b1c
VZ
59 virtual void
60 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
40989e46 61
68dda785 62private:
f75aecd0
VZ
63 bool m_isInit;
64 unsigned char m_red;
65 unsigned char m_blue;
66 unsigned char m_green;
c2b9ae5f 67 unsigned char m_alpha;
68dda785 68
68dda785 69private:
f75aecd0 70 DECLARE_DYNAMIC_CLASS(wxColour)
2bda0e17
KB
71};
72
9ef6890f 73#endif // _WX_COLOUR_H_