added summary/ author files

db4
Sam Anklesaria 2009-06-26 15:25:50 -05:00
parent 93641c534d
commit 96fccd9c6c
9 changed files with 29 additions and 26 deletions

View File

@ -1,10 +1,11 @@
USING: accessors arrays db.tuples db.sqlite persistency db.queries USING: accessors arrays colors.constants combinators db.queries
io.files.temp kernel monads sequences ui ui.frp.gadgets db.sqlite db.tuples db.types io.files.temp kernel locals math
ui.frp.layout ui.frp.signals ui.gadgets.scrollers ui.gadgets.labels monads persistency sequences sequences.extras ui ui.frp.gadgets
colors.constants ui.pens.solid combinators math locals strings ui.frp.layout ui.frp.signals ui.gadgets.labels
ui.images db.types sequences.extras ui.tools.inspector ; ui.gadgets.scrollers ui.pens.solid ;
FROM: sets => prune ; FROM: sets => prune ;
IN: recipes IN: recipes
STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } { genre { VARCHAR 100 } } ; STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } { genre { VARCHAR 100 } } ;
: <recipe> ( title genre text -- recipe ) recipe new swap >>txt swap >>genre swap >>title 0 >>votes ; : <recipe> ( title genre text -- recipe ) recipe new swap >>txt swap >>genre swap >>title 0 >>votes ;
"recipes.db" temp-file <sqlite-db> recipe define-db "recipes.db" temp-file <sqlite-db> recipe define-db
@ -30,11 +31,11 @@ STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } {
interface interface
<frp-table*> :> tbl <frp-table*> :> tbl
"okay" <frp-border-button> BUTTON -> :> ok "okay" <frp-border-button> BUTTON -> :> ok
"submit" <image-button> [ store-tuple ] >>value TOOLBAR -> :> submit IMAGE-BUTTON: submit [ store-tuple ] >>value TOOLBAR -> :> submit
"love" <image-button> 1 >>value TOOLBAR -> IMAGE-BUTTON: love 1 >>value TOOLBAR ->
"hate" <image-button> -1 >>value -> 2array <merge> :> votes IMAGE-BUTTON: hate -1 >>value -> 2array <merge> :> votes
"back" <image-button> -> [ -30 ] <$ IMAGE-BUTTON: back -> [ -30 ] <$
"more" <image-button> -> [ 30 ] <$ 2array <merge> :> viewed IMAGE-BUTTON: more -> [ 30 ] <$ 2array <merge> :> viewed
<spacer> <frp-field*> ->% 1 :> search <spacer> <frp-field*> ->% 1 :> search
submit ok [ [ drop ] ] <$ 2array <merge> [ drop ] >>value :> quot submit ok [ [ drop ] ] <$ 2array <merge> [ drop ] >>value :> quot
viewed 0 [ + ] <fold> search ok t <basic> "all" <frp-button> ALL -> viewed 0 [ + ] <fold> search ok t <basic> "all" <frp-button> ALL ->

View File

@ -0,0 +1 @@
Used by ui.frp.signals to combine models

View File

@ -58,8 +58,8 @@ HELP: <frp-action-field>
{ $values { "field" action-field } } { $values { "field" action-field } }
{ $description "Field that updates its model with its contents when the user hits the return key" } ; { $description "Field that updates its model with its contents when the user hits the return key" } ;
HELP: <image-button> HELP: IMAGE-BUTTON:
{ $syntax "filename <image-button>" } { $syntax "IMAGE-BUTTON: filename" }
{ $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ; { $description "Creates a button using a tiff image named as specified found in the icons subdirectory of the vocabulary path" } ;
HELP: output-model HELP: output-model

View File

@ -1,9 +1,9 @@
USING: accessors arrays kernel models monads USING: accessors arrays kernel models monads sequences
sequences ui.frp.signals ui.gadgets ui.gadgets.borders ui.frp.signals ui.gadgets ui.gadgets.borders ui.gadgets.buttons
ui.gadgets.buttons ui.gadgets.buttons.private ui.gadgets.buttons.private ui.gadgets.editors
ui.gadgets.editors ui.gadgets.labels ui.gadgets.scrollers ui.gadgets.scrollers ui.gadgets.tables ui.images vocabs.parser lexer ;
ui.gadgets.tables ui.images vocabs.parser ;
IN: ui.frp.gadgets IN: ui.frp.gadgets
TUPLE: frp-button < button hook value ; TUPLE: frp-button < button hook value ;
: <frp-button> ( gadget -- button ) [ : <frp-button> ( gadget -- button ) [
[ dup hook>> [ call( button -- ) ] [ drop ] if* ] [ dup hook>> [ call( button -- ) ] [ drop ] if* ]
@ -52,9 +52,8 @@ M: frp-field model-changed 2dup frp-model>> =
: <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot : <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
f <model> >>model ; f <model> >>model ;
: image-button ( filename path -- button ) ".tiff" surround <image-name> <frp-button> ; SYNTAX: IMAGE-BUTTON: scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround
SYNTAX: <image-button> current-vocab name>> "vocab:" "/icons/" surround <image-name> [ <frp-button> ] curry over push-all ;
[ image-button ] curry over push-all ;
GENERIC: output-model ( gadget -- model ) GENERIC: output-model ( gadget -- model )
M: gadget output-model model>> ; M: gadget output-model model>> ;

View File

@ -0,0 +1 @@
Gadgets using signals as their models

View File

@ -1,7 +1,7 @@
USING: accessors assocs arrays fry kernel make math.parser models USING: accessors arrays fry kernel lexer make math.parser
models.product namespaces sequences ui.frp.gadgets parser lexer models models.product monads namespaces parser sequences
ui.gadgets ui.gadgets.books ui.gadgets.tracks vectors words sequences.extras ui.frp.gadgets ui.frp.signals ui.gadgets
combinators ui.frp.signals monads sequences.extras ui.tools.inspector ; ui.gadgets.books ui.gadgets.tracks words ;
QUALIFIED: make QUALIFIED: make
IN: ui.frp.layout IN: ui.frp.layout

View File

@ -0,0 +1 @@
Syntax for easily building GUIs and using templates

View File

@ -1,5 +1,5 @@
USING: accessors arrays kernel monads models models.product sequences classes USING: accessors arrays kernel models models.product monads
sequences.extras ; sequences sequences.extras ;
FROM: models.product => product ; FROM: models.product => product ;
IN: ui.frp.signals IN: ui.frp.signals