Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Using MFormParam


SystemColor()

This example implementation of SystemColor() uses the TLogicalColor indices (defined in gulcolor.h), and assumes a CColorList* iColor member.

TRgb CMyFormParam::SystemColor(TUint aColorIndex,TRgb aDefaultColor) const
 {
 // handle default indices
 if (aColorIndex == TLogicalRgb::ESystemForegroundIndex)
  return iColorList->Color(EColorWindowText);
 else if (aColorIndex == TLogicalRgb::ESystemBackgroundIndex)
  return iColorList->Color(EColorWindowBackground);
 // handle indices defined by gulcolor.h
 aColorIndex--;
 if (aColorIndex >= 0 && aColorIndex <= EColorLabelHighlightFullEmphasis)
  return iColorList->Color(aColorIndex - 1)
 else
  return aDefaultColor;
 }