]> gitweb.factorcode.org Git - factor.git/blob - extra/ui/gadgets/frames/frames-docs.factor
Initial import
[factor.git] / extra / ui / gadgets / frames / frames-docs.factor
1 USING: help.syntax ui.gadgets kernel arrays quotations tuples
2 ui.gadgets.grids ui.gadgets.frames ;
3 IN: help.markup
4
5 : $ui-frame-constant ( element -- )
6     drop
7     { $description "Symbolic constant for a common input to " { $link grid-add } " and " { $link frame, } "." } print-element ;
8
9 HELP: @center $ui-frame-constant ;
10 HELP: @left $ui-frame-constant ;
11 HELP: @right $ui-frame-constant ;
12 HELP: @top $ui-frame-constant ;
13 HELP: @bottom $ui-frame-constant ;
14 HELP: @top-left $ui-frame-constant ;
15 HELP: @top-right $ui-frame-constant ;
16 HELP: @bottom-left $ui-frame-constant ;
17 HELP: @bottom-right $ui-frame-constant ;
18
19 HELP: frame
20 { $class-description "A frame is a gadget which lays out its children in a 3x3 grid. If the frame is enlarged past its preferred size, the center gadget fills up available room."
21 $nl
22 "Frames are constructed by calling " { $link <frame> } " and since they delegate to " { $link grid } " instances, children can be managed with " { $link grid-add } " and " { $link grid-remove } "." } ;
23
24 HELP: <frame>
25 { $values { "frame" frame } }
26 { $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." } ;
27
28 { <frame> make-frame build-frame } related-words
29
30 HELP: make-frame
31 { $values { "quot" quotation } { "frame" frame } }
32 { $description "Creates a new frame. The quotation can add children by calling the " { $link frame, } " word." } ;
33
34 HELP: build-frame
35 { $values { "tuple" tuple } { "quot" quotation } }
36 { $description "Creates a new frame and sets " { $snippet "tuple" } "'s delegate to the new frame. The quotation can add children by calling the " { $link frame, } " word, and access the frame by calling " { $link g } " or " { $link g-> } "." } ;
37
38 HELP: frame,
39 { $values { "gadget" gadget } { "i" "non-negative integer" } { "j" "non-negative integer" } }
40 { $description "Adds a child gadget at the specified location. This word can only be called inside the quotation passed to " { $link make-frame } " or " { $link build-frame } "." } ;
41
42 { grid frame } related-words