author | Eugene Ostroukhov <eugeneo@symbian.org> |
Wed, 28 Jul 2010 09:27:51 -0700 | |
changeset 455 | 5da55957c779 |
parent 230 | 7848c135d915 |
permissions | -rw-r--r-- |
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="Travel Companion user interface" /> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
9 |
<meta scheme="URI" name="DC.Relation" content="WRTKit_Travel_Companion_Tutorial-GUID-be79ba64-fa03-4968-964e-d7dcc42d7053.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-989D17CC-F019-46BB-B6F5-49166E258ACA" 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 |
Travel Companion user interface</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-989D17CC-F019-46BB-B6F5-49166E258ACA"><a name="GUID-989D17CC-F019-46BB-B6F5-49166E258ACA"><!-- --></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 |
Travel Companion user interface</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 |
<div class="section"><h2 class="sectiontitle"> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
27 |
Handling multiple views</h2> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
28 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
29 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
30 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
31 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
32 |
The Travel Companion widget will follow many of the same patterns that the Hello World |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
33 |
and RSS Reader widgets have followed. The entry point to the widget is the init() function |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
34 |
that we call from the onload event handler in the main HTML file TravelCompanion.html. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
35 |
We will implement the init() function along with the rest of the widget and user interface |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
36 |
in the TravelCompanion.js file. Let's start with the init() function so that we get the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
37 |
widget up and running. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
38 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
39 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
40 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
41 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
42 |
From previous widgets we already know a lot of things about the WRTKit and about what |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
43 |
we will need. For example we know that we will have a user interface manager and that |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
44 |
we'll need a reference to each of the views that our widget uses. And since we have |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
45 |
designed the Travel Companion widget we know what views we will have. Before we write the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
46 |
init() function we can go ahead and declare the variables that we will use to refer to |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
47 |
the views and the user interface manager. And while we're at it we can also declare the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
48 |
variable that we'll use to refer to the Travel Companion engine. All of these variables |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
49 |
are globals and thus go outside the init() function: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
50 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
51 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
52 |
<pre> |
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 |
// Reference to travel companion engine that implements the business logic. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
55 |
var engine; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
56 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
57 |
// Reference to the WRTKit user interface manager. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
58 |
var uiManager; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
59 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
60 |
// References to views. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
61 |
var mainView; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
62 |
var infoView; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
63 |
var converterView; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
64 |
var weatherView; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
65 |
var settingsView; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
66 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
67 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
68 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
69 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
70 |
Previously we've written the init() function so that it creates the entire user interface |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
71 |
but because the Travel Companion widget has a much larger user interface than anything |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
72 |
we've done before, it's probably a good idea to split things up into smaller functions |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
73 |
so we don't end up with a huge init() function that will be hard to read and maintain. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
74 |
Let's create a function for the creation of each view, and then one function that will |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
75 |
call these view creation functions and setup all other things that we need for the user |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
76 |
interface, such as the Options menu. We'll just create stub functions for now but we |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
77 |
will soon get to implement the functions: |
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 |
<pre> |
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 |
// Creates the user interface. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
83 |
function createUI() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
84 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
85 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
86 |
// Creates the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
87 |
function createMainView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
88 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
89 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
90 |
// Creates the info view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
91 |
function createInfoView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
92 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
93 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
94 |
// Creates the converter view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
95 |
function createConverterView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
96 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
97 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
98 |
// Creates the weather view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
99 |
function createWeatherView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
100 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
101 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
102 |
// Creates the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
103 |
function createSettingsView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
104 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
105 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
106 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
107 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
108 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
109 |
In the RSS Reader widget we used functions called showMainView() and showSettings() to |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
110 |
move between views. That allowed us to implement all the logic that was required when |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
111 |
moving between views in one place regardless of what action triggered the change of |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
112 |
views. We'll do the same thing in the Travel Companion widget but this time we'll need |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
113 |
five functions since we have five views. Let's create stubs for these too at this stage |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
114 |
so that the functions exist if we need to refer to them. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
115 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
116 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
117 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
118 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
119 |
// Displays the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
120 |
function showMainView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
121 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
122 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
123 |
// Displays the info view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
124 |
function showInfoView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
125 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
126 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
127 |
// Displays the converter view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
128 |
function showConverterView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
129 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
130 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
131 |
// Displays the weather view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
132 |
function showWeatherView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
133 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
134 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
135 |
// Displays the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
136 |
function showSettingsView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
137 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
138 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
139 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
140 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
141 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
142 |
Since we will create each user interface view in its own function our init() function |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
143 |
will be much simpler than in previous widgets. We will create the business logic engine, |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
144 |
create the user interface by calling createUI() and then display the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
145 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
146 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
147 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
148 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
149 |
// Called from the onload event handler to initialize the widget. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
150 |
function init() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
151 |
// initialize the business logic engine |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
152 |
engine = new Engine(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
153 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
154 |
// create the user interface |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
155 |
createUI(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
156 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
157 |
// display the main view |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
158 |
showMainView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
159 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
160 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
161 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
162 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
163 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
164 |
Let's get started with creating the user interface by returning to the createUI() |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
165 |
function. We'll want to widget to show the softkey bar and we'll want it to be in |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
166 |
tab navigation mode instead of the default pointer navigation mode. We then need |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
167 |
to create the user interface manager and the five views that this widget has. Of |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
168 |
course those five views are actually created by the five create-functions that we |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
169 |
just wrote stubs for so we just need to call those functions from createUI(). |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
170 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
171 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
172 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
173 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
174 |
// Creates the user interface. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
175 |
function createUI() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
176 |
if (window.widget) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
177 |
// set tab-navigation mode and show softkeys |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
178 |
widget.setNavigationEnabled(false); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
179 |
menu.showSoftkeys(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
180 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
181 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
182 |
// create UI manager |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
183 |
uiManager = new UIManager(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
184 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
185 |
// create views |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
186 |
createMainView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
187 |
createInfoView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
188 |
createConverterView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
189 |
createWeatherView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
190 |
createSettingsView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
191 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
192 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
193 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
194 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
195 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
196 |
Because we created the stub functions for moving between views, we can also create |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
197 |
the Options menu now. We'll only add one item to the menu in addition to the default |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
198 |
"Exit" menu item. The item we'll add is one that will take the user to the settings |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
199 |
view. We'll first need to create a global menu item identifier: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
200 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
201 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
202 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
203 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
204 |
// Constants for menu item identifiers. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
205 |
var MENU_ITEM_SETTINGS = 0; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
206 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
207 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
208 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
209 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
210 |
Now that we have the menu item identifier we can actually create the menu item. Because |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
211 |
the Options menu functionality is only available in the S60 Web Runtime and not in PC |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
212 |
browsers we'll add that code in the same if-clause where we set the navigation mode and |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
213 |
show the softkey bar. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
214 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
215 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
216 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
217 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
218 |
// create menu |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
219 |
var settingsMenuItem = new MenuItem("Settings", MENU_ITEM_SETTINGS); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
220 |
settingsMenuItem.onSelect = menuItemSelected; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
221 |
menu.append(settingsMenuItem); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
222 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
223 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
224 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
225 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
226 |
When the menu item is selected it calls a function called menuItemSelected(). Let's |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
227 |
create that function and handle the case when the settings menu item is selected. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
228 |
When it is, we want to call showSettingsView() so that the user ends up in the settings |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
229 |
view as expected: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
230 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
231 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
232 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
233 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
234 |
// Callback for when menu items are selected. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
235 |
function menuItemSelected(id) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
236 |
switch (id) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
237 |
case MENU_ITEM_SETTINGS: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
238 |
showSettingsView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
239 |
break; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
240 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
241 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
242 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
243 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
244 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
245 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
246 |
The framework that we'll need when implementing the actual views is now nearly complete. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
247 |
But before we move on let's talk about how we'll be using softkeys in the Travel |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
248 |
Companion widget. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
249 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
250 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
251 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
252 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
253 |
In the main view we want the right softkey to be the default "Exit". But in the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
254 |
four functional views we don't want it to exit the widget but rather to return to |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
255 |
the main view. We'll thus use "Back" as the title in the functional views, except |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
256 |
in the settings view where we'll use "Cancel". |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
257 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
258 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
259 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
260 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
261 |
Let's create three functions that will handle setting the widget right softkey to |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
262 |
these configurations. The functions will check if we're actually in the S60 Web |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
263 |
Runtime before attempting to change the right softkey in order to make the widget |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
264 |
also work in a PC browser for testing purposes. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
265 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
266 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
267 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
268 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
269 |
// Sets the softkeys for the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
270 |
function setMainViewSoftkeys() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
271 |
if (window.widget) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
272 |
// set right softkey to "exit" |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
273 |
menu.setRightSoftkeyLabel("", null); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
274 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
275 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
276 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
277 |
// Sets the softkeys for sub views. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
278 |
function setSubViewSoftkeys() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
279 |
if (window.widget) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
280 |
// set right softkey to "back" (to main view) |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
281 |
menu.setRightSoftkeyLabel("Back", showMainView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
282 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
283 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
284 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
285 |
// Sets the softkeys for settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
286 |
function setSettingsViewSoftkeys() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
287 |
if (window.widget) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
288 |
// set right softkey to "cancel" (returns to main view) |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
289 |
menu.setRightSoftkeyLabel("Cancel", showMainView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
290 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
291 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
292 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
293 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
294 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
295 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
296 |
<div class="section"><h2 class="sectiontitle"> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
297 |
Main view</h2> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
298 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
299 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
300 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
301 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
302 |
Let's create our main view now so that we get something visible. The main view is |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
303 |
of course created in the function createMainView() for which we already created a |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
304 |
stub function. The main view will have four WRTKit NavigationButton controls in it, |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
305 |
one for each of the views (not counting the main view itself) in the widget. Using |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
306 |
the NavigationButton control is just like using a FormButton, with the difference |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
307 |
that it looks different and can have an icon image in addition to just text. Earlier |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
308 |
when we looked at the files that were in the Examples/TravelCompanion directory we |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
309 |
noticed that there were four icons there. Now it's time to use them as icons in the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
310 |
navigation buttons. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
311 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
312 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
313 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
314 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
315 |
We will add event listerners to the buttons so that when they are clicked (when they |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
316 |
emit an ActionPerformed event) they will call the functions we have created for |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
317 |
moving between views. At this point the functions are just stubs, but we will of |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
318 |
course fix that later. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
319 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
320 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
321 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
322 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
323 |
We've had captions for the views that we've created so far in the Hello World and |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
324 |
RSS Reader widgets and the Travel Companion will also have view captions. However |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
325 |
for the Travel Companion we'll use an image as our view caption. We will set the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
326 |
view caption to an empty string because if it's undefined or null then the view |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
327 |
caption area will be hidden. Then we will create a CSS rule for the ListViewCaptionText |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
328 |
class that is used by the area where the caption text goes in a list view. Because |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
329 |
our CSS rule is defined after the default WRTKit CSS rule for ListViewCaptionText, |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
330 |
our rule will be override the default one. Let's open up TravelCompanion.css and |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
331 |
create this rule: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
332 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
333 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
334 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
335 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
336 |
/* Place logo in list view caption */ |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
337 |
.ListViewCaptionText { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
338 |
background: url("ListViewCaptionLogo.png") no-repeat; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
339 |
height: 35px; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
340 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
341 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
342 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
343 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
344 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
345 |
We specified a height in addition to the background image. The height is needed |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
346 |
so that the caption text area won't collapse to zero height since it won't contain |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
347 |
any text. We're now ready to implement the createMainView() function: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
348 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
349 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
350 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
351 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
352 |
// Creates the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
353 |
function createMainView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
354 |
// empty caption text to display the caption bar - custom background using CSS |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
355 |
mainView = new ListView(null, ""); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
356 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
357 |
// info |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
358 |
var navToInfoButton = new NavigationButton(null, "NavInfoIcon.png", "Information"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
359 |
navToInfoButton.addEventListener("ActionPerformed", showInfoView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
360 |
mainView.addControl(navToInfoButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
361 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
362 |
// converter |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
363 |
var navToConverterButton = new NavigationButton(null, "NavConverterIcon.png", "Currency Converter"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
364 |
navToConverterButton.addEventListener("ActionPerformed", showConverterView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
365 |
mainView.addControl(navToConverterButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
366 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
367 |
// weather |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
368 |
var navToWeatherButton = new NavigationButton(null, "NavWeatherIcon.png", "Weather Forecast"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
369 |
navToWeatherButton.addEventListener("ActionPerformed", showWeatherView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
370 |
mainView.addControl(navToWeatherButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
371 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
372 |
// settings |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
373 |
var navToSettingsButton = new NavigationButton(null, "NavSettingsIcon.png", "Settings"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
374 |
navToSettingsButton.addEventListener("ActionPerformed", showSettingsView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
375 |
mainView.addControl(navToSettingsButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
376 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
377 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
378 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
379 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
380 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
381 |
We now have a main view and our widget even calls showMainView() when it starts |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
382 |
but nothing will actually show up yet because we haven't implemented the showMainView() |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
383 |
function yet. Let's do that now: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
384 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
385 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
386 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
387 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
388 |
// Displays the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
389 |
function showMainView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
390 |
setMainViewSoftkeys(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
391 |
uiManager.setView(mainView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
392 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
393 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
394 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
395 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
396 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
397 |
The function calls the setMainViewSoftkeys() function to put the right softkey |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
398 |
in the proper state and then asks the user interface manager to show the main |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
399 |
view. Remember that we're already calling the showMainView() function from the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
400 |
init() function so we can go ahead and test this now in a PC browser, emulator |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
401 |
or handset. Notice the custom list view caption image and the navigation button |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
402 |
icons. Clicking the navigation buttons doesn't do anything yet because we don't |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
403 |
have any other views yet and the functions to show other views except the main |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
404 |
view aren't implemented. But then again, because we wrote stub functions we are |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
405 |
also not getting any error messages. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
406 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
407 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
408 |
<div class="fignone" id="GUID-989D17CC-F019-46BB-B6F5-49166E258ACA__GUID-B006B086-0D8B-4EA4-8A71-179507B7595A"><a name="GUID-989D17CC-F019-46BB-B6F5-49166E258ACA__GUID-B006B086-0D8B-4EA4-8A71-179507B7595A"><!-- --></a><span class="figcap">Figure 1. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
409 |
Travel Companion main view</span> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
410 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
411 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
412 |
<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
|
413 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
414 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
415 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
416 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
417 |
<div class="section"><h2 class="sectiontitle"> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
418 |
Settings view</h2> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
419 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
420 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
421 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
422 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
423 |
It's a good idea to implement the settings view as early as possible because |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
424 |
that allows you to test the rest of the widget more easily. In order to get |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
425 |
the settings view up and running we'll need to do three things. First of all |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
426 |
we'll need to implement the createSettingsView() function so that the widget |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
427 |
actually has a settings view. Second, we'll need to implement the actions |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
428 |
that can be performed in that view. There are two actions: "Save" and "Cancel". |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
429 |
Of these, save is the tricker one and we'll implement it in a function that |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
430 |
we will call saveSettingsClicked(). The cancel action will simply take us back |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
431 |
to the main view and will be handled by the showMainView() function that we |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
432 |
have already implemented. And third, we need to implement the showSettingsView() |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
433 |
function so that clicking on the settings navigation button in the main view |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
434 |
takes us to the settings view and sets it up correctly so that the view |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
435 |
reflects the current preferences. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
436 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
437 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
438 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
439 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
440 |
The settings view will have four sections that we will separate using a WRTKit |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
441 |
Separator control. The first section lets the user select the home city and the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
442 |
whether the home city is in daylight saving time. Here we'll use a SelectionMenu |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
443 |
control for the city selection and a SelectionList control with a single option |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
444 |
for the daylight saving time option. We could have used a SelectionList with |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
445 |
two options "Daylight saving time" and "Normal time". Since the selection would |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
446 |
have been a single selection this would have resulted in two radio buttons. But |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
447 |
partly for the sake of usability and partly to show how to do it, we'll implement |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
448 |
it so that it's a single checkbox instead. Thus, we'll use a SelectionList with |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
449 |
a single option but we'll get the checkboxes instead of radio buttons by putting |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
450 |
the SelectionList in multiple selection mode. Because there's only one option |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
451 |
there will only be one checkbox. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
452 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
453 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
454 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
455 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
456 |
The second section is just like the first one but for the local city. The third |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
457 |
section is for the temperature unit selection (Celsius or Fahrenheit) and we'll |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
458 |
implement it as a single selection SelectionList control. And finally the fourth |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
459 |
section is for the Save and Cancel FormButton controls. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
460 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
461 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
462 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
463 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
464 |
The options for the selection controls will be created just before we create |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
465 |
the controls themselves. The daylight saving time and temperature unit options |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
466 |
are just static JSON defined option lists since we know what the options are. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
467 |
But for the city selection we'll create it dynamically by asking the business |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
468 |
logic engine for a list of all the supported cities. We'll then create one option |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
469 |
for each city. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
470 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
471 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
472 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
473 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
474 |
Because we'll need to access the controls in the settings view from outside the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
475 |
creation function we'll need to create global references to them: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
476 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
477 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
478 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
479 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
480 |
// Settings view controls. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
481 |
var homeCitySelection; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
482 |
var homeCityDSTSelection; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
483 |
var localCitySelection; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
484 |
var localCityDSTSelection; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
485 |
var temperatureUnitSelection; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
486 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
487 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
488 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
489 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
490 |
We can now implement the settings view creation function: |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
491 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
492 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
493 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
494 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
495 |
// Creates the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
496 |
function createSettingsView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
497 |
// empty caption text to display the caption bar - custom background using CSS |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
498 |
settingsView = new ListView(null, ""); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
499 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
500 |
// create city options from cities array |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
501 |
var cityOptions = []; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
502 |
var cities = engine.getCities(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
503 |
for (var i = 0; i < cities.length; i++) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
504 |
cityOptions.push({ value: cities[i], text: cities[i].name }); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
505 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
506 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
507 |
// create DST option |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
508 |
dstOptions = [ { value: true, text: "DST (+1h)" } ]; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
509 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
510 |
// home city |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
511 |
homeCitySelection = new SelectionMenu(null, "Home City", cityOptions); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
512 |
settingsView.addControl(homeCitySelection); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
513 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
514 |
// home city DST (using a multiple selection but only one option to get a single checkbox) |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
515 |
homeCityDSTSelection = new SelectionList(null, "Daylight Saving Time (home)", dstOptions, true); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
516 |
settingsView.addControl(homeCityDSTSelection); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
517 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
518 |
// separator |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
519 |
settingsView.addControl(new Separator()); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
520 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
521 |
// local city |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
522 |
localCitySelection = new SelectionMenu(null, "Local City", cityOptions); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
523 |
settingsView.addControl(localCitySelection); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
524 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
525 |
// local city DST (using a multiple selection but only one option to get a single checkbox) |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
526 |
localCityDSTSelection = new SelectionList(null, "Daylight Saving Time (local)", dstOptions, true); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
527 |
settingsView.addControl(localCityDSTSelection); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
528 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
529 |
// separator |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
530 |
settingsView.addControl(new Separator()); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
531 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
532 |
// temperature unit |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
533 |
var temperatureUnitOptions = [ { value: "c", text: "Celsius" }, { value: "f", text: "Fahrenheit" } ]; |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
534 |
temperatureUnitSelection = new SelectionList(null, "Temperature Unit", temperatureUnitOptions); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
535 |
settingsView.addControl(temperatureUnitSelection); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
536 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
537 |
// separator |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
538 |
settingsView.addControl(new Separator()); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
539 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
540 |
// save button |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
541 |
var saveSettingsButton = new FormButton(null, "Save"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
542 |
saveSettingsButton.addEventListener("ActionPerformed", saveSettingsClicked); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
543 |
settingsView.addControl(saveSettingsButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
544 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
545 |
// cancel button |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
546 |
var cancelSettingsButton = new FormButton(null, "Cancel"); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
547 |
cancelSettingsButton.addEventListener("ActionPerformed", showMainView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
548 |
settingsView.addControl(cancelSettingsButton); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
549 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
550 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
551 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
552 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
553 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
554 |
Note that we used the actual city as the value for the city options. You can |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
555 |
use anything you want for the value property for a selection control option |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
556 |
and in this case we used the actual city object because it will come in handy |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
557 |
later when we want to set the home and local cities that the user has selected |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
558 |
to the engine. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
559 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
560 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
561 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
562 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
563 |
Our save button calls the saveSettingsClicked() function we talked about earlier |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
564 |
but we haven't created that function yet. We'll continue implementing the user |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
565 |
interface by writing this function. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
566 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
567 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
568 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
569 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
570 |
You'll recall that the business logic engine actually stores all the preferences |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
571 |
so all we really need to do is read what values have been selected in the settings |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
572 |
view, telling these values to the engine, calling the savePreferences() method in |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
573 |
the engine to persist the settings, and then return to the main view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
574 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
575 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
576 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
577 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
578 |
// Called when the user clicks on the "save" button in the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
579 |
function saveSettingsClicked() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
580 |
// update the selected home city |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
581 |
var selectedHomeCityOption = homeCitySelection.getSelected(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
582 |
if (selectedHomeCityOption != null) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
583 |
engine.setHomeCity(selectedHomeCityOption.value); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
584 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
585 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
586 |
// update the selected local city |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
587 |
var selectedLocalCityOption = localCitySelection.getSelected(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
588 |
if (selectedLocalCityOption != null) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
589 |
engine.setLocalCity(selectedLocalCityOption.value); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
590 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
591 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
592 |
// update home and local city DST |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
593 |
// there's only one checkbox but we are using a multiple-selection menu. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
594 |
// if the selected array has one element then the checkbox is checked. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
595 |
engine.setHomeCityDST(homeCityDSTSelection.getSelected().length == 1); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
596 |
engine.setLocalCityDST(localCityDSTSelection.getSelected().length == 1); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
597 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
598 |
// update temperature unit |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
599 |
var selectedTemperatureUnitOption = temperatureUnitSelection.getSelected(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
600 |
if (selectedTemperatureUnitOption != null) { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
601 |
engine.setTemperatureUnit(selectedTemperatureUnitOption.value); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
602 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
603 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
604 |
// save settings |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
605 |
engine.savePreferences(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
606 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
607 |
// go back to the main view |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
608 |
showMainView(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
609 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
610 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
611 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
612 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
613 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
614 |
We're writing defensive code here and making sure that the selection controls |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
615 |
actually have anything selected at all. This should never be possible with |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
616 |
single selection control if they have one option already selected, but we'll |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
617 |
use the principle of "better safe than sorry". |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
618 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
619 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
620 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
621 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
622 |
Notice that the daylight saving time selection is checked by asking for the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
623 |
selected options array (we're using a multiple selection control) and checking |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
624 |
if there is exactly one selected option. We don't care about the actual selected |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
625 |
option because we know that there's only one. Either it's selected or it's not. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
626 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
627 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
628 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
629 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
630 |
We have now implemented two of the three steps we said were necessary to get the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
631 |
settings view fully functional. Let's implement the final step: showing the view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
632 |
Showing the settings view is done by first updating the settings view controls |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
633 |
to reflect the current configuration, setting the right softkey to the state that |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
634 |
it should be in for the settings view and then asking the user interface manager |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
635 |
to show the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
636 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
637 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
638 |
<pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
639 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
640 |
// Displays the settings view. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
641 |
function showSettingsView() { |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
642 |
// update settings view controls to match current configuration |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
643 |
// the DST selected sets are either the options array with its single option or an empty array |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
644 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
645 |
// home city and DST setting |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
646 |
homeCitySelection.setSelected(homeCitySelection.getOptionForValue(engine.getHomeCity())); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
647 |
homeCityDSTSelection.setSelected(engine.getHomeCityDST() ? homeCityDSTSelection.getOptions() : []); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
648 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
649 |
// local city and DST setting |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
650 |
localCitySelection.setSelected(localCitySelection.getOptionForValue(engine.getLocalCity())); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
651 |
localCityDSTSelection.setSelected(engine.getLocalCityDST() ? localCityDSTSelection.getOptions() : []); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
652 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
653 |
// temperature unit |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
654 |
temperatureUnitSelection.setSelected(temperatureUnitSelection.getOptionForValue(engine.getTemperatureUnit())); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
655 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
656 |
setSettingsViewSoftkeys(); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
657 |
uiManager.setView(settingsView); |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
658 |
} |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
659 |
</pre> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
660 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
661 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
662 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
663 |
We're using the convenient getOptionForValue() function that all selection controls |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
664 |
have to retrieve the right option to select for each of the selection controls. The |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
665 |
way we handle the daylight saving time selection controls may seem a little strange |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
666 |
at first but remember that we only have a single option and thus if that option should |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
667 |
be selected then the selected options array is identical with the options array - both |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
668 |
are arrays containing the one and same option. Selection controls always copy the options |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
669 |
and selected options arrays when the setOptions() and setSelected() methods are called |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
670 |
so there is no problem in passing the options array as the selected options array. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
671 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
672 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
673 |
<p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
674 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
675 |
The settings view is now completed. You can try it out and play with it, change the |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
676 |
settings, open it up again, change some more settings, cancel the changes, etc. to |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
677 |
verify that it's working as it should. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
678 |
</p> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
679 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
680 |
<div class="fignone" id="GUID-989D17CC-F019-46BB-B6F5-49166E258ACA__GUID-66154A40-DD96-45B3-BF53-01594426BA71"><a name="GUID-989D17CC-F019-46BB-B6F5-49166E258ACA__GUID-66154A40-DD96-45B3-BF53-01594426BA71"><!-- --></a><span class="figcap">Figure 2. |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
681 |
Travel Companion settings view</span> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
682 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
683 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
684 |
<br /><img src="Travel_Companion_Settings_Screenshot_1.png" /><br /> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
685 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
686 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
687 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
688 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
689 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
690 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
691 |
<div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
692 |
<div class="familylinks"> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
693 |
<div class="parentlink"><strong>Parent topic:</strong> <a href="WRTKit_Travel_Companion_Tutorial-GUID-be79ba64-fa03-4968-964e-d7dcc42d7053.html">Travel Companion</a></div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
694 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
695 |
</div> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
696 |
|
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
697 |
</body> |
7848c135d915
Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff
changeset
|
698 |
</html> |