Seeing a tuple now shows the constructor, browser tile toolbar fix

slava 2006-10-07 00:41:25 +00:00
parent 80a5ee7322
commit ce8ed04543
6 changed files with 11 additions and 13 deletions

View File

@ -12,7 +12,6 @@
- minibuffer should show a title - minibuffer should show a title
- clean up listener's minibuffer-related code - clean up listener's minibuffer-related code
- help search looks funny - help search looks funny
- parse errors: clickable pathnames
+ ui: + ui:

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
IN: generic IN: generic
USING: arrays definitions errors hashtables help kernel USING: arrays definitions errors hashtables help kernel
sequences words ; sequences words namespaces ;
PREDICATE: array method-spec PREDICATE: array method-spec
dup length 2 = [ dup length 2 = [
@ -56,7 +56,10 @@ M: generic subdefs
[ swap 2array ] map-with ; [ swap 2array ] map-with ;
M: class subdefs M: class subdefs
dup implementors natural-sort [ 2array ] map-with ; [
dup "constructor" word-prop [ , ] when*
dup implementors natural-sort [ 2array , ] each-with
] { } make ;
M: method-spec forget M: method-spec forget
first2 [ remove-hash ] with-methods ; first2 [ remove-hash ] with-methods ;

View File

@ -45,14 +45,10 @@ TUPLE: tile definition gadget ;
<default-border> dup faint-boundary ; <default-border> dup faint-boundary ;
C: tile ( definition -- gadget ) C: tile ( definition -- gadget )
2dup { tile } "Word commands" <toolbar> 2dup { tile } <toolbar>
<tile-content> over set-gadget-delegate <tile-content> over set-gadget-delegate
[ set-tile-definition ] keep ; [ set-tile-definition ] keep ;
tile "Tile commands" {
{ "Close" f [ close-tile ] }
} define-commands
: show-definition ( definition definitions -- ) : show-definition ( definition definitions -- )
2dup definition-index dup 0 >= [ 2dup definition-index dup 0 >= [
over nth-gadget swap scroll>rect drop over nth-gadget swap scroll>rect drop

View File

@ -207,9 +207,10 @@ M: operation invoke-command ( target operation -- )
! Define commands in terms of operations ! Define commands in terms of operations
! Tile commands ! Tile commands
tile "Word commands" tile "Toolbar"
\ word class-operations [ tile-definition ] modify-operations \ word class-operations [ tile-definition ] modify-operations
[ command-name "Browse" = not ] subset [ command-name "Browse" = not ] subset
{ "Close" f [ close-tile ] } add*
define-commands define-commands
! Interactor commands ! Interactor commands

View File

@ -12,7 +12,7 @@ gadgets-scrolling gadgets-panes gadgets-messages ;
C: tool ( gadget -- tool ) C: tool ( gadget -- tool )
{ {
{ {
[ dup dup class tool 2array "Toolbar" <toolbar> ] [ dup dup class tool 2array <toolbar> ]
f f
f f
@top @top

View File

@ -119,9 +119,8 @@ C: titled-gadget ( gadget title -- )
: restore-windows? ( -- ? ) : restore-windows? ( -- ? )
windows get [ empty? not ] [ f ] if* ; windows get [ empty? not ] [ f ] if* ;
: <toolbar> ( target classes group -- toolbar ) : <toolbar> ( target classes -- toolbar )
swap [ commands "Toolbar" swap hash ] map concat
[ commands hash ] map-with concat
[ <command-presentation> ] map-with [ <command-presentation> ] map-with
make-shelf ; make-shelf ;