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 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.