ui.tools.inspector: clean up

db4
Slava Pestov 2009-02-17 08:26:33 -06:00
parent cf829ad3cf
commit f12b163a7b
2 changed files with 14 additions and 7 deletions

View File

@ -48,11 +48,17 @@ operations [ <linked-hash> ] initialize
: primary-operation ( obj -- operation ) : primary-operation ( obj -- operation )
[ command>> +primary+ word-prop ] find-operation ; [ command>> +primary+ word-prop ] find-operation ;
: invoke-primary-operation ( obj -- )
dup primary-operation invoke-command ;
: secondary-operation ( obj -- operation ) : secondary-operation ( obj -- operation )
dup dup
[ command>> +secondary+ word-prop ] find-operation [ command>> +secondary+ word-prop ] find-operation
[ ] [ primary-operation ] ?if ; [ ] [ primary-operation ] ?if ;
: invoke-secondary-operation ( obj -- )
dup secondary-operation invoke-command ;
: default-flags ( -- assoc ) : default-flags ( -- assoc )
H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ; H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ;

View File

@ -1,13 +1,12 @@
! Copyright (C) 2006, 2009 Slava Pestov. ! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors inspector namespaces kernel models fry USING: accessors inspector namespaces kernel models fry
models.filter prettyprint sequences mirrors assocs classes colors.constants models.filter prettyprint sequences mirrors assocs
io io.styles arrays hashtables math.order sorting refs fonts classes io io.styles arrays hashtables math.order sorting refs fonts
ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes
ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks ui.gestures
ui.gestures ui.gadgets.buttons ui.gadgets.tables ui.gadgets.buttons ui.gadgets.tables ui.gadgets.status-bar
ui.gadgets.status-bar ui.gadgets.labeled ui.gadgets.labeled ui.tools.common ui ;
ui.tools.common ui ;
IN: ui.tools.inspector IN: ui.tools.inspector
TUPLE: inspector-gadget < tool table ; TUPLE: inspector-gadget < tool table ;
@ -62,8 +61,10 @@ M: hashtable make-slot-descriptions
: <inspector-table> ( model -- table ) : <inspector-table> ( model -- table )
[ make-slot-descriptions ] <filter> inspector-renderer <table> [ make-slot-descriptions ] <filter> inspector-renderer <table>
[ dup primary-operation invoke-command ] >>action [ invoke-primary-operation ] >>action
monospace-font >>font monospace-font >>font
COLOR: dark-gray >>column-line-color
6 >>gap
15 >>min-rows 15 >>min-rows
15 >>max-rows 15 >>max-rows
40 >>min-cols 40 >>min-cols