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

53 lines
2.4 KiB
Factor
Raw Normal View History

USING: help.markup help.syntax models ui.gadgets.tracks ;
IN: ui.gadgets.layout
2009-05-25 16:29:44 -04:00
HELP: ,
2009-06-26 00:23:09 -04:00
{ $values { "item" "a gadget or model" } }
2009-05-25 16:29:44 -04:00
{ $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
HELP: ,%
{ $syntax "gadget ,% width" }
{ $description "Like ',' but stretches the gadget to always fill a percent of the parent" } ;
HELP: ->
{ $values { "uiitem" "a gadget or model" } { "model" model } }
{ $description "Like ',' but passes its model on for further use." } ;
HELP: ->%
{ $syntax "gadget ,% width" }
{ $description "Like '->' but stretches the gadget to always fill a percent of the parent" } ;
HELP: <spacer>
{ $description "Grows to fill any empty space in a box" } ;
HELP: <hbox>
{ $values { "gadgets" "a list of gadgets" } { "track" track } }
{ $syntax "[ gadget , gadget , ... ] <hbox>" }
{ $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
2009-06-26 00:23:09 -04:00
2009-05-25 16:29:44 -04:00
HELP: <vbox>
{ $values { "gadgets" "a list of gadgets" } { "track" track } }
{ $syntax "[ gadget , gadget , ... ] <hbox>" }
2009-06-26 00:23:09 -04:00
{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
HELP: $
{ $syntax "$ PLACEHOLDER-NAME $" }
{ $description "Defines an insertion point in a template named PLACEHOLDER-NAME which can be used by calling its name" } ;
HELP: with-interface
{ $values { "quot" "quotation that builds a template and inserts into it" } }
{ $description "Create templates, used with " { $link POSTPONE: $ } } ;
ARTICLE: "ui.gadgets.layout" "GUI Layout"
2009-06-26 00:23:09 -04:00
"Laying out GUIs works the same way as building lists with " { $vocab-link "make" }
". Gadgets are layed out using " { $vocab-link "ui.gadgets.tracks" } " through " { $link <hbox> } " and " { $link <vbox> } ", which allow both fixed and percentage widths. "
{ $link , } " and " { $link -> } " add a model or gadget to the gadget you're building. "
"Also, books can be made with " { $link <book> } ". "
2009-06-26 00:23:09 -04:00
{ $link <spacer> } "s add flexable space between items. " $nl
"Using " { $link with-interface } ", one can pre-build templates to add items to later: "
2009-07-22 10:46:52 -04:00
"Like in the StringTemplate framework for java, placeholders are defined using $ PLACERHOLDER-NAME $ "
2009-06-26 00:23:09 -04:00
"Using PLACEHOLDER-NAME again sets it as the current insertion point. "
2009-07-22 10:46:52 -04:00
"For examples using normal layout, see the " { $vocab-link "sudokus" } " demo. "
"For examples of templating, see the " { $vocab-link "recipes" } " demo. " ;
2009-06-26 00:23:09 -04:00
ABOUT: "ui.gadgets.layout"