]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/scrollers/scrollers-docs.factor
Fix permission bits
[factor.git] / basis / ui / gadgets / scrollers / scrollers-docs.factor
1 USING: ui.gadgets help.markup help.syntax ui.gadgets.viewports
2 ui.gadgets.sliders math.geometry.rect ;
3 IN: ui.gadgets.scrollers
4
5 HELP: scroller
6 { $class-description "A scroller consists of a " { $link viewport } " containing a child, together with horizontal and vertical " { $link slider } " gadgets which scroll the viewport's child. Scroller gadgets also support using a mouse scroll wheel."
7 $nl
8 "Scroller gadgets are created by calling " { $link <scroller> } "." } ;
9
10 HELP: find-scroller
11 { $values { "gadget" gadget } { "scroller/f" "a " { $link scroller } " or " { $link f } } }
12 { $description "Finds the first parent of " { $snippet "gadget" } " which is a " { $link scroller } ". Outputs " { $link f } " if the gadget is not contained in a " { $link scroller } "." } ;
13
14 HELP: scroller-value
15 { $values { "scroller" scroller } { "loc" "a pair of integers" } }
16 { $description "Outputs the offset of the top-left corner of the scroller's " { $link viewport } "'s child." } ;
17
18 { scroller-value scroll scroll>bottom scroll>top scroll>rect } related-words
19
20 HELP: <scroller>
21 { $values { "gadget" gadget } { "scroller" "a new " { $link scroller } } }
22 { $description "Creates a new " { $link scroller } " for scrolling around " { $snippet "gadget" } "." } ;
23
24 { <viewport> <scroller> } related-words
25
26 HELP: scroll
27 { $values { "scroller" scroller } { "value" "a pair of integers" } }
28 { $description "Sets the offset of the top-left corner of the scroller's " { $link viewport } "'s child." } ;
29
30 HELP: relative-scroll-rect
31 { $values { "rect" rect } { "gadget" gadget } { "scroller" scroller } { "newrect" "a new " { $link rect } } }
32 { $description "Adjusts " { $snippet "rect" } " for the case where the gadget is not the immediate child of the scroller's viewport." } ;
33
34 HELP: scroll>rect
35 { $values { "rect" rect } { "gadget" gadget } }
36 { $description "Ensures that a rectangular region relative to the top-left corner of " { $snippet "gadget" } " becomes visible in a " { $link scroller } " containing " { $snippet "gadget" } ". Does nothing if no parent of " { $snippet "gadget" } " is a " { $link scroller } "." } ;
37
38 HELP: scroll>bottom
39 { $values { "gadget" gadget } }
40 { $description "Ensures that any " { $link scroller } " containing " { $snippet "gadget" } " is scrolled all the way down. Does nothing if no parent of " { $snippet "gadget" } " is a " { $link scroller } "." } ;
41
42 HELP: scroll>top
43 { $values { "gadget" gadget } }
44 { $description "Ensures that any scroller containing " { $snippet "gadget" } " is scrolled all the way up. If no parent of " { $snippet "scroller" } " is a gadget, does nothing." } ;
45
46 ARTICLE: "ui.gadgets.scrollers" "Scroller gadgets"
47 "A scroller displays a gadget which is larger than the visible area."
48 { $subsection scroller }
49 { $subsection <scroller> }
50 "Getting and setting the scroll position:"
51 { $subsection scroller-value }
52 { $subsection scroll }
53 "Writing scrolling-aware gadgets:"
54 { $subsection scroll>bottom }
55 { $subsection scroll>top }
56 { $subsection scroll>rect }
57 { $subsection find-scroller } ;
58
59 ABOUT: "ui.gadgets.scrollers"