Symbian3/SDK/Source/GUID-23E18D4B-FB09-5BA9-9D31-E4875A0F8955.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
--- /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 @@
+<?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>
\ No newline at end of file