org.symbian.tools.wrttools.doc.WRTKit/html/WRTKit_Views_and_the_UIManager-GUID-f95b4ad6-0e86-4023-8371-3ff2a45e95fe.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 28 Jul 2010 09:27:51 -0700
changeset 455 5da55957c779
parent 230 7848c135d915
permissions -rw-r--r--
Bluetooth support was refactored on top of a new frameworks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
230
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     2
<html lang="en" xml:lang="en">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     3
<head>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     4
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     5
<meta name="copyright" content="(C) Copyright 2005" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     6
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     7
<meta content="concept" name="DC.Type" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     8
<meta name="DC.Title" content="Views and the UIManager" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     9
<meta scheme="URI" name="DC.Relation" content="WRTKit_Developing_widgets_using_the_WRTKit-GUID-a321db96-0a01-4e55-b24b-96905f40cb5c.html" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    10
<meta content="XHTML" name="DC.Format" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    11
<meta content="GUID-F95B4AD6-0E86-4023-8371-3FF2A45E95FE" name="DC.Identifier" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    12
<meta content="en" name="DC.Language" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    13
<link href="commonltr.css" type="text/css" rel="stylesheet" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    14
<title>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    15
Views and the UIManager</title>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    16
</head>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    17
<body id="GUID-F95B4AD6-0E86-4023-8371-3FF2A45E95FE"><a name="GUID-F95B4AD6-0E86-4023-8371-3FF2A45E95FE"><!-- --></a>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    18
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    19
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    20
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    21
    <h1 class="topictitle1">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    22
Views and the UIManager</h1>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    23
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    24
    <div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    25
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    26
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    27
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    28
            All WRTKit user interfaces are divided into "views". The concept of 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    29
            a view is simply a set of user interface elements, such as buttons, 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    30
            textfields, etc., that are hosted in a container. The WRTKit 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    31
            architecture defines a contract for views through a base class 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    32
            called View and implements a concrete view class called ListView 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    33
            that lays out controls vertically. This layout is similar to what is 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    34
            commonly used in mobile device user interfaces and is thus 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    35
            sufficient for the vast majority of widget user interfaces. However 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    36
            the WRTKit allows developers to create their own custom views if 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    37
            some other kind of layout is preferred instead. Creating a custom 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    38
            view is an advanced topic that isn't covered here, but roughly 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    39
            speaking it is a simple matter of creating a subclass of the View 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    40
            class (just like ListView) and implementing all the functions that 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    41
            the View class defines, plus whatever custom layout the developer 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    42
            wants.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    43
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    44
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    45
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    46
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    47
            Because the ListView uses a vertical list layout for controls, 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    48
            adding controls can be done either to the end of the list or by 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    49
            inserting before a specified control in the list. There is no need 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    50
            to worry about actual control locations, coordinates or anything of 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    51
            that sort. The ListViews handles all of this automatically.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    52
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    53
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    54
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    55
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    56
            In addition to controls, the ListView has a view caption that is 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    57
            displayed at the very top of the view. The caption is optional but 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    58
            is good to include in order to show what a particular view is about. 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    59
            E.g. a view for settings could have a caption "Settings".
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    60
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    61
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    62
        <div class="fignone" id="GUID-F95B4AD6-0E86-4023-8371-3FF2A45E95FE__GUID-E6398D37-32D1-4DF7-8313-5991D28067F9"><a name="GUID-F95B4AD6-0E86-4023-8371-3FF2A45E95FE__GUID-E6398D37-32D1-4DF7-8313-5991D28067F9"><!-- --></a><span class="figcap">Figure 1. 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    63
ListView with caption</span>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    64
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    65
            
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    66
            <br /><img src="Travel_Companion_Main_Screenshot_1.png" /><br />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    67
        </div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    68
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    69
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    70
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    71
            Only one view can be visible at any given time, as is common in 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    72
            mobile device applications. Views are commanded to be shown using a 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    73
            class called UIManager, which attaches the view to the "view root". 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    74
            The view root is an HTML element that can be specified to the 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    75
            UIManager when it is created, but typically this argument is 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    76
            omitted, resulting in the UIManager creating a view root element 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    77
            that makes views take up the entire screen.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    78
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    79
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    80
    </div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    81
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    82
<div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    83
<div class="familylinks">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    84
<div class="parentlink"><strong>Parent topic:</strong> <a href="WRTKit_Developing_widgets_using_the_WRTKit-GUID-a321db96-0a01-4e55-b24b-96905f40cb5c.html">Developing widgets using the WRTKit</a></div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    85
</div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    86
</div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    87
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    88
</body>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    89
</html>