1 ! Copyright (C) 2006 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: gadgets gadgets-panes gadgets-scrolling
5 kernel sequences models ;
9 : hide-all ( book -- ) gadget-children [ hide-gadget ] each ;
11 : current-page ( book -- gadget )
12 [ control-value ] keep nth-gadget ;
14 M: book model-changed ( book -- )
16 dup current-page show-gadget
20 C: book ( pages -- book )
21 dup 0 <model> <gadget> delegate>control
25 M: book pref-dim* gadget-children pref-dims max-dim ;
28 dup rect-dim swap gadget-children
29 [ set-layout-dim ] each-with ;
31 M: book focusable-child* current-page ;