]> gitweb.factorcode.org Git - factor.git/blob - core/ui/gadgets/sliders.facts
more sql changes
[factor.git] / core / ui / gadgets / sliders.facts
1 IN: gadgets-sliders
2 USING: help gadgets gadgets-scrolling models ;
3
4 HELP: elevator
5 { $class-description "An elevator is the part of a " { $link slider } " between the up/down arrow buttons, where a " { $link thumb } " may be moved up and down." } ;
6
7 HELP: find-elevator
8 { $values { "gadget" gadget } { "elevator/f" "an " { $link elevator } " or " { $link f } } }
9 { $description "Finds the first parent of " { $snippet "gadget" } " which is an " { $link elevator } ". Outputs " { $link f } " if the gadget is not contained in an " { $link elevator } "." } ;
10
11 HELP: slider
12 { $class-description "A slider is a " { $link control } " for graphically manipulating a " { $link model } " whose value is an integer belonging to a certain range."
13 $terpri
14 "Sliders are created by calling " { $link <x-slider> } " or " { $link <y-slider> } ", and their canonical use-case is for scrolling; see " { $link scroller } "."
15 $terpri
16 "Sliders have the following slots:"
17 { $list
18     { { $link slider-max } " - maximum value, an integer" }
19     { { $link slider-line } " - amount to scroll when up/down arrows are clicked, an integer" }
20     { { $link slider-page } " - amount to scroll when paging areas above/below thumb are clicked, an integer" }
21 }
22 "They should not be changed directly; instead use " { $link set-slider } "." }
23 { $see-also set-slider-value set-slider slide-by slide-by-page } ;
24
25 HELP: find-slider
26 { $values { "gadget" gadget } { "slider/f" "a " { $link slider } " or " { $link f } } }
27 { $description "Finds the first parent of " { $snippet "gadget" } " which is a " { $link slider } ". Outputs " { $link f } " if the gadget is not contained in a " { $link slider } "." } ;
28
29 HELP: set-slider
30 { $values { "value" "a pair of integers" } { "page" "a pair of integers" } { "max" "a pair of integers" } { "slider" slider } }
31 { $description "Sets a slider's parameters all at once." }
32 { $see-also set-slider-value slide-by-page } ;
33
34 HELP: set-slider-value
35 { $values { "value" "a non-negative integer" } { "slider" slider } }
36 { $description "Sets a slider's current position." }
37 { $see-also set-slider slide-by slide-by-page } ;
38
39 HELP: thumb
40 { $class-description "A thumb is the gadget contained in a " { $link slider } "'s " { $link elevator } " which indicates the current scroll position and can be dragged up and down with the mouse." } ;
41
42 HELP: slide-by
43 { $values { "amount" "an integer" } { "slider" slider } }
44 { $description "Adds the amount (which may be positive or negative) to the slider's current position." }
45 { $see-also set-slider-value set-slider slide-by-page } ;
46
47 HELP: slide-by-page
48 { $values { "amount" "an integer" } { "slider" slider } }
49 { $description "Adds the amount multiplied by " { $link slider-page } " to the slider's current position." }
50 { $see-also set-slider-value set-slider slide-by-page } ;
51
52 HELP: slide-by-line
53 { $values { "amount" "an integer" } { "slider" slider } }
54 { $description "Adds the amount multiplied by " { $link slider-line } " to the slider's current position." }
55 { $see-also set-slider-value set-slider slide-by-page } ;
56
57 HELP: <slider>
58 { $values { "orientation" "either " { $snippet "{ 1 0 }" } " or " { $snippet "{ 0 1 }" } } { "slider" "a new " { $link slider } } }
59 { $description "Internal word for constructing sliders." }
60 { $notes "This does not build a complete slider, and user code should call " { $link <x-slider> } " or " { $link <y-slider> } " instead." } ;
61
62 HELP: <x-slider>
63 { $values { "slider" slider } }
64 { $description "Creates a new horizontal " { $link slider } "." }
65 { $see-also <y-slider> } ;
66
67 HELP: <y-slider>
68 { $values { "slider" slider } }
69 { $description "Creates a new horizontal " { $link slider } "." }
70 { $see-also <x-slider> } ;