factor/core/ui/gadgets/frames.facts

43 lines
1.8 KiB
Plaintext

IN: help
USING: gadgets kernel arrays ;
: $ui-frame-constant ( element -- )
drop
{ $description "Symbolic constant for a common input to " { $link grid-add } "." } print-element ;
IN: gadgets
HELP: @center $ui-frame-constant ;
HELP: @left $ui-frame-constant ;
HELP: @right $ui-frame-constant ;
HELP: @top $ui-frame-constant ;
HELP: @bottom $ui-frame-constant ;
HELP: @top-left $ui-frame-constant ;
HELP: @top-right $ui-frame-constant ;
HELP: @bottom-left $ui-frame-constant ;
HELP: @bottom-right $ui-frame-constant ;
HELP: frame
{ $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."
$terpri
"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 } "." }
{ $see-also delegate>frame make-frame make-frame* } ;
HELP: <frame>
{ $values { "frame" frame } }
{ $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." }
{ $see-also delegate>frame make-frame make-frame* } ;
HELP: delegate>frame
{ $values { "tuple" tuple } }
{ $description "Sets the tuple's delegate to a new " { $link frame } "." }
{ $side-effects "frame" } ;
HELP: make-frame
{ $values { "specs" array } { "frame" frame } }
{ $description "Creates a new frame from a declarative specification. See " { $link build-grid } " for a description of the format of " { $snippet "spec" } "." } ;
HELP: make-frame*
{ $values { "tuple" tuple } { "specs" array } { "frame" frame } }
{ $description "Creates a new frame from a declarative specification and sets " { $snippet "tuple" } "'s delegate to the new frame. See " { $link build-grid } " for a description of the format of " { $snippet "spec" } "." } ;