|
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 --> <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"><concept id="GUID-1AA32C40-CDE0-4627-A634-7C07BB1ED67B" xml:lang="en"><title>Forms</title><prolog><metadata><keywords></keywords></metadata></prolog><conbody> |
|
10 <p>A form is a specific kind of selection list, where all items (fields) have |
|
11 some editable content.</p> |
|
12 <p>A form can be in the View state or in the Edit state. The item layouts |
|
13 and functionality are different in these states:</p> |
|
14 <ul> |
|
15 <li><p>In the View state, the items are not editable. The form functions and |
|
16 looks exactly like a similar selection list. Items can be selected to perform |
|
17 an application-specific function. </p></li> |
|
18 <li><p>In the Edit state, the user can edit all the fields. Forms can contain |
|
19 text fields (alphanumeric or numeric content), pop-up fields and sliders.</p><p></p></li> |
|
20 </ul> |
|
21 <p>The user can switch from the View state to the Edit state using the Edit |
|
22 command in the Options menu.In the Edit state, the contents of the form can |
|
23 be accepted using the right softkey labeled as Done. The form then returns |
|
24 to the View state.</p> |
|
25 <section><title>Using forms in C++ applications</title><p>The |
|
26 API to use for creating forms is the Form |
|
27 API. For implementation information, see Using |
|
28 the Form API.</p><p>Typically, a form will be derived from the class <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknForm.html" format="application/java-archive"><codeph>CAknForm</codeph></xref> and |
|
29 the methods <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknForm.html#b90bd30d42503d5f0464e9ff1ce3b830" format="application/java-archive"><codeph>SaveFormDataL()</codeph></xref> and <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknForm.html#6ff9f54d5d8a08da0c6f6574389b787a" format="application/java-archive"><codeph>DoNotSaveFormData()</codeph></xref> will be implemented by the developer. These are called when users |
|
30 switch from edit mode to view mode and are prompted by the form as to whether |
|
31 they wish to save their modifications.</p><p>For customization, the class <codeph>CAknForm</codeph> provides |
|
32 a single-line or double-line layout and it is possible to use icons on forms. </p><p>In |
|
33 the following example, the form is pushed on the cleanup stack before <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknForm.html#a7108b30a367ecb940f57e0dd35973bd" format="application/java-archive"><codeph>ConstructL()</codeph></xref> (a |
|
34 potentially leaving method) is called, and popped off before <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknDialog.html#2bb826c038d23806445872d768e7d151" format="application/java-archive"><codeph>ExecuteLD()</codeph></xref>. </p><codeblock xml:space="preserve">CAknExFormAdd* form = new(ELeave) CAknExFormAdd; |
|
35 CleanupStack::PushL(form); |
|
36 form->ConstructL(); |
|
37 CleanupStack::Pop(); |
|
38 form->ExecuteLD(R_AKNEXFORM_TEXT_FIELD_DIALOG); |
|
39 </codeblock></section> |
|
40 </conbody></concept> |