]> gitweb.factorcode.org Git - factor.git/commitdiff
frp documentation updated
authorSam Anklesaria <sam@Tintin.local>
Fri, 26 Jun 2009 04:23:09 +0000 (23:23 -0500)
committerSam Anklesaria <sam@Tintin.local>
Fri, 26 Jun 2009 04:23:09 +0000 (23:23 -0500)
extra/ui/frp/gadgets/gadgets-docs.factor
extra/ui/frp/gadgets/gadgets.factor
extra/ui/frp/layout/layout-docs.factor
extra/ui/frp/signals/signals-docs.factor

index 208e87f4a337f22d74117c5817bb79877ed3025f..b3440aefb32d390fb9904dc8309f0f5cb1217e7b 100644 (file)
@@ -1,11 +1,15 @@
-USING: help.markup help.syntax ui.gadgets.buttons
-ui.gadgets.editors ui.frp.gadgets ;
+USING: accessors help.markup help.syntax ui.gadgets.buttons
+ui.gadgets.editors ui.frp.gadgets models ui.gadgets ;
 IN: ui.frp.gadgets
 
 HELP: <frp-button>
 { $values { "gadget" "the button's label" } { "button" button } }
 { $description "Creates an button whose signal updates on clicks.  " } ;
 
+HELP: <frp-border-button>
+{ $values { "text" "the button's label" } { "button" button } }
+{ $description "Creates an button whose signal updates on clicks.  " } ;
+
 HELP: <frp-table>
 { $values { "model" "values the table is to display" } { "table" frp-table } }
 { $description "Creates an " { $link frp-table } } ;
@@ -27,5 +31,37 @@ HELP: indexed
 { $description "Sets the output model of an frp-table to the selected-index, rather than the selected-value" } ;
 
 HELP: <frp-field>
+{ $values { "model" model } { "gadget" model-field } }
+{ $description "Creates a field with an initial value" } ;
+
+HELP: <frp-field*>
 { $values { "field" model-field } }
-{ $description "Creates a field with an empty initial value" } ;
\ No newline at end of file
+{ $description "Creates a field with an empty initial value" } ;
+
+HELP: <empty-field>
+{ $values { "model" model } { "field" model-field } }
+{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
+
+HELP: <frp-editor>
+{ $values { "model" model } { "gadget" model-field } }
+{ $description "Creates an editor with an initial value" } ;
+
+HELP: <frp-editor*>
+{ $values { "editor" "an editor" } }
+{ $description "Creates a editor with an empty initial value" } ;
+
+HELP: <empty-editor>
+{ $values { "model" model } { "editor" "an editor" } }
+{ $description "Creates a field with an empty initial value that switches to another signal on its update" } ;
+
+HELP: <frp-action-field>
+{ $values { "field" action-field } }
+{ $description "Field that updates its model with its contents when the user hits the return key" } ;
+
+HELP: <image-button>
+{ $syntax "filename <image-button>" }
+{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ;
+
+HELP: output-model
+{ $values { "gadget" gadget } { "model" model } }
+{ $description "Returns the model a gadget uses for output. Often the same as " { $link model>> } } ;
\ No newline at end of file
index 3c9bbda1b32c5cc403ac00c66775c43f8b804b73..6355271e96d066bec2ab1926ae5b049adb37d26e 100644 (file)
@@ -43,13 +43,11 @@ M: frp-field model-changed 2dup frp-model>> =
 
 : <frp-field*> ( -- field ) "" <model> <frp-field> ;
 : <empty-field> ( model -- field ) "" <model> <switch> <frp-field> ;
-: <empty-field*> ( -- field ) "" <model> <frp-field> ;
 : <frp-editor> ( model -- gadget )
     frp-field [ <multiline-editor> ] dip new-border dup gadget-child >>editor
     field-theme swap init-field >>frp-model { 1 0 } >>align ;
 : <frp-editor*> ( -- editor ) "" <model> <frp-editor> ;
-: <empty-editor*> ( -- field ) "" <model> <frp-editor> ;
-: <empty-editor> ( model -- field ) "" <model> <switch> <frp-editor> ;
+: <empty-editor> ( model -- editor ) "" <model> <switch> <frp-editor> ;
 
 : <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
     f <model> >>model ;
index 367957266950d5c8799f249d21f71d4364544b21..f91f099588102bfe49b7cf1ec16a5b4bd45a7cef 100644 (file)
@@ -2,7 +2,7 @@ USING: help.markup help.syntax models ui.gadgets.tracks ui.frp.layout ;
 IN: ui.frp.layout
 
 HELP: ,
-{ $values { "uiitem" "a gadget or model" } }
+{ $values { "item" "a gadget or model" } }
 { $description "Used in a series of gadgets created by a box, accumulating the gadget" } ;
 
 HELP: ,%
@@ -24,7 +24,30 @@ HELP: <hbox>
 { $values { "gadgets" "a list of gadgets" } { "track" track } }
 { $syntax "[ gadget , gadget , ... ] <hbox>" }
 { $description "Creates an horizontal track containing the gadgets listed in the quotation" } ;
+
 HELP: <vbox>
 { $values { "gadgets" "a list of gadgets" } { "track" track } }
 { $syntax "[ gadget , gadget , ... ] <hbox>" }
-{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
\ No newline at end of file
+{ $description "Creates an vertical track containing the gadgets listed in the quotation" } ;
+
+HELP: $
+{ $syntax "$ PLACEHOLDER-NAME $" }
+{ $description "Defines an insertion point in a template named PLACEHOLDER-NAME which can be used by calling its name" } ;
+
+HELP: with-interface
+{ $values { "quot" "quotation that builds a template and inserts into it" } }
+{ $description "Create templates, used with " { $link POSTPONE: $ } } ;
+
+ARTICLE: { "ui.frp.layout" "about" } "GUI Layout"
+"Laying out GUIs works the same way as building lists with " { $vocab-link "make" }
+". Gadgets are layed out using " { $vocab-link "ui.gadgets.tracks" } " through " { $link <hbox> } " and " { $link <vbox> } ", which allow both fixed and percentage widths. "
+{ $link , } " and " { $link -> }  " add a signal or gadget to the gadget you're building. "
+"Also, books can be made with " { $link <frp-book> } ". "
+{ $link <spacer> } "s add flexable space between items. " $nl
+"Using " { $link with-interface } ", one can pre-build templates to add items to later: "
+"Like in Java's StringTemplate, placeholders are defined using $ PLACERHOLDER-NAME $ "
+"Using PLACEHOLDER-NAME again sets it as the current insertion point. "
+"For examples using normal layout, see the " { $vocab-link "gui-sudoku" } " demo. "
+"For examples of templating, see " { $vocab-link "recipes" } " demo. " ;
+
+ABOUT: { "ui.frp.layout" "about" }
\ No newline at end of file
index e2b14234e1ebb0420e5df2123831db9ed7aa61fa..e542424c2abae3a902a8d6d800590e95e333042b 100644 (file)
@@ -27,4 +27,24 @@ HELP: $>
 
 HELP: <$
 { $values { "model" model } { "quot" "applied to model's value on updates" } { "signal" model } }
-{ $description "Opposite of " { $link <$ } "- gives output, but takes no input" } ;
\ No newline at end of file
+{ $description "Opposite of " { $link <$ } "- gives output, but takes no input" } ;
+
+HELP: frp-when
+{ $values { "model" model } { "quot" "called on the model if the quot yields true" } { "cond" "a quotation called on the model's value, yielding a boolean value"  } }
+{ $description "Calls quot when model updates if its value meets the condition set in cond" } ;
+
+HELP: with-self
+{ $values { "quot" "quotation that recieves its own return value" } { "model" model } }
+{ $description "Fixed points for signals: the quot reacts to the same signal to gives" } ;
+
+HELP: #1
+{ $values { "model" model } { "model'" model } }
+{ $description "Moves a signal to the top of its dependencies' connections, thus being notified before the others" } ;
+
+ARTICLE: { "signals" "about" } "FRP Signals"
+"Unlike models, which always have a value, signals have discrete start and end times. "
+"They are the core of the frp library: program flow using frp is controlled entirely through manipulating and combining signals. "
+"The output signals of some gadgets (see " { $vocab-link "ui.frp.gadgets" } " ) can be manipulated and used as the input signals of others. "
+"To combine signals see " { $vocab-link "ui.frp.functors" } ;
+
+ABOUT: { "signals" "about" }
\ No newline at end of file