|
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="Actions" /> |
|
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-38771443-166B-4112-9569-C07229CD7449" name="DC.Identifier" /> |
|
12 <meta content="en" name="DC.Language" /> |
|
13 <link href="commonltr.css" type="text/css" rel="stylesheet" /> |
|
14 <title> |
|
15 Actions</title> |
|
16 </head> |
|
17 <body id="GUID-38771443-166B-4112-9569-C07229CD7449"><a name="GUID-38771443-166B-4112-9569-C07229CD7449"><!-- --></a> |
|
18 |
|
19 |
|
20 |
|
21 <h1 class="topictitle1"> |
|
22 Actions</h1> |
|
23 |
|
24 <div> |
|
25 |
|
26 <p> |
|
27 |
|
28 Widgets can let users trigger actions in many ways. One way is by inserting menu |
|
29 items in the Options menu, using the menu object that the S60 Web Runtime |
|
30 defines. Another way is to use links that call JavaScript functions. Such links |
|
31 could for example be included as part of content in a ContentPanel control. |
|
32 Links belong more to web pages than widgets or applications, however, and are |
|
33 not recommended except in cases when they result in a web URL being opened up in |
|
34 a web browser (i.e. using the widget.openURL() method). |
|
35 </p> |
|
36 |
|
37 <p> |
|
38 |
|
39 The third way is to use one of the WRTKit action controls: FormButton and |
|
40 NavigationButton. Both controls are very similar in usage but differ greatly in |
|
41 presentation and intended use. The FormButton control is meant to be used in |
|
42 situations where pressing the button would result in some kind of process taking |
|
43 place, e.g. settings being saved. The NavigationButton control is intended for |
|
44 moving between views inside the widget, or other similar type of actions. |
|
45 FormButton controls look similar to buttons in a PC application or "Submit"- |
|
46 buttons on a web page. NavigatationButton controls don't really have a |
|
47 counterpart in the PC application domain, but is common in mobile device |
|
48 application that have large user interfaces that are split into several views. |
|
49 </p> |
|
50 |
|
51 <div class="fignone" id="GUID-38771443-166B-4112-9569-C07229CD7449__GUID-AC8282AE-227F-481A-8774-B3904AABDD9F"><a name="GUID-38771443-166B-4112-9569-C07229CD7449__GUID-AC8282AE-227F-481A-8774-B3904AABDD9F"><!-- --></a><span class="figcap">Figure 1. |
|
52 NavigationButton controls</span> |
|
53 |
|
54 |
|
55 <br /><img src="NavigationButton_Controls_Screenshot_1.png" /><br /> |
|
56 </div> |
|
57 |
|
58 <p> |
|
59 |
|
60 In an email widget, NavigationButton controls could be used so that there would |
|
61 be a "Folders"-view where each folder (e.g. Inbox, Sent, Trash, etc.) would have |
|
62 a corresponding NavigationButton. Clicking on the button for a folder would open |
|
63 up that folder in a new view. FormButton controls could be used for example in a |
|
64 view that lets users write new emails to trigger sending of the written email. A |
|
65 FormButton in a view like that could have "Send" as the button text. |
|
66 </p> |
|
67 |
|
68 <div class="fignone" id="GUID-38771443-166B-4112-9569-C07229CD7449__GUID-60F75AE9-DE96-4044-BAB4-BAB27F08A1D7"><a name="GUID-38771443-166B-4112-9569-C07229CD7449__GUID-60F75AE9-DE96-4044-BAB4-BAB27F08A1D7"><!-- --></a><span class="figcap">Figure 2. |
|
69 FormButton controls</span> |
|
70 |
|
71 |
|
72 <br /><img src="FormButton_Controls_Screenshot_1.png" /><br /> |
|
73 </div> |
|
74 |
|
75 <p> |
|
76 |
|
77 The FormButton and NavigationButton controls fire events with the event type |
|
78 "ActionPerformed" whenever a user presses the button. The event can be turned |
|
79 into a function call to a callback function of the developer's choice by |
|
80 registering the function to the control for the "ActionPerformed" event type. |
|
81 This is done using the addEventListener() method that all controls inherit from |
|
82 the UIElement base class. |
|
83 </p> |
|
84 |
|
85 </div> |
|
86 |
|
87 <div> |
|
88 <div class="familylinks"> |
|
89 <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> |
|
90 </div> |
|
91 </div> |
|
92 |
|
93 </body> |
|
94 </html> |