Symbian3/SDK/Source/GUID-A5756C5F-9C93-4949-8B60-03DCA1BAF683.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     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-A5756C5F-9C93-4949-8B60-03DCA1BAF683" xml:lang="en"><title>Form
       
    10 items</title><prolog><metadata><keywords></keywords></metadata></prolog><conbody>
       
    11 <p>Empty items (that contain no data) can be hidden in a form's View state.
       
    12 However, this is not a requirement; forms can be designed either way, whichever
       
    13 is better for the given application.</p>
       
    14 <p>Unlike ordinary list items, the form items may have different sizes in
       
    15 the layout but only in the Edit state. A long data field may occupy more than
       
    16 one line in the Edit state, but in the View state it is truncated to the first
       
    17 line.</p>
       
    18 <p>The user may be able to add and remove form items. This is done with commands
       
    19 in the Options menu.</p>
       
    20 <p>Form items always have a label. The label has a text part, or a text and
       
    21 a graphical part; however, all items in one form must have the same column
       
    22 layout (see <xref href="GUID-CB548959-A1D6-4585-B8E3-B09E37E0CB43.dita">List layouts</xref> for
       
    23 detailed information about layouts).</p>
       
    24 <p>The following item types can be used in a form:</p>
       
    25 <ul>
       
    26 <li><p>Text field (alphanumeric or numeric content) </p></li>
       
    27 <li><p>Pop-up field </p></li>
       
    28 <li><p>Slider</p></li>
       
    29 </ul>
       
    30 <p>Any combination of these types is possible within one form.</p>
       
    31 <p>When a form is in the Edit state, the user can move the focus up and down
       
    32 like in a list. The highlight in the Edit state is different from the highlight
       
    33 in the View state, acting as a visual cue. The cursor blinks in the text field
       
    34 that is in focus. There is no need to save each field separately; the user
       
    35 can browse and modify the fields in any order and then accept all modifications.
       
    36 During the browsing of a form in the Edit state, the keypad functions are
       
    37 as follows:</p>
       
    38 <table id="GUID-437191CE-D3E0-4CFB-875C-9C308B18F7E9"><title>Default key events
       
    39 in editing state of a form</title>
       
    40 <tgroup cols="2"><colspec colname="col1"></colspec><colspec colname="col2"></colspec>
       
    41 <thead>
       
    42 <row>
       
    43 <entry>Key</entry>
       
    44 <entry>Action</entry>
       
    45 </row>
       
    46 </thead>
       
    47 <tbody>
       
    48 <row>
       
    49 <entry><p>Arrow up / down</p></entry>
       
    50 <entry><p>Move the focus between form items (when in a text field, move the
       
    51 cursor within an item line by line).</p></entry>
       
    52 </row>
       
    53 <row>
       
    54 <entry><p>Arrow left / right</p></entry>
       
    55 <entry><ul>
       
    56 <li><p>In a pop-up field: change the value without opening the list. </p></li>
       
    57 <li><p>In a text field: move the cursor character by character. </p></li>
       
    58 <li><p>In a slider: adjust the slider value.</p></li>
       
    59 </ul></entry>
       
    60 </row>
       
    61 <row>
       
    62 <entry><p>Selection key</p></entry>
       
    63 <entry><ul>
       
    64 <li><p>In a pop-up field: opens the list. </p></li>
       
    65 <li><p>In a text field: opens the context sensitive <b>Options</b> menu or
       
    66 no action.</p></li>
       
    67 </ul></entry>
       
    68 </row>
       
    69 <row>
       
    70 <entry><p>Left softkey (Options)</p></entry>
       
    71 <entry><p>Opens the <b>Options</b> menu (in a form without the <b>Options</b> menu,
       
    72 the left softkey is <b>Done</b>).</p></entry>
       
    73 </row>
       
    74 <row>
       
    75 <entry><p>Right softkey (Done)</p></entry>
       
    76 <entry><p>Accepts the contents and returns to the previous state (in a form
       
    77 without the Options menu, the right softkey is Cancel.)</p></entry>
       
    78 </row>
       
    79 <row>
       
    80 <entry><p>Clear</p></entry>
       
    81 <entry><ul>
       
    82 <li><p>Pop-up: ignored. </p></li>
       
    83 <li><p>Text: deletes characters. </p></li>
       
    84 <li><p>Slider: ignored.</p></li>
       
    85 </ul></entry>
       
    86 </row>
       
    87 <row>
       
    88 <entry><p>Edit</p></entry>
       
    89 <entry><ul>
       
    90 <li><p>Pop-up: ignored. </p></li>
       
    91 <li><p>Text: opens the editing menu; selects text. </p></li>
       
    92 <li><p>Slider: ignored.</p></li>
       
    93 </ul></entry>
       
    94 </row>
       
    95 <row>
       
    96 <entry><p>Numeric keypad</p></entry>
       
    97 <entry><ul>
       
    98 <li><p>Pop-up: ignored. </p></li>
       
    99 <li><p>Text: input. </p></li>
       
   100 <li><p>Slider: ignored.</p></li>
       
   101 </ul></entry>
       
   102 </row>
       
   103 <row>
       
   104 <entry><p>Other keys</p></entry>
       
   105 <entry><p>The default action of the key.</p></entry>
       
   106 </row>
       
   107 </tbody>
       
   108 </tgroup>
       
   109 </table>
       
   110 <p>The field types are described in the following table:</p>
       
   111 <table id="GUID-A22394D3-9C39-4DC2-8A65-255F985F97E9"><title> Form field types</title>
       
   112 <tgroup cols="2"><colspec colname="col1"></colspec><colspec colname="col2"></colspec>
       
   113 <thead>
       
   114 <row>
       
   115 <entry>Field</entry>
       
   116 <entry>Description</entry>
       
   117 </row>
       
   118 </thead>
       
   119 <tbody>
       
   120 <row>
       
   121 <entry><p>Text field</p></entry>
       
   122 <entry><p>A text field contains some type of numeric or alphanumeric data.
       
   123 It can be edited directly using the usual editing functions when the form
       
   124 is in the Edit state. The text field can expand to more than one lines if
       
   125 necessary.</p><p>In the View state, a text field looks identical to a corresponding
       
   126 list item.</p></entry>
       
   127 </row>
       
   128 <row>
       
   129 <entry><p>Pop-up field</p></entry>
       
   130 <entry><p>A pop-up field offers the possibility to choose one value from a
       
   131 pre-defined list. In the View state, a pop-up field looks identical to a list
       
   132 item; the text is the current value of the field. In the Edit state, it has
       
   133 a distinct look that identifies the field as a pop-up list.</p><p>To edit
       
   134 an item in the Edit state, the user can press the Selection key, which opens
       
   135 a menu list that contains the available values. The highlight is on the current
       
   136 value. When the list is open, the softkeys are <b>OK</b> and <b>Cancel</b>,
       
   137 as usual with a menu list. Both the softkeys return to the Edit state in the
       
   138 form.</p><p>A pop-up field may also allow the user to enter a textual value
       
   139 in addition to the pre-defined values. In this case, the last option is named
       
   140 for example <b>Other</b>, and selecting it opens a Data query.</p><p>See figure
       
   141 below.</p></entry>
       
   142 </row>
       
   143 <row>
       
   144 <entry><p>Slider</p></entry>
       
   145 <entry><p>With a slider, the user can adjust a numeric value (although it
       
   146 is not necessary to present the actual value to the user as a number). In
       
   147 the View state, the item is presented as a textual item. In the Edit state,
       
   148 the value of the slider is immediately adjustable using the Arrow left and
       
   149 Arrow right keys.</p></entry>
       
   150 </row>
       
   151 </tbody>
       
   152 </tgroup>
       
   153 </table>
       
   154 <fig id="GUID-AA0170E3-BBB2-478A-A9A1-24C48BCF917F">
       
   155 <title>Pop-up field</title>
       
   156 <image href="GUID-DC4E42CA-2A65-44D7-8DBE-386F60F998A0_d0e56297_href.png" scale="40" placement="inline"></image>
       
   157 </fig>
       
   158 <section><title>Using forms in C++ applications</title><p>The
       
   159 API to use for creating forms is the Form
       
   160 API. For implementation information, see Using
       
   161 the Form API.</p></section>
       
   162 </conbody></concept>