]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/frames/frames-docs.factor
36c7feed9701c1166f10d2f2c19ce2b89ea87d2a
[factor.git] / basis / ui / gadgets / frames / frames-docs.factor
1 USING: help.syntax help.markup ui.gadgets kernel arrays
2 quotations classes.tuple ui.gadgets.grids ;
3 IN: ui.gadgets.frames
4
5 ARTICLE: "ui-frame-layout" "Frame layouts"
6 "Frames resemble " { $link "ui-grid-layout" } " except the size of grid is fixed at 3x3, and the center gadget fills up any available space. Because frames inherit from grids, grid layout words can be used to add and remove children."
7 { $subsection frame }
8 "Creating empty frames:"
9 { $subsection <frame> }
10 "A set of mnemonic words for the positions on a frame's 3x3 grid; these words push values which may be passed to " { $link grid-add } ":"
11 { $subsection @center }
12 { $subsection @left }
13 { $subsection @right }
14 { $subsection @top }
15 { $subsection @bottom }
16 { $subsection @top-left }
17 { $subsection @top-right }
18 { $subsection @bottom-left }
19 { $subsection @bottom-right } ;
20
21 : $ui-frame-constant ( element -- )
22     drop
23     { $description "Symbolic constant for a common input to " { $link grid-add } "." } print-element ;
24
25 HELP: @center $ui-frame-constant ;
26 HELP: @left $ui-frame-constant ;
27 HELP: @right $ui-frame-constant ;
28 HELP: @top $ui-frame-constant ;
29 HELP: @bottom $ui-frame-constant ;
30 HELP: @top-left $ui-frame-constant ;
31 HELP: @top-right $ui-frame-constant ;
32 HELP: @bottom-left $ui-frame-constant ;
33 HELP: @bottom-right $ui-frame-constant ;
34
35 HELP: frame
36 { $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."
37 $nl
38 "Frames are constructed by calling " { $link <frame> } " and since they inherit from " { $link grid } ", children can be managed with " { $link grid-add } " and " { $link grid-remove } "." } ;
39
40 HELP: <frame>
41 { $values { "frame" frame } }
42 { $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." } ;
43
44 { grid frame } related-words
45
46 ABOUT: "ui-frame-layout"