]> gitweb.factorcode.org Git - factor.git/blob - basis/models/product/product-docs.factor
29b26159a778fcc0100ca16ab76019bdfa1fe85b
[factor.git] / basis / models / product / product-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple\r
2 calendar models ;\r
3 IN: models.product\r
4 \r
5 HELP: product\r
6 { $class-description "Product model values are computed by collecting the values from a sequence of underlying models into a new sequence. Product models are automatically updated when underlying models change. Product models are constructed by " { $link <product> } "."\r
7 $nl\r
8 "A product model whose children are all " { $link "models-range" } " conforms to the " { $link "range-model-protocol" } " and represents a point in n-dimensional space which is bounded by a rectangle." }\r
9 { $examples\r
10     "The following code displays a pair of sliders, and an updating label showing their current values:"\r
11     { $code\r
12         "USING: models models.product models.range ui.gadgets"\r
13         "ui.gadgets.labels ui.gadgets.packs ui.gadgets.panes"\r
14         "ui.gadgets.sliders ;"\r
15         ""\r
16         ": <funny-model> ( -- model ) 0 10 0 100 1 <range> ;"\r
17         ": <funny-slider> ( model -- slider ) horizontal <slider> ;"\r
18         ""\r
19         "<funny-model> <funny-model> 2array"\r
20         "[ <pile> [ horizontal <slider> add-gadget ] reduce gadget. ]"\r
21         "[ <product> [ unparse ] <arrow> <label-control> gadget. ]"\r
22         "bi"\r
23     }\r
24 } ;\r
25 \r
26 HELP: <product>\r
27 { $values { "models" "a sequence of models" } { "product" "a new " { $link product } } }\r
28 { $description "Creates a new instance of " { $link product } ". The value of the new product model is obtained by mapping the " { $snippet "value" } " slot accessor over the given sequence of models." }\r
29 { $examples "See the example in the documentation for " { $link product } "." } ;\r
30 \r
31 ARTICLE: "models.product" "Product models"\r
32 "Product model values are computed by collecting the values from a sequence of underlying models into a new sequence."\r
33 { $subsections\r
34     product\r
35     <product>\r
36 } ;\r
37 \r
38 ABOUT: "models.product"\r