]> gitweb.factorcode.org Git - factor.git/blob - basis/models/range/range-docs.factor
7e205157f29447e6e36cef27f6b547d6588b7ffe
[factor.git] / basis / models / range / range-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple\r
2 calendar models ;\r
3 IN: models.range\r
4 \r
5 HELP: range\r
6 { $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> } "." }\r
7 { $notes { $link "ui.gadgets.sliders" } " use range models." } ;\r
8 \r
9 HELP: <range>\r
10 { $values { "value" real } { "page" real } { "min" real } { "max" real } { "step" real } { "range" range } }\r
11 { $description "Creates a new " { $link range } " model." } ;\r
12 \r
13 HELP: range-model\r
14 { $values { "range" range } { "model" model } }\r
15 { $description "Outputs a model holding a range model's current value." }\r
16 { $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;\r
17 \r
18 HELP: range-min\r
19 { $values { "range" range } { "model" model } }\r
20 { $description "Outputs a model holding a range model's minimum value." }\r
21 { $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;\r
22 \r
23 HELP: range-max\r
24 { $values { "range" range } { "model" model } }\r
25 { $description "Outputs a model holding a range model's maximum value." }\r
26 { $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;\r
27 \r
28 HELP: range-page\r
29 { $values { "range" range } { "model" model } }\r
30 { $description "Outputs a model holding a range model's page size." }\r
31 { $notes "This word is not part of the " { $link "range-model-protocol" } ", and can only be used on direct instances of " { $link range } "." } ;\r
32 \r
33 HELP: move-by\r
34 { $values { "amount" real } { "range" range } }\r
35 { $description "Adds a number to a range model's current value." }\r
36 { $side-effects "range" } ;\r
37 \r
38 HELP: move-by-page\r
39 { $values { "amount" real } { "range" range } }\r
40 { $description "Adds a multiple of the page size to a range model's current value." }\r
41 { $side-effects "range" } ;\r
42 \r
43 ARTICLE: "models-range" "Range models"\r
44 "Range models ensure their value is a real number within a fixed range."\r
45 { $subsections\r
46     range\r
47     <range>\r
48 }\r
49 "Range models conform to a protocol for getting and setting the current value, as well as the endpoints of the range."\r
50 { $subsections "range-model-protocol" } ;\r
51 \r
52 ARTICLE: "range-model-protocol" "Range model protocol"\r
53 "The range model protocol is implemented by the " { $link range } " and " { $link compose } " classes. User-defined models may implement it too."\r
54 { $subsections\r
55     range-value\r
56     range-page-value\r
57     range-min-value\r
58     range-max-value\r
59     range-max-value*\r
60     set-range-value\r
61     set-range-page-value\r
62     set-range-min-value \r
63     set-range-max-value \r
64 } ;\r
65 \r
66 ABOUT: "models-range"\r