Update ui.tools.listener docs

db4
Slava Pestov 2009-01-28 17:27:42 -06:00
parent 75e8c793d7
commit a98d59d93c
3 changed files with 7 additions and 15 deletions

View File

@ -133,7 +133,7 @@ CONSTANT: completion-popup-offset { -4 0 }
[ [ 2drop find-world ] [ 2nip ] [ completion-popup-loc ] 3tri ] 3bi [ [ 2drop find-world ] [ 2nip ] [ completion-popup-loc ] 3tri ] 3bi
show-glass ; show-glass ;
: word-completion-popup ( interactor -- ) : code-completion-popup ( interactor -- )
dup vocab-completion? dup vocab-completion?
[ vocabs-matching ] [ words-matching ] ? '[ [ { } ] _ if-empty ] [ vocabs-matching ] [ words-matching ] ? '[ [ { } ] _ if-empty ]
one-word-elt show-completion-popup ; one-word-elt show-completion-popup ;

View File

@ -9,26 +9,18 @@ $nl
$nl $nl
"Interactors implement the " { $link stream-readln } ", " { $link stream-read } " and " { $link read-quot } " generic words." } ; "Interactors implement the " { $link stream-readln } ", " { $link stream-read } " and " { $link read-quot } " generic words." } ;
ARTICLE: "ui-listener-completion" "Word and vocabulary completion"
"The listener is great"
;
ARTICLE: "ui-listener" "UI listener" ARTICLE: "ui-listener" "UI listener"
"The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds the following features:" "The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds an input history, and word and vocabulary completion."
{ $list
"Input history"
{ "Completion (see " { $link "ui-listener-completion" } ")" }
{ "Clickable presentations (see " { $link "ui-presentations" } ")" }
}
{ $command-map listener-gadget "toolbar" } { $command-map listener-gadget "toolbar" }
{ $command-map listener-gadget "scrolling" } { $command-map interactor "completion" }
{ $command-map listener-gadget "multi-touch" }
{ $command-map interactor "interactor" } { $command-map interactor "interactor" }
{ $command-map source-editor "word" } { $command-map source-editor "word" }
{ $command-map interactor "quotation" } { $command-map interactor "quotation" }
{ $command-map listener-gadget "scrolling" }
{ $command-map listener-gadget "multi-touch" }
{ $heading "Editing commands" } { $heading "Editing commands" }
"The text editing commands are standard; see " { $link "gadgets-editors" } "." "The text editing commands are standard; see " { $link "gadgets-editors" } "."
{ $heading "Implementation" } { $heading "Implementation" }
"Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } ")." ; "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
ABOUT: "ui-listener" ABOUT: "ui-listener"

View File

@ -340,7 +340,7 @@ interactor "interactor" f {
} define-command-map } define-command-map
interactor "completion" f { interactor "completion" f {
{ T{ key-down f f "TAB" } word-completion-popup } { T{ key-down f f "TAB" } code-completion-popup }
{ T{ key-down f { C+ } "p" } recall-previous } { T{ key-down f { C+ } "p" } recall-previous }
{ T{ key-down f { C+ } "n" } recall-next } { T{ key-down f { C+ } "n" } recall-next }
{ T{ key-down f { C+ } "r" } history-completion-popup } { T{ key-down f { C+ } "r" } history-completion-popup }