Applied patch [ 828303 ] Slight wxColour cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-12-11 10:10:40 +00:00
parent 12ac619f42
commit aad6765cbd
23 changed files with 303 additions and 260 deletions

View File

@@ -25,11 +25,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
// Colour
wxColour::wxColour ()
void wxColour::Init()
{
m_bIsInit = FALSE;
m_bIsInit = false;
m_vPixel = 0;
m_cRed = m_cBlue = m_cGreen = 0;
} // end of wxColour::Init
wxColour::wxColour ()
{
Init();
} // end of wxColour::wxColour
wxColour::wxColour (
@@ -38,22 +43,14 @@ wxColour::wxColour (
, unsigned char cBlue
)
{
m_cRed = cRed;
m_cGreen = cGreen;
m_cBlue = cBlue;
m_bIsInit = TRUE;
m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
Set(cRed, cGreen, cBlue);
} // end of wxColour::wxColour
wxColour::wxColour (
wxColour::wxColour(
const wxColour& rCol
)
{
m_cRed = rCol.m_cRed;
m_cGreen = rCol.m_cGreen;
m_cBlue = rCol.m_cBlue;
m_bIsInit = rCol.m_bIsInit;
m_vPixel = rCol.m_vPixel;
*this = col;
} // end of wxColour::wxColour
wxColour& wxColour::operator =(
@@ -72,30 +69,26 @@ void wxColour::InitFromName(
const wxString& sCol
)
{
wxColour* pTheColour = wxTheColourDatabase->FindColour(sCol);
if ( wxTheColourDatabase )
{
wxColour col = wxTheColourDatabase->Find(sCol);
if ( col.Ok() )
{
*this = col;
return;
}
}
// leave invalid
Init();
if (pTheColour)
{
m_cRed = pTheColour->Red();
m_cGreen = pTheColour->Green();
m_cBlue = pTheColour->Blue();
m_bIsInit = TRUE;
}
else
{
m_cRed = 0;
m_cGreen = 0;
m_cBlue = 0;
m_bIsInit = FALSE;
}
m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
} // end of wxColour::InitFromName
wxColour::~wxColour ()
wxColour::~wxColour()
{
} // end of wxColour::~wxColour
void wxColour::Set (
void wxColour::Set(
unsigned char cRed
, unsigned char cGreen
, unsigned char cBlue
@@ -104,6 +97,6 @@ void wxColour::Set (
m_cRed = cRed;
m_cGreen = cGreen;
m_cBlue = cBlue;
m_bIsInit = TRUE;
m_bIsInit = true;
m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
} // end of wxColour::Set