/////////////////////////////////////////////////////////////////////////////
-// Name: colour.cpp
+// Name: src/mgl/colour.cpp
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "colour.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
m_red =
m_blue =
m_green = 0;
- m_isInit = FALSE;
+ m_isInit = false;
+}
+
+wxColour::wxColour()
+{
+ Init();
}
wxColour::wxColour(const wxColour& col)
void wxColour::InitFromName(const wxString& name)
{
- wxColour *col = wxTheColourDatabase->Find(name);
- if ( col.Ok() )
- {
- *this = col;
- }
- else
+ if ( wxTheColourDatabase )
{
- Init();
+ wxColour col = wxTheColourDatabase->Find(name);
+ if ( col.Ok() )
+ {
+ *this = col;
+ return;
+ }
}
+
+ // leave invalid
+ Init();
}
wxColour::~wxColour()
m_red = r;
m_green = g;
m_blue = b;
- m_isInit = TRUE;
+ m_isInit = true;
}