m_color.green = 0;
m_color.blue = 0;
m_color.pixel = 0;
- m_colormap = (GdkColormap *) NULL;
+ m_colormap = NULL;
m_hasPixel = false;
}
// GDK's values are in 0..65535 range, our are in 0..255
#define SHIFT 8
-IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
-
wxColour::~wxColour()
{
}
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0;
- M_COLDATA->m_colormap = (GdkColormap*) NULL;
+ M_COLDATA->m_colormap = NULL;
M_COLDATA->m_hasPixel = false;
}
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
void wxColour::CalcPixel( GdkColormap *cmap )
{
- if (!Ok()) return;
+ if (!IsOk()) return;
M_COLDATA->AllocColour( cmap );
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), (GdkColor *) NULL, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") );
return &M_COLDATA->m_color;
}