2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-08-10 11:16:30 +00:00
|
|
|
// Name: wx/generic/colour.h
|
2001-06-26 21:05:06 +00:00
|
|
|
// Purpose: wxColour class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-10 11:16:30 +00:00
|
|
|
#ifndef _WX_GENERIC_COLOUR_H_
|
|
|
|
#define _WX_GENERIC_COLOUR_H_
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
|
|
|
// Colour
|
2006-04-24 14:52:23 +00:00
|
|
|
class WXDLLEXPORT wxColour: public wxColourBase
|
2001-06-26 21:05:06 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-10-05 16:22:44 +00:00
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
|
|
|
|
// default
|
2006-04-24 21:05:04 +00:00
|
|
|
wxColour();
|
2006-04-24 14:52:23 +00:00
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2005-10-05 16:22:44 +00:00
|
|
|
// copy ctors and assignment operators
|
2001-06-26 21:05:06 +00:00
|
|
|
wxColour(const wxColour& col);
|
|
|
|
wxColour& operator = (const wxColour& col);
|
|
|
|
|
2005-10-05 16:22:44 +00:00
|
|
|
// dtor
|
2001-06-26 21:05:06 +00:00
|
|
|
~wxColour();
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
bool Ok() const { return m_isInit; }
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2005-10-05 16:22:44 +00:00
|
|
|
return (m_red == colour.m_red &&
|
|
|
|
m_green == colour.m_green &&
|
|
|
|
m_blue == colour.m_blue &&
|
|
|
|
m_isInit == colour.m_isInit);
|
2001-06-26 21:05:06 +00:00
|
|
|
}
|
|
|
|
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
|
|
|
|
2003-12-11 10:10:40 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Helper function
|
|
|
|
void Init();
|
|
|
|
|
2006-04-24 14:52:23 +00:00
|
|
|
virtual void InitWith(unsigned char red, unsigned char green, unsigned char blue);
|
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
private:
|
|
|
|
bool m_isInit;
|
|
|
|
unsigned char m_red;
|
|
|
|
unsigned char m_blue;
|
|
|
|
unsigned char m_green;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
|
|
|
};
|
|
|
|
|
2006-08-10 11:16:30 +00:00
|
|
|
#endif // _WX_GENERIC_COLOUR_H_
|