equal
deleted
inserted
replaced
|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <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 |
|
13 { |
|
14 // handle default indices |
|
15 if (aColorIndex == TLogicalRgb::ESystemForegroundIndex) |
|
16 return iColorList->Color(EColorWindowText); |
|
17 else if (aColorIndex == TLogicalRgb::ESystemBackgroundIndex) |
|
18 return iColorList->Color(EColorWindowBackground); |
|
19 // handle indices defined by gulcolor.h |
|
20 aColorIndex--; |
|
21 if (aColorIndex >= 0 && aColorIndex <= EColorLabelHighlightFullEmphasis) |
|
22 return iColorList->Color(aColorIndex - 1) |
|
23 else |
|
24 return aDefaultColor; |
|
25 }</codeblock> </conbody></concept> |