Foundation > Graphic Objects > Creating a new Graphic Object Class > Updating the Palettes
 
Updating the Palettes
To make sure that both palettes are updated when modifications are applied to the original one, we need to overload the following member functions.
void
ShadowEllipse::setBackground(IlvColor* color)
{
IlvSimpleGraphic::setBackground(color);
computeInvertedPalette();
}
 
// --------------------------------------------------------------------------
void
ShadowEllipse::setForeground(IlvColor* color)
{
IlvSimpleGraphic::setForeground(color);
computeInvertedPalette();
}
 
// --------------------------------------------------------------------------
void
ShadowEllipse::setMode(IlvDrawMode mode)
{
getPalette()->setMode(mode);
_invertedPalette->setMode(mode);
}
 
// --------------------------------------------------------------------------
void
ShadowEllipse::setPalette(IlvPalette* palette)
{
IlvSimpleGraphic::setPalette(palette);
computeInvertedPalette();
}

Version 6.2.1
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.