Symbian3/PDK/Source/GUID-23E18D4B-FB09-5BA9-9D31-E4875A0F8955.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Fri, 22 Jan 2010 18:26:19 +0000
changeset 1 25a17d01db0c
child 3 46218c8b8afa
permissions -rw-r--r--
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-23E18D4B-FB09-5BA9-9D31-E4875A0F8955"><title>How to get system colours for use in text views</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>To get system colours for use in text views, use the <xref href="GUID-D62C2BEF-6614-39F8-827A-4014534F8364.dita#GUID-D62C2BEF-6614-39F8-827A-4014534F8364/GUID-868366FB-4FA0-3783-9D68-D091ABB58850"><apiname>MFormParam::SystemColor()</apiname></xref> function.</p> <p>This example implementation of <codeph>SystemColor()</codeph> uses the <xref href="GUID-3919B5BF-E028-3496-8DDD-4D4927B10AF9.dita"><apiname>TLogicalColor</apiname></xref> indices (defined in gulcolor.h), and assumes a <codeph>CColorList* iColor</codeph> member.</p> <codeblock id="GUID-DCD6077A-2674-5647-8914-C0D54B497B50" xml:space="preserve">TRgb CMyFormParam::SystemColor(TUint aColorIndex,TRgb aDefaultColor) const
 {
 // handle default indices
 if (aColorIndex == TLogicalRgb::ESystemForegroundIndex)
  return iColorList-&gt;Color(EColorWindowText);
 else if (aColorIndex == TLogicalRgb::ESystemBackgroundIndex)
  return iColorList-&gt;Color(EColorWindowBackground);
 // handle indices defined by gulcolor.h
 aColorIndex--;
 if (aColorIndex &gt;= 0 &amp;&amp; aColorIndex &lt;= EColorLabelHighlightFullEmphasis)
  return iColorList-&gt;Color(aColorIndex - 1)
 else
  return aDefaultColor;
 }</codeblock> </conbody></concept>