Rename labelled to labeled -- correct spelling

db4
Slava Pestov 2009-02-14 19:48:32 -06:00
parent bb46c64f71
commit 6bbb4630f3
14 changed files with 100 additions and 99 deletions

View File

@ -44,7 +44,7 @@ HELP: <toggle-button>
HELP: <toggle-buttons> HELP: <toggle-buttons>
{ $values { "model" model } { "assoc" "an association list mapping labels to objects" } { "gadget" gadget } } { $values { "model" model } { "assoc" "an association list mapping labels to objects" } { "gadget" gadget } }
{ $description "Creates a row of labelled " { $link <toggle-button> } " gadgets which change the value of the model." } ; { $description "Creates a row of labeled " { $link <toggle-button> } " gadgets which change the value of the model." } ;
HELP: <command-button> HELP: <command-button>
{ $values { "target" object } { "gesture" "a gesture" } { "command" "a command" } { "button" "a new " { $link button } } } { $values { "target" object } { "gesture" "a gesture" } { "command" "a command" } { "button" "a new " { $link button } } }

View File

@ -0,0 +1,23 @@
USING: ui.gadgets help.markup help.syntax strings models
ui.gadgets.panes ;
IN: ui.gadgets.labeled
HELP: labeled-gadget
{ $class-description "A labeled gadget can be created by calling " { $link <labeled-gadget> } "." } ;
HELP: <labeled-gadget>
{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link <labeled-gadget> } } }
{ $description "Creates a new " { $link labeled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ;
HELP: <labeled-pane>
{ $values { "model" model } { "quot" { $quotation "( value -- )" } } { "scrolls?" "a boolean" } { "title" string } { "gadget" "a new " { $link gadget } } }
{ $description "Creates a new control delegating to a " { $link pane } ", and wraps it in a " { $link labeled-gadget } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ;
{ <labeled-pane> <pane-control> } related-words
ARTICLE: "ui.gadgets.labeled" "Labelled gadgets"
"The " { $vocab-link "ui.gadgets.labeled" } " vocabulary implements labeled borders around child gadgets."
{ $subsection labeled-gadget }
{ $subsection <labeled-gadget> } ;
ABOUT: "ui.gadgets.labeled"

View File

@ -0,0 +1,57 @@
! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel sequences colors fonts ui.gadgets
ui.gadgets.frames ui.gadgets.grids ui.gadgets.icons ui.gadgets.labels
ui.gadgets.theme ui.gadgets.borders ui.pens.image ;
IN: ui.gadgets.labeled
TUPLE: labeled-gadget < frame content ;
<PRIVATE
: labeled-image ( name -- image )
"labeled-block-" prepend theme-image ;
: labeled-icon ( name -- icon )
labeled-image <icon> dup interior>> t >>fill? drop ;
CONSTANT: labeled-title-background
T{ rgba f
0.7843137254901961
0.7686274509803922
0.7176470588235294
1.0
}
: <labeled-title> ( gadget -- label )
>label
[ labeled-title-background font-with-background ] change-font
{ 0 2 } <border>
"title-middle" labeled-image
<image-pen> t >>fill? >>interior ;
: /-FOO-\ ( title labeled -- labeled )
"title-left" labeled-icon @top-left grid-add
swap <labeled-title> @top grid-add
"title-right" labeled-icon @top-right grid-add ;
: |-----| ( gadget labeled -- labeled )
"left-edge" labeled-icon @left grid-add
swap [ >>content ] [ @center grid-add ] bi
"right-edge" labeled-icon @right grid-add ;
: \-----/ ( labeled -- labeled )
"bottom-left" labeled-icon @bottom-left grid-add
"bottom-middle" labeled-icon @bottom grid-add
"bottom-right" labeled-icon @bottom-right grid-add ;
M: labeled-gadget focusable-child* content>> ;
PRIVATE>
: <labeled-gadget> ( gadget title -- newgadget )
labeled-gadget new-frame
/-FOO-\
|-----|
\-----/ ;

View File

@ -1,23 +0,0 @@
USING: ui.gadgets help.markup help.syntax strings models
ui.gadgets.panes ;
IN: ui.gadgets.labelled
HELP: labelled-gadget
{ $class-description "A labelled gadget can be created by calling " { $link <labelled-gadget> } "." } ;
HELP: <labelled-gadget>
{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link <labelled-gadget> } } }
{ $description "Creates a new " { $link labelled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ;
HELP: <labelled-pane>
{ $values { "model" model } { "quot" { $quotation "( value -- )" } } { "scrolls?" "a boolean" } { "title" string } { "gadget" "a new " { $link gadget } } }
{ $description "Creates a new control delegating to a " { $link pane } ", and wraps it in a " { $link labelled-gadget } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ;
{ <labelled-pane> <pane-control> } related-words
ARTICLE: "ui.gadgets.labelled" "Labelled gadgets"
"The " { $vocab-link "ui.gadgets.labelled" } " vocabulary implements labelled borders around child gadgets."
{ $subsection labelled-gadget }
{ $subsection <labelled-gadget> } ;
ABOUT: "ui.gadgets.labelled"

View File

@ -1,57 +0,0 @@
! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel sequences colors fonts ui.gadgets
ui.gadgets.frames ui.gadgets.grids ui.gadgets.icons ui.gadgets.labels
ui.gadgets.theme ui.gadgets.borders ui.pens.image ;
IN: ui.gadgets.labelled
TUPLE: labelled-gadget < frame content ;
<PRIVATE
: labelled-image ( name -- image )
"labeled-block-" prepend theme-image ;
: labelled-icon ( name -- icon )
labelled-image <icon> dup interior>> t >>fill? drop ;
CONSTANT: labelled-title-background
T{ rgba f
0.7843137254901961
0.7686274509803922
0.7176470588235294
1.0
}
: <labelled-title> ( gadget -- label )
>label
[ labelled-title-background font-with-background ] change-font
{ 0 2 } <border>
"title-middle" labelled-image
<image-pen> t >>fill? >>interior ;
: /-FOO-\ ( title labelled -- labelled )
"title-left" labelled-icon @top-left grid-add
swap <labelled-title> @top grid-add
"title-right" labelled-icon @top-right grid-add ;
: |-----| ( gadget labelled -- labelled )
"left-edge" labelled-icon @left grid-add
swap [ >>content ] [ @center grid-add ] bi
"right-edge" labelled-icon @right grid-add ;
: \-----/ ( labelled -- labelled )
"bottom-left" labelled-icon @bottom-left grid-add
"bottom-middle" labelled-icon @bottom grid-add
"bottom-right" labelled-icon @bottom-right grid-add ;
M: labelled-gadget focusable-child* content>> ;
PRIVATE>
: <labelled-gadget> ( gadget title -- newgadget )
labelled-gadget new-frame
/-FOO-\
|-----|
\-----/ ;

View File

@ -74,7 +74,8 @@ scroller H{
{ [ nip ] [ viewport>> gadget-child swap child? ] [ nip ] } { [ nip ] [ viewport>> gadget-child swap child? ] [ nip ] }
2&& ; 2&& ;
: scroll>rect ( rect gadget -- ) : scroll>rect ( rect gadget -- ) USING: prettyprint io io.streams.c ;
global [ over unparse show .c flush ] bind
dup find-scroller* dup [ dup find-scroller* dup [
[ relative-scroll-rect ] keep [ relative-scroll-rect ] keep
swap >>follows swap >>follows

View File

@ -6,7 +6,7 @@ io io.styles arrays hashtables math.order sorting refs fonts
ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes
ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks
ui.gestures ui.gadgets.buttons ui.gadgets.tables ui.gestures ui.gadgets.buttons ui.gadgets.tables
ui.gadgets.status-bar ui.gadgets.theme ui.gadgets.labelled ui.gadgets.status-bar ui.gadgets.theme ui.gadgets.labeled
ui.tools.common ui ; ui.tools.common ui ;
IN: ui.tools.inspector IN: ui.tools.inspector
@ -70,8 +70,8 @@ M: hashtable make-slot-descriptions
add-toolbar add-toolbar
swap >>model swap >>model
dup model>> <inspector-table> >>table dup model>> <inspector-table> >>table
dup model>> <summary-gadget> "Object" <labelled-gadget> f track-add dup model>> <summary-gadget> "Object" <labeled-gadget> f track-add
dup table>> <scroller> "Contents" <labelled-gadget> 1 track-add ; dup table>> <scroller> "Contents" <labeled-gadget> 1 track-add ;
M: inspector-gadget focusable-child* M: inspector-gadget focusable-child*
table>> ; table>> ;

View File

@ -7,7 +7,7 @@ parser present sequences tools.completion tools.vocabs.browser generic
generic.standard.engines.tuple fonts definitions.icons ui.images generic.standard.engines.tuple fonts definitions.icons ui.images
ui.commands ui.operations ui.gadgets ui.gadgets.editors ui.commands ui.operations ui.gadgets ui.gadgets.editors
ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables
ui.gadgets.tracks ui.gadgets.labelled ui.gadgets.theme ui.gadgets.tracks ui.gadgets.labeled ui.gadgets.theme
ui.gadgets.worlds ui.gadgets.wrappers ui.gestures ui.pens.solid ui.gadgets.worlds ui.gadgets.wrappers ui.gestures ui.pens.solid
ui.tools.listener.history combinators vocabs ui.tools.listener.popups ; ui.tools.listener.history combinators vocabs ui.tools.listener.popups ;
IN: ui.tools.listener.completion IN: ui.tools.listener.completion
@ -159,7 +159,7 @@ GENERIC# accept-completion-hook 1 ( item popup -- )
[ vertical completion-popup new-track ] 2dip [ vertical completion-popup new-track ] 2dip
[ [ >>interactor ] [ >>completion-mode ] bi* ] [ <completion-table> >>table ] 2bi [ [ >>interactor ] [ >>completion-mode ] bi* ] [ <completion-table> >>table ] 2bi
dup [ <completion-scroller> ] [ completion-mode>> completion-banner ] bi dup [ <completion-scroller> ] [ completion-mode>> completion-banner ] bi
<labelled-gadget> 1 track-add ; <labeled-gadget> 1 track-add ;
completion-popup H{ completion-popup H{
{ T{ key-down f f "TAB" } [ table>> row-action ] } { T{ key-down f f "TAB" } [ table>> row-action ] }

View File

@ -8,7 +8,7 @@ io.styles kernel lexer listener math models models.delay models.filter
namespaces parser prettyprint quotations sequences strings threads namespaces parser prettyprint quotations sequences strings threads
tools.vocabs vocabs vocabs.loader vocabs.parser words ui ui.commands tools.vocabs vocabs vocabs.loader vocabs.parser words ui ui.commands
ui.pens.solid ui.gadgets ui.gadgets.buttons ui.gadgets.editors ui.pens.solid ui.gadgets ui.gadgets.buttons ui.gadgets.editors
ui.gadgets.labelled ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
ui.operations ui.tools.browser ui.tools.common ui.tools.debugger ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
ui.tools.listener.completion ui.tools.listener.popups ui.tools.listener.completion ui.tools.listener.popups
@ -294,7 +294,7 @@ M: object accept-completion-hook 2drop ;
:: <debugger-popup> ( interactor error continuation -- popup ) :: <debugger-popup> ( interactor error continuation -- popup )
error continuation error compute-restarts error continuation error compute-restarts
[ interactor hide-popup ] <debugger> [ interactor hide-popup ] <debugger>
"Error" <labelled-gadget> ; "Error" <labeled-gadget> ;
: debugger-popup ( interactor error continuation -- ) : debugger-popup ( interactor error continuation -- )
[ [ drop one-line-elt ] 2keep ] dip <debugger-popup> show-popup ; [ [ drop one-line-elt ] 2keep ] dip <debugger-popup> show-popup ;

View File

@ -6,7 +6,7 @@ models.search models.sort models sequences vocabs
tools.profiler words prettyprint ui ui.commands ui.gadgets tools.profiler words prettyprint ui ui.commands ui.gadgets
ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks ui.gestures
ui.gadgets.buttons ui.gadgets.tables ui.gadgets.search-tables ui.gadgets.buttons ui.gadgets.tables ui.gadgets.search-tables
ui.gadgets.labelled ui.gadgets.buttons ui.gadgets.packs ui.gadgets.labeled ui.gadgets.buttons ui.gadgets.packs
ui.gadgets.labels ui.gadgets.tabbed ui.gadgets.status-bar ui.gadgets.labels ui.gadgets.tabbed ui.gadgets.status-bar
ui.tools.browser ui.tools.common ; ui.tools.browser ui.tools.common ;
FROM: models.filter => <filter> ; FROM: models.filter => <filter> ;
@ -113,11 +113,11 @@ M: method-renderer row-value drop first ;
profiler vocabs>> <profiler-table> profiler vocabs>> <profiler-table>
profiler vocab>> >>selected-value profiler vocab>> >>selected-value
vocab-renderer >>renderer vocab-renderer >>renderer
"Vocabularies" <labelled-gadget> "Vocabularies" <labeled-gadget>
1/2 track-add 1/2 track-add
profiler <words-model> <profiler-table> profiler <words-model> <profiler-table>
word-renderer >>renderer word-renderer >>renderer
"Words" <labelled-gadget> "Words" <labeled-gadget>
1/2 track-add ; 1/2 track-add ;
:: <methods-tab> ( profiler -- gadget ) :: <methods-tab> ( profiler -- gadget )
@ -126,17 +126,17 @@ M: method-renderer row-value drop first ;
profiler <generic-model> <profiler-table> profiler <generic-model> <profiler-table>
profiler generic>> >>selected-value profiler generic>> >>selected-value
word-renderer >>renderer word-renderer >>renderer
"Generic words" <labelled-gadget> "Generic words" <labeled-gadget>
1/2 track-add 1/2 track-add
profiler <class-model> <profiler-table> profiler <class-model> <profiler-table>
profiler class>> >>selected-value profiler class>> >>selected-value
word-renderer >>renderer word-renderer >>renderer
"Classes" <labelled-gadget> "Classes" <labeled-gadget>
1/2 track-add 1/2 track-add
1/2 track-add 1/2 track-add
profiler methods>> <profiler-table> profiler methods>> <profiler-table>
method-renderer >>renderer method-renderer >>renderer
"Methods" <labelled-gadget> "Methods" <labeled-gadget>
1/2 track-add ; 1/2 track-add ;
: <selection-model> ( -- model ) { f 0 } <model> ; : <selection-model> ( -- model ) { f 0 } <model> ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2006, 2009 Slava Pestov. ! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors continuations kernel models namespaces arrays USING: accessors continuations kernel models namespaces arrays
fry prettyprint ui ui.commands ui.gadgets ui.gadgets.labelled assocs fry prettyprint ui ui.commands ui.gadgets ui.gadgets.labeled assocs
ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes
ui.gadgets.status-bar ui.gadgets.scrollers ui.gadgets.borders ui.gadgets.status-bar ui.gadgets.scrollers ui.gadgets.borders
ui.gadgets.tables ui.gestures sequences inspector ui.gadgets.tables ui.gestures sequences inspector
@ -29,12 +29,12 @@ M: stack-entry-renderer row-value drop object>> ;
: <stack-display> ( model quot title -- gadget ) : <stack-display> ( model quot title -- gadget )
[ '[ dup _ when ] <filter> <stack-table> <scroller> ] dip [ '[ dup _ when ] <filter> <stack-table> <scroller> ] dip
<labelled-gadget> ; <labeled-gadget> ;
: <callstack-display> ( model -- gadget ) : <callstack-display> ( model -- gadget )
[ [ call>> callstack. ] when* ] [ [ call>> callstack. ] when* ]
<pane-control> t >>scrolls? <scroller> <pane-control> t >>scrolls? <scroller>
"Call stack" <labelled-gadget> ; "Call stack" <labeled-gadget> ;
: <datastack-display> ( model -- gadget ) : <datastack-display> ( model -- gadget )
[ data>> ] "Data stack" <stack-display> ; [ data>> ] "Data stack" <stack-display> ;

View File

@ -89,7 +89,7 @@ ARTICLE: "gadgets" "Pre-made UI gadgets"
{ $subsection "ui.gadgets.labels" } { $subsection "ui.gadgets.labels" }
{ $subsection "gadgets-polygons" } { $subsection "gadgets-polygons" }
{ $subsection "ui.gadgets.borders" } { $subsection "ui.gadgets.borders" }
{ $subsection "ui.gadgets.labelled" } { $subsection "ui.gadgets.labeled" }
{ $subsection "ui.gadgets.buttons" } { $subsection "ui.gadgets.buttons" }
{ $subsection "ui.gadgets.sliders" } { $subsection "ui.gadgets.sliders" }
{ $subsection "ui.gadgets.scrollers" } { $subsection "ui.gadgets.scrollers" }