Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to get system colours for use in text views

To get system colours for use in text views, use the MFormParam::SystemColor() function.

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;
 }