Class: $.NumberFactory

Inherits:
WatchUi.PickerFactory show all

Overview

Factory that controls which numbers can be picked

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var _font as Graphics.FontDefinition

var _formatString as Lang.String

var _increment as Lang.Number

var _start as Lang.Number

var _stop as Lang.Number

Instance Method Details

getDrawable(index as Lang.Number, selected as Lang.Boolean) as WatchUi.Drawable or Null

Generate a Drawable instance for an item

Parameters:

  • index —

    The item index

  • selected —

    true if the current item is selected, false otherwise

Returns:

  • Drawable for the item

getIndex(value as Lang.Number) as Lang.Number

Get the index of a number item

Parameters:

  • value —

    The number to get the index of

Returns:

  • The index of the number

getSize() as Lang.Number

Get the number of picker items

Returns:

  • Number of items

getValue(index as Lang.Number) as Lang.Object or Null

Get the value of the item at the given index

Parameters:

  • index —

    Index of the item to get the value of

Returns:

  • Value of the item

initialize(start as Lang.Number, stop as Lang.Number, increment as Lang.Number, options as { :font as Graphics.FontDefinition, :format as Lang.String })

Constructor

Parameters:

  • start —

    Number to start with

  • stop —

    Number to end with

  • increment —

    How far apart the numbers should be

  • options —

    Dictionary of options

    • :font —

      The font to use

    • :format —

      The number format to display


Generated Oct 20, 2026, 8:20:54 AM