generalized image buttons
parent
568f55f105
commit
58d8aacb74
|
@ -31,11 +31,11 @@ STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } {
|
|||
interface
|
||||
<frp-table*> :> tbl
|
||||
"okay" <frp-border-button> BUTTON -> :> ok
|
||||
IMAGE-BUTTON: submit [ store-tuple ] >>value TOOLBAR -> :> submit
|
||||
IMAGE-BUTTON: love 1 >>value TOOLBAR ->
|
||||
IMAGE-BUTTON: hate -1 >>value -> 2array <merge> :> votes
|
||||
IMAGE-BUTTON: back -> [ -30 ] <$
|
||||
IMAGE-BUTTON: more -> [ 30 ] <$ 2array <merge> :> viewed
|
||||
IMG-FRP-BTN: submit [ store-tuple ] >>value TOOLBAR -> :> submit
|
||||
IMG-FRP-BTN: love 1 >>value TOOLBAR ->
|
||||
IMG-FRP-BTN: hate -1 >>value -> 2array <merge> :> votes
|
||||
IMG-FRP-BTN: back -> [ -30 ] <$
|
||||
IMG-FRP-BTN: more -> [ 30 ] <$ 2array <merge> :> viewed
|
||||
<spacer> <frp-field*> ->% 1 :> search
|
||||
submit ok [ [ drop ] ] <$ 2array <merge> [ drop ] >>value :> quot
|
||||
viewed 0 [ + ] <fold> search ok t <basic> "all" <frp-button> ALL ->
|
||||
|
|
|
@ -58,10 +58,14 @@ 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:
|
||||
HELP: IMG-FRP-BTN:
|
||||
{ $syntax "IMAGE-BUTTON: filename" }
|
||||
{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ;
|
||||
|
||||
HELP: IMG-BTN:
|
||||
{ $syntax "[ do-something ] IMAGE-BUTTON: filename" }
|
||||
{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path, calling the specified quotation on click" } ;
|
||||
|
||||
HELP: output-model
|
||||
{ $values { "gadget" gadget } { "model" model } }
|
||||
{ $description "Returns the model a gadget uses for output. Often the same as " { $link model>> } } ;
|
|
@ -52,8 +52,10 @@ M: frp-field model-changed 2dup frp-model>> =
|
|||
: <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
|
||||
f <model> >>model ;
|
||||
|
||||
SYNTAX: IMAGE-BUTTON: scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround
|
||||
<image-name> [ <frp-button> ] curry over push-all ;
|
||||
: image-prep ( -- image ) scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround <image-name> ;
|
||||
SYNTAX: IMG-FRP-BTN: image-prep [ <frp-button> ] curry over push-all ;
|
||||
|
||||
SYNTAX: IMG-BTN: image-prep [ swap <button> ] curry over push-all ;
|
||||
|
||||
GENERIC: output-model ( gadget -- model )
|
||||
M: gadget output-model model>> ;
|
||||
|
|
|
@ -38,16 +38,16 @@ 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"
|
||||
ARTICLE: "ui.frp.layout" "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 $ "
|
||||
"Like in the StringTemplate framework for java, 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 using normal layout, see the " { $vocab-link "sudokus" } " demo. "
|
||||
"For examples of templating, see " { $vocab-link "recipes" } " demo. " ;
|
||||
|
||||
ABOUT: { "ui.frp.layout" "about" }
|
||||
ABOUT: "ui.frp.layout"
|
|
@ -41,10 +41,9 @@ 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"
|
||||
ARTICLE: "signals" "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" } ;
|
||||
"The output signals of some gadgets (see " { $vocab-link "ui.frp.gadgets" } " ) can be manipulated and used as the input signals of others. " ;
|
||||
|
||||
ABOUT: { "signals" "about" }
|
||||
ABOUT: "signals"
|
Loading…
Reference in New Issue