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