org.symbian.tools.wrttools.doc.WRTKit/html/WRTKit_High_level_view_of_the_WRTKit-GUID-a3abe57e-9a71-4f94-923a-b84ccd1b0905.html
changeset 230 7848c135d915
equal deleted inserted replaced
229:716254ccbcc0 230:7848c135d915
       
     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="High level view of the WRTKit" />
       
     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-A3ABE57E-9A71-4F94-923A-B84CCD1B0905" name="DC.Identifier" />
       
    12 <meta content="en" name="DC.Language" />
       
    13 <link href="commonltr.css" type="text/css" rel="stylesheet" />
       
    14 <title>
       
    15 High level view of the WRTKit</title>
       
    16 </head>
       
    17 <body id="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905"><a name="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905"><!-- --></a>
       
    18 
       
    19 
       
    20 
       
    21     <h1 class="topictitle1">
       
    22 High level view of the WRTKit</h1>
       
    23 
       
    24     <div>
       
    25 
       
    26         <p>
       
    27 
       
    28             User interfaces in the WRTKit are based on the concepts of "views" and "controls".
       
    29             A control is a user interface element that the user can view or interact with,
       
    30             e.g. buttons, checkboxes, textfields, etc. Views are containers for controls and
       
    31             deal with the layout of controls on the screen in such a way that the user can
       
    32             interact with them in an easy way. Views are conceptually similar to windows in
       
    33             PC applications, but on a mobile device views typically fill the entire screen
       
    34             and only one view can thus be visible at any given time. The WRTKit allows views
       
    35             and controls to be interacted with in both the tab and pointer navigation modes
       
    36             and the navigation mode can even be switched at runtime.
       
    37         </p>
       
    38 
       
    39         <div class="fignone" id="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905__GUID-65170EDF-EF04-48AB-A414-1581157DAFA5"><a name="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905__GUID-65170EDF-EF04-48AB-A414-1581157DAFA5"><!-- --></a><span class="figcap">Figure 1. 
       
    40 WRTKit-based widget user interface</span>
       
    41 
       
    42             
       
    43             <br /><img src="RSS_Reader_Main_Screenshot_3.png" /><br />
       
    44         </div>
       
    45 
       
    46         <p>
       
    47 
       
    48             The WRTKit is an object oriented user interface toolkit, which means that views 
       
    49             and controls are implemented as JavaScript classes that are instantiated to 
       
    50             objects when they are needed. In order to create a view with two buttons, for 
       
    51             example, a developer writes JavaScript code that instantiates one view 
       
    52             object and two button objects, and then calls a method in the view object asking 
       
    53             it to add the buttons to itself. Being object oriented, the created WRTKit 
       
    54             objects fully maintain their own state and take care of drawing themselves 
       
    55             properly on the screen in all situations. So for example if one of the buttons 
       
    56             is focused, the button modifies its own looks so that it appears focused 
       
    57             on the screen. Because the objects know their own state, they can be queried for 
       
    58             properties as needed. E.g. a textfield can be asked what text it currently
       
    59             contains, a button can be asked if it is enabled, and so on.
       
    60         </p>
       
    61 
       
    62         <p>
       
    63 
       
    64             Controls in the WRTKit have captions that can be used to show what the control 
       
    65             does. E.g. a textfield that is meant to be used to enter a password could have a 
       
    66             caption "Password". Captions are optional but should be used unless there is a 
       
    67             very good reason not to. The only controls that do not have captions are 
       
    68             buttons, since they have a text on the face of the button that accomplishes the 
       
    69             same thing.
       
    70         </p>
       
    71 
       
    72         <p>
       
    73 
       
    74             WRTKit user interfaces are managed by a class that is aptly named "UIManager". 
       
    75             Every widget that uses the WRTKit for its user interface creates a single 
       
    76             instance of this class and then uses that UIManager instance to command views to 
       
    77             be displayed. The UIManager takes care of all the heavy lifting that is necessary 
       
    78             to bring a new view to the screen. The UIManager also handles other user 
       
    79             interface duties such as management of notification popup dialogs and view 
       
    80             scrollbars.
       
    81         </p>
       
    82 
       
    83         <p>
       
    84 
       
    85             Controls and views can notify the outside world when some event occurrs, e.g. 
       
    86             when a button is pressed or someone toggles a checkbox. The WRTKit follows the 
       
    87             so called "observer pattern" in its implementation of event notifications. This 
       
    88             simply means that a control or view can be asked to call a particular JavaScript 
       
    89             function (which is the "observer" or "listener") when an specific type of event 
       
    90             occurrs. The WRTKit allows a control or view to have any number of concurrently 
       
    91             registered listeners and listeners can either ask to be notified of only a 
       
    92             particular type of event or about all events.
       
    93         </p>
       
    94 
       
    95         <p>
       
    96 
       
    97             The WRTKit library is physically a set of JavaScript, CSS and image files that 
       
    98             are located within a directory called "WRTKit". That directory is copied into 
       
    99             the root directory of widgets that wish to use the library. A widget only needs 
       
   100             to include a single JavaScript file ("WRTKit/WRTKit.js") from the directory in 
       
   101             order to include and initialize the full WRTKit for use in the widget. Once the 
       
   102             WRTKit has been added to the widget and initialized, the widget can start using 
       
   103             the JavaScript classes that the library defines.
       
   104         </p>
       
   105 
       
   106     </div>
       
   107 
       
   108 <div>
       
   109 <div class="familylinks">
       
   110 <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>
       
   111 </div>
       
   112 </div>
       
   113 
       
   114 </body>
       
   115 </html>