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
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxColour();
|
2003-10-18 19:20:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
// 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; }
|
2006-09-30 09:29:45 -04:00
|
|
|
unsigned char Alpha() const { return m_alpha ; }
|
2003-10-18 19:20:13 -04:00
|
|
|
|
|
|
|
// 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
|
2006-09-30 09:29:45 -04:00
|
|
|
&& m_blue == colour.m_blue
|
|
|
|
&& m_alpha == colour.m_alpha;
|
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-09-09 22:00:24 -04:00
|
|
|
virtual void
|
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
2006-04-24 10:52:23 -04:00
|
|
|
|
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;
|
2006-09-30 09:29:45 -04:00
|
|
|
unsigned char m_alpha;
|
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_
|