diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-23E18D4B-FB09-5BA9-9D31-E4875A0F8955.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-23E18D4B-FB09-5BA9-9D31-E4875A0F8955.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,25 @@ + + + + + +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; + }
\ No newline at end of file