factor/basis/ui/gadgets/packs/packs-tests.factor

36 lines
808 B
Factor
Raw Normal View History

USING: ui.gadgets.packs ui.gadgets.packs.private ui.gadgets.labels
ui.gadgets ui.gadgets.debug ui.render kernel namespaces tools.test
math.parser sequences math.rectangles accessors ;
2008-03-01 17:00:45 -05:00
IN: ui.gadgets.packs.tests
2007-09-20 18:09:08 -04:00
[ t ] [
{ 0 0 } { 100 100 } <rect> clip set
2008-07-14 16:11:58 -04:00
<pile>
100 [ number>string <label> add-gadget ] each
2007-09-20 18:09:08 -04:00
dup layout
visible-children [ label? ] all?
] unit-test
[ { { 10 30 } } ] [
{ { 10 20 } }
{ { 100 30 } }
<gadget> vertical >>orientation
orient
] unit-test
<shelf> +baseline+ >>align
5 { 10 10 } <baseline-gadget> add-gadget
10 { 10 10 } <baseline-gadget> add-gadget
"g" set
[ ] [ "g" get prefer ] unit-test
[ { 20 15 } ] [ "g" get dim>> ] unit-test
[ V{ { 0 5 } { 10 0 } } ] [
"g" get
dup layout
children>> [ loc>> ] map
] unit-test