Symbian3/SDK/Source/GUID-5B26AB8E-E20A-4C15-B4F8-812ED9A4A96C.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 id="GUID-5B26AB8E-E20A-4C15-B4F8-812ED9A4A96C" xml:lang="en"><title>Defining
resources for your own CBA buttons</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>To define <xref href="GUID-0F8D0399-58CD-4EB6-82DF-75D6BE5B0A84.dita#GUID-0F8D0399-58CD-4EB6-82DF-75D6BE5B0A84/GUID-5F749184-C804-41FC-BA81-038783BDC967">resources</xref> for
your own <xref href="GUID-A4F3738C-CBFD-4151-9132-26FE05966715.dita">CBA buttons</xref>:</p>
<ol>
<li id="GUID-72E2159F-9644-4B0A-B534-3988B618AF47"><p>Determine
the CBA button requirements of your application.</p></li>
<li id="GUID-D112D0E5-3DE3-46F2-91CC-073B71F368B9"><p>Declare <parmname>cba
= r_name21</parmname> in the <xref href="GUID-23A60DE7-B72D-41BD-9F1E-882D31A7E3C7.dita"><parmname>EIK_APP_INFO</parmname></xref> or <xref href="GUID-B238952B-1691-49F4-B8B9-9F755011A7DD.dita"><parmname>AVKON_VIEW</parmname></xref> statements,
where <parmname>r_name21</parmname> is a unique identifier in the application.</p>
</li>
<li id="GUID-6D0D8115-9645-4CC7-8384-7226BCF72017"><p>Create a <parmname>RESOURCE</parmname> statement
for the CBA buttons. For the declaration in step 2, the syntax is as follows:</p>
<codeblock id="GUID-8DE70A48-585D-46CB-AA5A-0A7CF3DCD3AC" xml:space="preserve">RESOURCE CBA r_name21
	{
	flags = enumerated value in eikon.hrh;
	buttons =
		{
		CBA_BUTTON
			{
			id = enumerated command either from Symbian platform or from application;
			txt = STRING_button_name1;
			bmpfile = file name;
			bmpid = ID of bitmap in file;
			bmpmask = ID of bitmap mask in file;
			},
		};
	}
			</codeblock>
<p>where:</p>
<ul>
<li><p><parmname>flags</parmname> indicates how the button group
should be handled by the Symbian platform. The default value is <parmname>EEikButtonGroupAddToStack</parmname>,
which indicates the button group should be added to the stack. </p><p>For
more information on the stack, see <xref href="GUID-A9330FEF-C559-4E2B-B064-0151FDADEA8C.dita">Event
handling</xref> </p>
<p>While the value used here is determined by the requirements of your
application, typically the default value is valid for most applications.</p>
</li>
<li><p><parmname>buttons</parmname> is the name of an array that
holds the individual buttons that the group is composed of. The array can
contain the <parmname>CBA_BUTTON</parmname> structures.</p></li>
</ul>
<p>The <parmname>CBA_BUTTON</parmname> structure has the following syntax: </p>
<ul>
<li><p><parmname>id</parmname> is an enumerated value for the command
that is associated with the button. The value used can be provided either
by the <xref href="GUID-CBB00F6A-CBA7-4872-B0A1-A86A863725F5.dita">underlying Symbian
platform</xref> or by <xref href="GUID-D52E98C3-F5EE-4CE1-A4F5-2EF41A066B8A.dita">your
application</xref>. </p>
<itemgroup>
<p> For more information on command handling, see <xref href="GUID-A9330FEF-C559-4E2B-B064-0151FDADEA8C.dita">Event
handling</xref>.</p>
</itemgroup>
</li>
<li><p><parmname>txt</parmname> is a string that defines the name
of the button present</p></li>
<li><p><parmname>bmpfile</parmname>, <parmname>bmpid</parmname>,
and <parmname>bmpmask</parmname> are used for defining an icon for the button. </p>
</li>
</ul>
</li>
</ol>
</conbody></concept>