]> gitweb.factorcode.org Git - factor.git/blob - core/ui/gadgets/presentations.facts
a7f4b8bdff00747b6389bd4bda4046d810470156
[factor.git] / core / ui / gadgets / presentations.facts
1 IN: gadgets-presentations
2 USING: help gadgets gadgets-buttons gadgets-lists prettyprint
3 generic models ;
4
5 HELP: presentation
6 { $class-description "A presentation is a " { $link button } " which represents an object. Left-clicking a presentation invokes the default " { $link operation } ", and right-clicking displays a menu of possible operations output by " { $link object-operations } "."
7 $terpri
8 "Presentations are created by calling " { $link <presentation> } "."
9 $terpri
10 "Presentations have two slots:"
11 { $list
12     { { $link presentation-object } " - the object being presented." }
13     { { $link presentation-hook } " - a quotation with stack effect " { $snippet "( presentation -- )" } ". The default value is " { $snippet "[ drop ]" } "." }
14 } }
15 { $see-also "presentations" <command-button> } ;
16
17 HELP: invoke-presentation
18 { $values { "presentation" presentation } { "command" command } }
19 { $description "Calls the " { $link presentation-hook } " and then invokes the command on the " { $link presentation-object } "." }
20 { $see-also invoke-primary invoke-secondary } ;
21
22 HELP: invoke-primary
23 { $values { "presentation" presentation } } 
24 { $description "Invokes the " { $link primary-operation } " associated to the " { $link presentation-object } ". This word is executed when the presentation is clicked with the left mouse button." }
25 { $see-also invoke-secondary } ;
26
27 HELP: invoke-secondary
28 { $values { "presentation" presentation } } 
29 { $description "Invokes the " { $link secondary-operation } " associated to the " { $link presentation-object } ". This word is executed when a " { $link list } " receives a " { $snippet "RETURN" } " key press." }
30 { $see-also invoke-primary } ;
31
32 HELP: show-mouse-help
33 { $values { "presentation" presentation } }
34 { $description "Displays a " { $link summary } " of the " { $link presentation-object } "in the status bar of the " { $link world } " containing this presentation. This word is executed when the mouse enters the presentation." }
35 { $see-also hide-mouse-help } ;
36
37 HELP: hide-mouse-help
38 { $values { "presentation" presentation } }
39 { $description "Hides the status bar message from the status bar of the " { $link world } " containing this presentation. This word is executed when the mouse leaves the presentation." }
40 { $see-also show-mouse-help } ;
41
42 HELP: <presentation>
43 { $values { "label" "a label" } { "object" object } }
44 { $description "Creates a new " { $link presentation } " derived from " { $link <roll-button> } "." }
45 { $see-also "presentations" } ;
46
47 HELP: <command-button>
48 { $values { "target" object } { "command" command } { "button" "a new " { $link button } } }
49 { $description "Creates a " { $link <bevel-button> } " which invokes the command on " { $snippet "target" } " when clicked." }
50 { $see-also <button> <roll-button> <presentation> } ;
51
52 HELP: <toolbar>
53 { $values { "target" object } { "classes" "a sequence of class words" } }
54 { $description "Creates a row of " { $link <command-button> } " gadgets invoking commands on " { $snippet "target" } ". The commands are taken from the " { $snippet "\"toolbar\"" } " command group of each class in " { $snippet "classes" } "." }
55 { $see-also define-commands } ;
56
57 HELP: <commands-menu>
58 { $values { "hook" "a quotation with stack effect " { $snippet "( button -- )" } } { "target" object } { "commands" "a sequence of " { $link command } " instances" } { "gadget" "a new " { $link gadget } } }
59 { $description "Creates a popup menu of commands which are to be invoked on " { $snippet "target" } ". The " { $snippet "hook" } " quotation is run before a command is invoked." }
60 { $see-also <toolbar> operations-menu show-menu } ;
61
62 HELP: <presentation-help>
63 { $values { "model" model } }
64 { $description "Creates a new " { $link gadget } " displaying a " { $link summary } " of the model value." }
65 { $notes "If the " { $snippet "model" } " is " { $link world-status } ", this gadget will display " { $link presentation } " mouse over help." }
66 { $see-also show-mouse-help hide-mouse-help } ;