×
Namespaces

Variants
Actions
(Difference between revisions)

Options Menu

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Fix categories)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix ArticleMetaData)
 
Line 1: Line 1:
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20091109
 +
|author= [[User:Kbwiki]]
 +
}}
 
[[Category:Guarana UI]]
 
[[Category:Guarana UI]]
__NOTOC__
 
 
=Inheritance=
 
=Inheritance=
 
   
 
   

Latest revision as of 10:30, 31 July 2012

Article Metadata
Article
Created: User:Kbwiki (09 Nov 2009)
Last edited: hamishwillee (31 Jul 2012)

Contents

[edit] Inheritance

Nokia.OptionsMenu
|- Nokia.Widget
|- Nokia.Class (basic class)

[edit] 1- Description

The Options Menu component contains a row of single-line items. Each item presents the user with a list of action items.


[edit] 2 - Visual Design

Optionsmenu01.png

[edit] 3 - Component Dependencies

[edit] 3.1 CSS

<!-- Themeroller CSS -->
<link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen">
<!-- Specific Theme/Resolution CSS -->
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">

[edit] 3.2 Javascript

<!-- jQuery file -->
<script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script>
<!-- Guarana file -->
<script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>

[edit] 4 - Functional Specifications/Requirements

[edit] 4.1 - Options

  • element: 'selector'
    • jQuery selector or the DOM reference to become the container of the component.
  • transitions: boolean
    • Defines whether transitions are applied on the component.
  • label: string
    • Defines a label for a specific section of the component.


[edit] 4.2 - Events - Callbacks

  • create: function()
    • Scope: [this.element]


[edit] 4.3 - Methods

  • appendShadow: function()
    • Adds a shadow on the component.
    • return [void]
  • addSection: function(section)
    • Adds a new section on the component.
    • return [void]
  • addItem: function(item)
    • Adds a new item in a specific section.
    • return [int]
  • getItems: function()
    • Returns a set of items.
    • return [jQuery collection]
  • getLabel: function()
    • Gets the label for a specific section of the component.
    • return [String]
  • select: function(event)
    • Selects a component item.
    • return [void]

[edit] 4.4 - Default options

  • transitions: false


[edit] 5 - Component Demo

[edit] 5.1 HTML

<div id="menu"></div>  

[edit] 5.2 Javascript

var optionsmenu = new Nokia.OptionsMenu({
     element: '#menu',
     transitions: true
});

// Secction 1 Definition
var section1 = new Nokia.OptionsMenuSection({
     label: 'File'
});

var option1 = new Nokia.OptionsMenuItem({
     label: 'New',
     select: function() {
          alert('This creates a new file.');
     }
});

var option2 = new Nokia.OptionsMenuItem({
     label: 'Open',
     select: function() {
          alert('This opens a new file.');
     }
});

section1.addItem(option1);
section1.addItem(option2);

// Secction 2 Definition
var section2 = new Nokia.OptionsMenuSection({
     label: 'Edit'
});

var option5 = new Nokia.OptionsMenuItem({
     label: 'Undo',
     select: function() {
          alert('This undo last change');
     }
});
var option6 = new Nokia.OptionsMenuItem({
     label: 'Redo',
     select: function() {
          alert('This redo last change.');
     }
});

section2.addItem(option5);
section2.addItem(option6);

//Adding Section
optionsmenu.addSection(section1);
optionsmenu.addSection(section2);

//Creating Component
optionsmenu.create();

[edit] 6 - Nokia WRT Browser Compatibility

 

▴   S60 3.1 S60 3.2 S60 5.0
Options Menu NO  YES  YES 

 

This page was last modified on 31 July 2012, at 10:30.
65 page views in the last 30 days.