1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-10-18 19:20:13 -04:00
|
|
|
// Name: wx/msw/colour.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// Purpose: wxColour class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_COLOUR_H_
|
|
|
|
#define _WX_COLOUR_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-09-14 16:57:06 -04:00
|
|
|
#include "wx/object.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2003-10-18 19:20:13 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
// Colour
|
2003-10-18 19:20:13 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
class WXDLLEXPORT wxColour : public wxColourBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-10-18 19:20:13 -04:00
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
|
1998-10-20 10:35:22 -04:00
|
|
|
// default
|
2003-10-18 19:20:13 -04:00
|
|
|
wxColour() { Init(); }
|
2006-04-24 10:52:23 -04:00
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
2003-10-18 19:20:13 -04:00
|
|
|
|
1998-10-20 10:35:22 -04:00
|
|
|
|
|
|
|
// dtor
|
2003-10-18 19:20:13 -04:00
|
|
|
~wxColour();
|
|
|
|
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
// ---------
|
|
|
|
|
2003-12-11 05:10:40 -05:00
|
|
|
bool Ok() const { return m_isInit; }
|
2003-10-18 19:20:13 -04:00
|
|
|
|
|
|
|
unsigned char Red() const { return m_red; }
|
|
|
|
unsigned char Green() const { return m_green; }
|
|
|
|
unsigned char Blue() const { return m_blue; }
|
|
|
|
|
|
|
|
// comparison
|
|
|
|
bool operator==(const wxColour& colour) const
|
|
|
|
{
|
2003-12-11 05:10:40 -05:00
|
|
|
return m_isInit == colour.m_isInit
|
|
|
|
&& m_red == colour.m_red
|
|
|
|
&& m_green == colour.m_green
|
|
|
|
&& m_blue == colour.m_blue;
|
2003-10-18 19:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
|
|
|
|
|
|
|
WXCOLORREF GetPixel() const { return m_pixel; };
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2003-12-11 05:10:40 -05:00
|
|
|
|
1999-12-16 16:29:54 -05:00
|
|
|
public:
|
2003-10-18 19:20:13 -04:00
|
|
|
WXCOLORREF m_pixel;
|
1999-12-16 16:29:54 -05:00
|
|
|
|
2003-12-11 05:10:40 -05:00
|
|
|
protected:
|
|
|
|
// Helper function
|
|
|
|
void Init();
|
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
virtual void InitWith(unsigned char red, unsigned char green, unsigned char blue);
|
|
|
|
|
1998-10-19 10:18:56 -04:00
|
|
|
private:
|
2003-10-18 19:20:13 -04:00
|
|
|
bool m_isInit;
|
|
|
|
unsigned char m_red;
|
|
|
|
unsigned char m_blue;
|
|
|
|
unsigned char m_green;
|
1998-10-19 10:18:56 -04:00
|
|
|
|
|
|
|
private:
|
2003-10-18 19:20:13 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1999-12-16 16:29:54 -05:00
|
|
|
// _WX_COLOUR_H_
|