ui.tools.common: reuse code.

db4
John Benediktsson 2014-04-28 13:01:18 -07:00
parent 1fdc965b34
commit c6f8a84ee4
1 changed files with 8 additions and 4 deletions
basis/ui/tools/common

View File

@ -9,18 +9,22 @@ SYMBOL: tool-dims
tool-dims [ H{ } clone ] initialize
: set-tool-dim ( dim class -- )
tool-dims get-global set-at ;
: get-tool-dim ( class -- dim )
tool-dims get-global at ;
TUPLE: tool < track ;
M: tool pref-dim*
{ [ class-of tool-dims get-global at ] [ call-next-method ] } 1|| ;
{ [ class-of get-tool-dim ] [ call-next-method ] } 1|| ;
M: tool layout*
[ call-next-method ]
[ [ dim>> ] [ class-of ] bi tool-dims get-global set-at ]
[ [ dim>> ] [ class-of ] bi set-tool-dim ]
bi ;
: set-tool-dim ( dim class -- ) tool-dims get-global set-at ;
SLOT: scroller
: com-page-up ( tool -- )