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

http://github.com/abeaumont/factor · Factor · 53 lines · 42 code · 11 blank · 0 comment · 0 complexity · 2e1fd2adcc7d1105a9c2684d8ab6a69f MD5 · raw file

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