PageRenderTime 36ms CodeModel.GetById 12ms app.highlight 21ms RepoModel.GetById 1ms app.codeStats 0ms

/unmaintained/ui/gadgets/layout/layout-docs.factor

http://github.com/abeaumont/factor
Unknown | 53 lines | 42 code | 11 blank | 0 comment | 0 complexity | 2e1fd2adcc7d1105a9c2684d8ab6a69f MD5 | raw file
 1USING: help.markup help.syntax models ui.gadgets.tracks ;
 2IN: ui.gadgets.layout
 3
 4HELP: ,
 5{ $values { "item" "a gadget or model" } }
 6{ $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
 7
 8HELP: ,%
 9{ $syntax "gadget ,% width" }
10{ $description "Like ',' but stretches the gadget to always fill a percent of the parent" } ;
11
12HELP: ->
13{ $values { "uiitem" "a gadget or model" } { "model" model } }
14{ $description "Like ',' but passes its model on for further use." } ;
15
16HELP: ->%
17{ $syntax "gadget ,% width" }
18{ $description "Like '->' but stretches the gadget to always fill a percent of the parent" } ;
19
20HELP: <spacer>
21{ $description "Grows to fill any empty space in a box" } ;
22
23HELP: <hbox>
24{ $values { "gadgets" "a list of gadgets" } { "track" track } }
25{ $syntax "[ gadget , gadget , ... ] <hbox>" }
26{ $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
27
28HELP: <vbox>
29{ $values { "gadgets" "a list of gadgets" } { "track" track } }
30{ $syntax "[ gadget , gadget , ... ] <hbox>" }
31{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
32
33HELP: $
34{ $syntax "$ PLACEHOLDER-NAME $" }
35{ $description "Defines an insertion point in a template named PLACEHOLDER-NAME which can be used by calling its name" } ;
36
37HELP: with-interface
38{ $values { "quot" "quotation that builds a template and inserts into it" } }
39{ $description "Create templates, used with " { $link POSTPONE: $ } } ;
40
41ARTICLE: "ui.gadgets.layout" "GUI Layout"
42"Laying out GUIs works the same way as building lists with " { $vocab-link "make" }
43". Gadgets are layed out using " { $vocab-link "ui.gadgets.tracks" } " through " { $link <hbox> } " and " { $link <vbox> } ", which allow both fixed and percentage widths. "
44{ $link , } " and " { $link -> }  " add a model or gadget to the gadget you're building. "
45"Also, books can be made with " { $link <book> } ". "
46{ $link <spacer> } "s add flexable space between items. " $nl
47"Using " { $link with-interface } ", one can pre-build templates to add items to later: "
48"Like in the StringTemplate framework for java, placeholders are defined using $ PLACERHOLDER-NAME $ "
49"Using PLACEHOLDER-NAME again sets it as the current insertion point. "
50"For examples using normal layout, see the " { $vocab-link "sudokus" } " demo. "
51"For examples of templating, see the " { $vocab-link "recipes" } " demo. " ;
52
53ABOUT: "ui.gadgets.layout"