]> gitweb.factorcode.org Git - factor.git/commitdiff
Minor UI documentation updates
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 7 Jan 2009 05:30:08 +0000 (23:30 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 7 Jan 2009 05:30:08 +0000 (23:30 -0600)
20 files changed:
basis/ui/gadgets/borders/borders-docs.factor
basis/ui/gadgets/buttons/buttons-docs.factor
basis/ui/gadgets/editors/editors-docs.factor
basis/ui/gadgets/labelled/labelled-docs.factor
basis/ui/gadgets/labels/labels-docs.factor
basis/ui/gadgets/lists/lists-docs.factor
basis/ui/gadgets/panes/panes-docs.factor
basis/ui/gadgets/presentations/presentations-docs.factor
basis/ui/gadgets/scrollers/scrollers-docs.factor
basis/ui/gadgets/sliders/sliders-docs.factor
basis/ui/gadgets/tables/table-demo.factor [deleted file]
basis/ui/gadgets/tables/tables-docs.factor [new file with mode: 0644]
basis/ui/tools/browser/browser-docs.factor [new file with mode: 0644]
basis/ui/tools/browser/browser.factor
basis/ui/tools/inspector/inspector-docs.factor [new file with mode: 0644]
basis/ui/tools/inspector/inspector.factor
basis/ui/tools/listener/listener-docs.factor [new file with mode: 0644]
basis/ui/tools/operations/operations.factor
basis/ui/tools/tools-docs.factor
basis/ui/ui-docs.factor

index c0274e3b458d16703faae3a2ae92f4c04757a97f..0f9be42d7ba7872ac75d60566aa96844014d2276 100644 (file)
@@ -9,7 +9,7 @@ HELP: <border>
 { $description "Creates a new border around the child with the specified horizontal and vertical gap." } ;
 
 ARTICLE: "ui.gadgets.borders" "Border gadgets"
-"Border gadgets add empty space around a child gadget."
+"The " { $vocab-link "ui.gadgets.borders" } " vocabulary implements border gadgets, which add empty space around a child gadget."
 { $subsection border }
 { $subsection <border> } ;
 
index 086ef2ca81939dbf8434e6a7064e8d1c262fb471..d6878517a13e8a41d09944ecc96e2f289a1a806f 100644 (file)
@@ -55,7 +55,7 @@ HELP: <toolbar>
 { $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" } "." } ;
 
 ARTICLE: "ui.gadgets.buttons" "Button gadgets"
-"Buttons respond to mouse clicks by invoking a quotation."
+"The " { $vocab-link "ui.gadgets.buttons" } " vocabulary implements buttons. Buttons respond to mouse clicks by invoking a quotation."
 { $subsection button }
 "There are many ways to create a new button:"
 { $subsection <button> }
index d749b8905c02ede603fb5eb5f6c5d0ddd47e6614..38f0bbba8873c1e9447972a9eb7607acca0f02a9 100644 (file)
@@ -81,13 +81,14 @@ ARTICLE: "gadgets-editors-selection" "The caret and mark"
 "Use " { $link user-input* } " to change selected text." ;
 
 ARTICLE: "gadgets-editors" "Editor gadgets"
-"An editor edits a multi-line passage of text."
+"The " { $vocab-link "ui.gadgets.editors" } " vocabulary implements editor gadgets. An editor edits a passage of text."
 { $command-map editor "general" }
 { $command-map editor "caret-motion" }
 { $command-map editor "selection" }
 { $heading "Editor words" }
 { $subsection editor }
 { $subsection <editor> }
+{ $subsection <multiline-editor> }
 { $subsection editor-string }
 { $subsection set-editor-string }
 { $subsection "gadgets-editors-selection" }
index 4ad14abfd175b2def24e982247ce73e00e253287..6b7d948ae1325872039b66acda5de637c36a376b 100644 (file)
@@ -24,7 +24,7 @@ HELP: <labelled-pane>
 { <labelled-pane> <pane-control> } related-words
 
 ARTICLE: "ui.gadgets.labelled" "Labelled gadgets"
-"It is possible to create a labelled border around a child gadget:"
+"The " { $vocab-link "ui.gadgets.labelled" } " vocabulary implements labelled borders around child gadgets."
 { $subsection labelled-gadget }
 { $subsection <labelled-gadget> }
 "Or a labelled border with a close box:"
index 8a63900d4d1220b1e1aa12f8528a567100e6296a..ed4278e2cd765b9e6277f0d55432aec886442a43 100644 (file)
@@ -24,7 +24,7 @@ HELP: <label-control>
 { <label> <label-control> } related-words
 
 ARTICLE: "ui.gadgets.labels" "Label gadgets"
-"A label displays a piece of text, either a single line string or an array of line strings."
+"The " { $vocab-link "ui.gadgets.labels" } " vocabulary implements labels. A label displays a piece of text, either a single line string or an array of line strings."
 { $subsection label }
 { $subsection <label> }
 { $subsection <label-control> }
index 6341e0950586dc6df0334ee0a868363bc61ecabe..90038367945c392c9a7956608ccc9e1798c16bda 100644 (file)
@@ -24,7 +24,7 @@ HELP: list-value
 { $description "Outputs the currently selected list value." } ;
 
 ARTICLE: "ui.gadgets.lists" "List gadgets"
-"A list displays a list of presentations."
+"The " { $vocab-link "ui.gadgets.lists" } " vocabulary implements lists, which displays a list of presentations (see " { $link "ui.gadgets.presentations" } ")."
 { $subsection list }
 { $subsection <list> }
 { $subsection list-value } ;
index 23dc99da82124b3d0305f6d075ab7fb94c7e3d97..6718f9b7d80302a94a8c15c89f9a3d756e3a65a0 100644 (file)
@@ -56,7 +56,7 @@ HELP: <pane-stream>
 { with-pane make-pane } related-words
 
 ARTICLE: "ui.gadgets.panes" "Pane gadgets"
-"A pane displays formatted text."
+"The " { $vocab-link "ui.gadgets.panes" } " vocabulary implements panes, which display formatted text."
 { $subsection pane }
 { $subsection <pane> }
 { $subsection <scrolling-pane> }
index 005fa1e7fe61b6a75732dd01508ee0d2824a41b6..88eb66129d2d0cb4c32b8164fbb0c5c3eeb9a80f 100644 (file)
@@ -42,9 +42,10 @@ HELP: show-mouse-help
 { $description "Displays a " { $link summary } " of the " { $snippet "object" } "in the status bar of the " { $link world } " containing this presentation. This word is executed when the mouse enters the presentation." } ;
 
 ARTICLE: "ui.gadgets.presentations" "Presentation gadgets"
-"Outliner gadgets are usually not constructed directly, and instead are written to " { $link "ui.gadgets.panes" } " with formatted stream output words (" { $link "presentations" } ")."
+"The " { $vocab-link "ui.gadgets.presentations" } " vocabulary implements presentations, which are graphical representations of an object, associated with the object itself (see " { $link "ui-operations" } ")."
+$nl
+"Clicking a presentation with the left mouse button invokes the object's primary operation, and clicking with the right mouse button displays a menu of all applicable operations. Presentations are usually not constructed directly, and instead are written to " { $link "ui.gadgets.panes" } " with formatted stream output words (see " { $link "presentations" } ")."
 { $subsection presentation }
-{ $subsection <presentation> }
-"Presentations remember the object they are presenting; operations can be performed on the presented object. See " { $link "ui-operations" } "." ;
+{ $subsection <presentation> } ;
 
 ABOUT: "ui.gadgets.presentations"
index b248527c37db4629c2f8bab8c3a7a4ddf143bc78..b6e0c6691b0e6a0e816525d245cbf03a0f79c6ee 100644 (file)
@@ -44,7 +44,7 @@ HELP: scroll>top
 { $description "Ensures that any scroller containing " { $snippet "gadget" } " is scrolled all the way up. If no parent of " { $snippet "scroller" } " is a gadget, does nothing." } ;
 
 ARTICLE: "ui.gadgets.scrollers" "Scroller gadgets"
-"A scroller displays a gadget which is larger than the visible area."
+"The " { $vocab-link "ui.gadgets.scrollers" } " vocabulary implements scroller gadgets. A scroller displays a gadget which is larger than the visible area."
 { $subsection scroller }
 { $subsection <scroller> }
 "Getting and setting the scroll position:"
index c130c724d0eef790829c7ecee21eb6698d03d2de..6f107b4e423ad1081794a4f731b4ec508d46471b 100644 (file)
@@ -48,7 +48,7 @@ HELP: <y-slider>
 { <x-slider> <y-slider> } related-words
 
 ARTICLE: "ui.gadgets.sliders" "Slider gadgets"
-"A slider allows the user to graphically manipulate a value by moving a thumb back and forth."
+"The " { $vocab-link "ui.gadgets.sliders" } " vocabulary implements slider gadgets. A slider allows the user to graphically manipulate a value by moving a thumb back and forth."
 { $subsection slider }
 { $subsection <x-slider> }
 { $subsection <y-slider> }
diff --git a/basis/ui/gadgets/tables/table-demo.factor b/basis/ui/gadgets/tables/table-demo.factor
deleted file mode 100644 (file)
index 3de3701..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-USING: accessors arrays effects help kernel locals models
-present prettyprint ui ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.tables ui.gadgets.tracks vocabs models.filter
-ui.gadgets.search-tables sequences fry ;
-IN: scratchpad
-
-SINGLETON: word-renderer
-M: word-renderer row-columns
-    drop
-    [ name>> ] [ stack-effect present ] 
-    bi 2array ;
-
-SINGLETON: vocab-renderer
-M: vocab-renderer row-columns
-    drop vocab-name
-    1array ;
-
-: search-vocabs ( vocabs search -- vocabs' )
-    '[ _ swap subseq? ] filter [ >vocab-link ] map ;
-
-: <vocabs-table> ( in-model -- gadget )
-    vocabs <model> [ search-vocabs ] <search-table>
-        vocab-renderer >>renderer
-        swap >>selected-value
-    "Vocabularies" <labelled-gadget> ;
-
-: search-words ( words search -- words' )
-    '[ _ swap name>> subseq? ] filter ;
-
-: <vocab-table> ( out-model in-model -- gadget )
-    [ words natural-sort ] <filter>
-    [ search-words ] <search-table>
-        word-renderer >>renderer
-        swap >>selected-value
-    "Words" <labelled-gadget> ;
-
-: table-demo ( -- )
-    [let | m [ f <model> ] m' [ f <model> ] |
-        { 1 0 } <track>
-            { 0 1 } <track>
-                m <vocabs-table> 1/2 track-add
-                m' m <vocab-table> 1/2 track-add
-            1/3 track-add
-            { m' m } <compose>
-            [ first2 or [ help ] when* ] <pane-control> <scroller>
-            "Definition" <labelled-gadget> 2/3 track-add
-        "Hi" open-status-window
-    ] ;
\ No newline at end of file
diff --git a/basis/ui/gadgets/tables/tables-docs.factor b/basis/ui/gadgets/tables/tables-docs.factor
new file mode 100644 (file)
index 0000000..b499faa
--- /dev/null
@@ -0,0 +1,10 @@
+USING: help.markup help.syntax ;
+IN: ui.gadgets.tables
+
+ARTICLE: "ui.gadgets.tables" "Table gadgets"
+"The " { $vocab-link "ui.gadgets.tables" } " vocabulary implements table gadgets. Table gadgets display a grid of values, with each row's columns generated by a renderer object."
+{ $subsection table }
+"Creating new tables:"
+{ $subsection <table> } ;
+
+ABOUT: "ui.gadgets.tables"
\ No newline at end of file
diff --git a/basis/ui/tools/browser/browser-docs.factor b/basis/ui/tools/browser/browser-docs.factor
new file mode 100644 (file)
index 0000000..db7ce5c
--- /dev/null
@@ -0,0 +1,11 @@
+USING: help.markup help.syntax ui.commands ;
+IN: ui.tools.browser
+
+ARTICLE: "ui-browser" "UI browser"
+"The browser is used to display Factor code, documentation, and vocabularies."
+{ $command-map browser-gadget "toolbar" }
+{ $command-map browser-gadget "scrolling" }
+{ $command-map browser-gadget "multi-touch" }
+"Browsers are instances of " { $link browser-gadget } "." ;
+
+ABOUT: "ui-browser"
\ No newline at end of file
index 40ba6de60c129df6cfd401443bc5051082aa55a3..1f82b7fc2695bf02e9ddb117b983926c889ac475 100644 (file)
@@ -97,7 +97,7 @@ browser-gadget "multi-touch" f {
 } define-command-map
 
 browser-gadget "scrolling"
-"The browser's scroll pane can be scrolled from the keyboard."
+"The browser's scroller can be scrolled from the keyboard."
 {
     { T{ key-down f f "UP" } com-scroll-up }
     { T{ key-down f f "DOWN" } com-scroll-down }
diff --git a/basis/ui/tools/inspector/inspector-docs.factor b/basis/ui/tools/inspector/inspector-docs.factor
new file mode 100644 (file)
index 0000000..6adf317
--- /dev/null
@@ -0,0 +1,22 @@
+USING: help.markup help.syntax ui.commands ui.gadgets.slots
+ui.gadgets.editors ;
+IN: ui.tools.inspector
+
+ARTICLE: "ui-inspector" "UI inspector"
+"The graphical inspector provides functionality similar to the terminal inspector (see " { $link "inspector" } "), adding in-place editing of slot values."
+$nl
+"To display an object in the UI inspector, right-click a presentation and choose " { $strong "Inspector" } " from the menu that appears."
+$nl
+"The inspector embeds a table gadget, which supports keyboard navigation; see " { $link "ui.gadgets.tables" } ". It also provides a few other commands:"
+{ $command-map inspector-gadget "toolbar" }
+{ $command-map inspector-gadget "multi-touch" }
+"Slot values can be edited in the inspector. Clicking the ellipsis to the left of the slot's textual representation displays a slot editor gadget. A text representation of the object can be edited in the slot editor. The parser is used to turn the text representation back into an object. Keep in mind that some structure is lost in the conversion; see " { $link "prettyprint-limitations" } "."
+$nl
+"The slot editor's text editing commands are standard; see " { $link "gadgets-editors" } "."
+$nl
+"The slot editor has a toolbar containing various commands."
+{ $command-map slot-editor "toolbar" }
+"The following commands are also available."
+{ $command-map source-editor "word" } ;
+
+ABOUT: "ui-inspector"
\ No newline at end of file
index 790275294c2fe15aae71624ac00ad344d1afe957..3b356f4d7f98700a7fa533963023be003c2b4471 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors inspector namespaces kernel models
 models.filter prettyprint sequences mirrors assocs classes
-io io.styles
+io io.styles arrays
 ui.tools.browser ui.commands ui.gadgets ui.gadgets.panes
 ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks
 ui.gestures ui.gadgets.buttons ui.gadgets.tables
@@ -11,10 +11,15 @@ IN: ui.tools.inspector
 
 TUPLE: inspector-gadget < track table ;
 
+TUPLE: slot-description key key-string value value-string ;
+
+: <slot-description> ( key value -- slot-description )
+    [ dup unparse-short ] bi@ slot-description boa ;
+
 SINGLETON: inspector-renderer
 
 M: inspector-renderer row-columns
-    drop [ unparse-short ] map ;
+    drop [ key-string>> ] [ value-string>> ] bi 2array ;
 
 : <summary-gadget> ( model -- gadget )
     [
@@ -40,11 +45,14 @@ M: inspector-renderer row-columns
         ] tabular-output
     ] <pane-control> ;
 
-DEFER: inspector-window
+DEFER: inspector
+
+: make-slot-descriptions ( obj -- seq )
+    make-mirror [ <slot-description> ] { } assoc>map ;
 
 : <inspector-table> ( model -- table )
-    [ make-mirror >alist ] <filter> <table>
-        [ second inspector-window ] >>action
+    [ make-slot-descriptions ] <filter> <table>
+        [ value>> inspector ] >>action
         inspector-renderer >>renderer
         monospace-font >>font ;
 
@@ -80,5 +88,5 @@ inspector-gadget "toolbar" f {
     { T{ key-down f f "F1" } inspector-help }
 } define-command-map
 
-: inspector-window ( obj -- )
+: inspector ( obj -- )
     <inspector-gadget> "Inspector" open-status-window ;
\ No newline at end of file
diff --git a/basis/ui/tools/listener/listener-docs.factor b/basis/ui/tools/listener/listener-docs.factor
new file mode 100644 (file)
index 0000000..c7f8cfe
--- /dev/null
@@ -0,0 +1,22 @@
+USING: help.markup help.syntax ui.commands ui.tools.interactor
+ui.gadgets.editors ui.gadgets.panes ;
+IN: ui.tools.listener
+
+ARTICLE: "ui-listener" "UI listener"
+"The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds the following features:"
+{ $list
+    "Input history"
+    { "Completion (see " { $link "ui-completion" } ")" }
+    { "Clickable presentations (see " { $link "ui-presentations" } ")" }
+}
+{ $command-map listener-gadget "toolbar" }
+{ $command-map listener-gadget "scrolling" }
+{ $command-map interactor "interactor" }
+{ $command-map source-editor "word" }
+{ $command-map interactor "quotation" }
+{ $heading "Editing commands" }
+"The text editing commands are standard; see " { $link "gadgets-editors" } "."
+{ $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 } ")." ;
+
+ABOUT: "ui-listener"
\ No newline at end of file
index 83357d762d99e77367858449b7c780a1a71c7fa9..2d471cdd4cc9ab60a51b858b8943ca431e87e8a0 100644 (file)
@@ -16,9 +16,8 @@ IN: ui.tools.operations
 V{ } clone operations set-global
 
 ! Objects
-[ drop t ] \ inspector-window H{
+[ drop t ] \ inspector H{
     { +primary+ t }
-    { +listener+ t }
 } define-operation
 
 : com-prettyprint ( obj -- ) . ;
index 416f6b46cef3125b3c8d73c96ceb5bc308525d50..1b74112babeb8dc5749113ca602441fc2d68d38a 100644 (file)
@@ -18,47 +18,6 @@ $nl
 $nl
 "Presentation gadgets can be constructed directly using the " { $link <presentation> } " word, and they can also be written to " { $link pane } " gadgets using the " { $link write-object } " word." ;
 
-ARTICLE: "ui-listener" "UI listener"
-"The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds the following features:"
-{ $list
-    "Input history"
-    { "Completion (see " { $link "ui-completion" } ")" }
-    { "Clickable presentations (see " { $link "ui-presentations" } ")" }
-}
-{ $command-map listener-gadget "toolbar" }
-{ $command-map listener-gadget "scrolling" }
-{ $command-map interactor "interactor" }
-{ $command-map source-editor "word" }
-{ $command-map interactor "quotation" }
-{ $heading "Editing commands" }
-"The text editing commands are standard; see " { $link "gadgets-editors" } "."
-{ $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 } ")." ;
-
-ARTICLE: "ui-inspector" "UI inspector"
-"The graphical inspector builds on the terminal inspector (see " { $link "inspector" } ") and provides in-place editing of slot values."
-$nl
-"To display an object in the UI inspector, use the " { $link inspect } " word from the UI listener, or right-click a presentation and choose " { $strong "Inspect" } " from the menu that appears."
-$nl
-"When the UI inspector is running, all of the terminal inspector words are available, such as " { $link &at } " and " { $link &put } ". Changing slot values using terminal inspector words automatically updates the UI inspector display."
-$nl
-"Slots can also be edited graphically. Clicking the ellipsis to the left of the slot's textual representation displays a slot editor gadget. A text representation of the object can be edited in the slot editor. The parser is used to turn the text representation back into an object. Keep in mind that some structure is lost in the conversion; see " { $link "prettyprint-limitations" } "."
-$nl
-"The slot editor's text editing commands are standard; see " { $link "gadgets-editors" } "."
-$nl
-"The slot editor has a toolbar containing various commands."
-{ $command-map slot-editor "toolbar" }
-{ $command-map inspector-gadget "multi-touch" }
-"The following commands are also available."
-{ $command-map source-editor "word" } ;
-
-ARTICLE: "ui-browser" "UI browser"
-"The browser is used to display Factor code, documentation, and vocabularies."
-{ $command-map browser-gadget "toolbar" }
-{ $command-map browser-gadget "scrolling" }
-{ $command-map browser-gadget "multi-touch" }
-"Browsers are instances of " { $link browser-gadget } "." ;
-
 ARTICLE: "ui-profiler" "UI profiler" 
 "The graphical profiler is based on the terminal profiler (see " { $link "profiling" } ") and adds more convenient browsing of profiler results."
 $nl
index 64a98fee0392bec439bb9b6b3207c3824fa0fd3f..7025ccf268e5866d6cb17b0e4843a8f73f94e409 100644 (file)
@@ -98,7 +98,8 @@ ARTICLE: "gadgets" "Pre-made UI gadgets"
 { $subsection "ui.gadgets.menus" }
 { $subsection "ui.gadgets.panes" }
 { $subsection "ui.gadgets.presentations" }
-{ $subsection "ui.gadgets.lists" } ;
+{ $subsection "ui.gadgets.lists" }
+{ $subsection "ui.gadgets.tables" } ;
 
 ARTICLE: "ui-geometry" "Gadget geometry"
 "The " { $link gadget } " class inherits from the " { $link rect } " class, and thus all gadgets have a bounding box:"