63 lines
2.9 KiB
Factor
63 lines
2.9 KiB
Factor
USING: help.syntax help.markup kernel math classes classes.tuple
|
|
calendar models ;
|
|
IN: models.range
|
|
|
|
HELP: range
|
|
{ $class-description "Range models implement the " { $link "range-model-protocol" } " with real numbers as the minimum, current, maximum, and page size. Range models are created with " { $link <range> } "." }
|
|
{ $notes { $link "ui.gadgets.sliders" } " use range models." } ;
|
|
|
|
HELP: <range>
|
|
{ $values { "value" real } { "page" real } { "min" real } { "max" real } { "step" real } { "range" range } }
|
|
{ $description "Creates a new " { $link range } " model." } ;
|
|
|
|
HELP: range-model
|
|
{ $values { "range" range } { "model" model } }
|
|
{ $description "Outputs a model holding a range model's current value." }
|
|
{ $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;
|
|
|
|
HELP: range-min
|
|
{ $values { "range" range } { "model" model } }
|
|
{ $description "Outputs a model holding a range model's minimum value." }
|
|
{ $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;
|
|
|
|
HELP: range-max
|
|
{ $values { "range" range } { "model" model } }
|
|
{ $description "Outputs a model holding a range model's maximum value." }
|
|
{ $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;
|
|
|
|
HELP: range-page
|
|
{ $values { "range" range } { "model" model } }
|
|
{ $description "Outputs a model holding a range model's page size." }
|
|
{ $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;
|
|
|
|
HELP: move-by
|
|
{ $values { "amount" real } { "range" range } }
|
|
{ $description "Adds a number to a range model's current value." }
|
|
{ $side-effects "range" } ;
|
|
|
|
HELP: move-by-page
|
|
{ $values { "amount" real } { "range" range } }
|
|
{ $description "Adds a multiple of the page size to a range model's current value." }
|
|
{ $side-effects "range" } ;
|
|
|
|
ARTICLE: "models-range" "Range models"
|
|
"Range models ensure their value is a real number within a fixed range."
|
|
{ $subsection range }
|
|
{ $subsection <range> }
|
|
"Range models conform to a protocol for getting and setting the current value, as well as the endpoints of the range."
|
|
{ $subsection "range-model-protocol" } ;
|
|
|
|
ARTICLE: "range-model-protocol" "Range model protocol"
|
|
"The range model protocol is implemented by the " { $link range } " and " { $link compose } " classes. User-defined models may implement it too."
|
|
{ $subsection range-value }
|
|
{ $subsection range-page-value }
|
|
{ $subsection range-min-value }
|
|
{ $subsection range-max-value }
|
|
{ $subsection range-max-value* }
|
|
{ $subsection set-range-value }
|
|
{ $subsection set-range-page-value }
|
|
{ $subsection set-range-min-value }
|
|
{ $subsection set-range-max-value } ;
|
|
|
|
ABOUT: "models-range"
|