Working on history popup

db4
Slava Pestov 2009-01-13 16:22:07 -06:00
parent 7e097aa713
commit a31b59748d
2 changed files with 11 additions and 0 deletions
basis/ui
gadgets/tables
tools/listener

View File

@ -229,9 +229,13 @@ M: table model-changed
[ >>mouse-index ] [ (select-row) ] bi
] if ;
PRIVATE>
: row-action ( table -- )
dup selected-row [ swap action>> call ] [ 2drop ] if ;
<PRIVATE
: table-button-up ( table -- )
hand-click# get 2 =
[ row-action ] [ update-selected-value ] if ;

View File

@ -485,6 +485,8 @@ M: completion-renderer row-value drop ;
completion-popup H{
{ T{ key-down f f "ESC" } [ hide-completion-popup ] }
{ T{ key-down f f "TAB" } [ table>> row-action ] }
{ T{ key-down f f " " } [ table>> row-action ] }
} set-gestures
: show-completion-popup ( interactor quot -- )
@ -498,6 +500,10 @@ completion-popup H{
[ vocabs-matching ] [ words-matching ] ?
show-completion-popup ;
: history-completion-popup ( interactor -- )
dup '[ _ history>> dup zip completions ]
show-completion-popup ;
: pass-to-popup? ( gesture interactor -- ? )
[ [ key-down? ] [ key-up? ] bi or ]
[ completion-popup>> ]
@ -512,4 +518,5 @@ M: interactor handle-gesture
interactor "completion" f {
{ T{ key-down f f "TAB" } word-completion-popup }
{ T{ key-down f { C+ } "p" } history-completion-popup }
} define-command-map