From 6bbb4630f33eee0d1cab3d6ea730459518655856 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 14 Feb 2009 19:48:32 -0600 Subject: [PATCH] Rename labelled to labeled -- correct spelling --- basis/ui/gadgets/buttons/buttons-docs.factor | 2 +- .../gadgets/{labelled => labeled}/authors.txt | 0 basis/ui/gadgets/labeled/labeled-docs.factor | 23 ++++++++ basis/ui/gadgets/labeled/labeled.factor | 57 +++++++++++++++++++ .../gadgets/{labelled => labeled}/summary.txt | 0 .../ui/gadgets/labelled/labelled-docs.factor | 23 -------- basis/ui/gadgets/labelled/labelled.factor | 57 ------------------- basis/ui/gadgets/scrollers/scrollers.factor | 3 +- basis/ui/tools/inspector/inspector.factor | 6 +- .../listener/completion/completion.factor | 4 +- basis/ui/tools/listener/listener.factor | 4 +- basis/ui/tools/profiler/profiler.factor | 12 ++-- basis/ui/tools/traceback/traceback.factor | 6 +- basis/ui/ui-docs.factor | 2 +- 14 files changed, 100 insertions(+), 99 deletions(-) rename basis/ui/gadgets/{labelled => labeled}/authors.txt (100%) create mode 100644 basis/ui/gadgets/labeled/labeled-docs.factor create mode 100644 basis/ui/gadgets/labeled/labeled.factor rename basis/ui/gadgets/{labelled => labeled}/summary.txt (100%) delete mode 100644 basis/ui/gadgets/labelled/labelled-docs.factor delete mode 100644 basis/ui/gadgets/labelled/labelled.factor diff --git a/basis/ui/gadgets/buttons/buttons-docs.factor b/basis/ui/gadgets/buttons/buttons-docs.factor index 6a4acc4c9d..62e039632c 100644 --- a/basis/ui/gadgets/buttons/buttons-docs.factor +++ b/basis/ui/gadgets/buttons/buttons-docs.factor @@ -44,7 +44,7 @@ HELP: HELP: { $values { "model" model } { "assoc" "an association list mapping labels to objects" } { "gadget" gadget } } -{ $description "Creates a row of labelled " { $link } " gadgets which change the value of the model." } ; +{ $description "Creates a row of labeled " { $link } " gadgets which change the value of the model." } ; HELP: { $values { "target" object } { "gesture" "a gesture" } { "command" "a command" } { "button" "a new " { $link button } } } diff --git a/basis/ui/gadgets/labelled/authors.txt b/basis/ui/gadgets/labeled/authors.txt similarity index 100% rename from basis/ui/gadgets/labelled/authors.txt rename to basis/ui/gadgets/labeled/authors.txt diff --git a/basis/ui/gadgets/labeled/labeled-docs.factor b/basis/ui/gadgets/labeled/labeled-docs.factor new file mode 100644 index 0000000000..c89392b836 --- /dev/null +++ b/basis/ui/gadgets/labeled/labeled-docs.factor @@ -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 } "." } ; + +HELP: +{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link } } } +{ $description "Creates a new " { $link labeled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ; + +HELP: +{ $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 } "." } ; + +{ } 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 } ; + +ABOUT: "ui.gadgets.labeled" diff --git a/basis/ui/gadgets/labeled/labeled.factor b/basis/ui/gadgets/labeled/labeled.factor new file mode 100644 index 0000000000..25be06a194 --- /dev/null +++ b/basis/ui/gadgets/labeled/labeled.factor @@ -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 ; + + dup interior>> t >>fill? drop ; + + +CONSTANT: labeled-title-background + T{ rgba f + 0.7843137254901961 + 0.7686274509803922 + 0.7176470588235294 + 1.0 + } + +: ( gadget -- label ) + >label + [ labeled-title-background font-with-background ] change-font + { 0 2 } + "title-middle" labeled-image + t >>fill? >>interior ; + +: /-FOO-\ ( title labeled -- labeled ) + "title-left" labeled-icon @top-left grid-add + swap @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> + +: ( gadget title -- newgadget ) + labeled-gadget new-frame + /-FOO-\ + |-----| + \-----/ ; diff --git a/basis/ui/gadgets/labelled/summary.txt b/basis/ui/gadgets/labeled/summary.txt similarity index 100% rename from basis/ui/gadgets/labelled/summary.txt rename to basis/ui/gadgets/labeled/summary.txt diff --git a/basis/ui/gadgets/labelled/labelled-docs.factor b/basis/ui/gadgets/labelled/labelled-docs.factor deleted file mode 100644 index b574263285..0000000000 --- a/basis/ui/gadgets/labelled/labelled-docs.factor +++ /dev/null @@ -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 } "." } ; - -HELP: -{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link } } } -{ $description "Creates a new " { $link labelled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ; - -HELP: -{ $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 } "." } ; - -{ } 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 } ; - -ABOUT: "ui.gadgets.labelled" diff --git a/basis/ui/gadgets/labelled/labelled.factor b/basis/ui/gadgets/labelled/labelled.factor deleted file mode 100644 index 8b17ec8c0c..0000000000 --- a/basis/ui/gadgets/labelled/labelled.factor +++ /dev/null @@ -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 ; - - dup interior>> t >>fill? drop ; - - -CONSTANT: labelled-title-background - T{ rgba f - 0.7843137254901961 - 0.7686274509803922 - 0.7176470588235294 - 1.0 - } - -: ( gadget -- label ) - >label - [ labelled-title-background font-with-background ] change-font - { 0 2 } - "title-middle" labelled-image - t >>fill? >>interior ; - -: /-FOO-\ ( title labelled -- labelled ) - "title-left" labelled-icon @top-left grid-add - swap @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> - -: ( gadget title -- newgadget ) - labelled-gadget new-frame - /-FOO-\ - |-----| - \-----/ ; diff --git a/basis/ui/gadgets/scrollers/scrollers.factor b/basis/ui/gadgets/scrollers/scrollers.factor index 7d41d48c70..d07fb39d77 100644 --- a/basis/ui/gadgets/scrollers/scrollers.factor +++ b/basis/ui/gadgets/scrollers/scrollers.factor @@ -74,7 +74,8 @@ scroller H{ { [ nip ] [ viewport>> gadget-child swap child? ] [ nip ] } 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 [ [ relative-scroll-rect ] keep swap >>follows diff --git a/basis/ui/tools/inspector/inspector.factor b/basis/ui/tools/inspector/inspector.factor index 1e9a99e198..5689e7e8a3 100644 --- a/basis/ui/tools/inspector/inspector.factor +++ b/basis/ui/tools/inspector/inspector.factor @@ -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.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks 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 ; IN: ui.tools.inspector @@ -70,8 +70,8 @@ M: hashtable make-slot-descriptions add-toolbar swap >>model dup model>> >>table - dup model>> "Object" f track-add - dup table>> "Contents" 1 track-add ; + dup model>> "Object" f track-add + dup table>> "Contents" 1 track-add ; M: inspector-gadget focusable-child* table>> ; diff --git a/basis/ui/tools/listener/completion/completion.factor b/basis/ui/tools/listener/completion/completion.factor index aaed8d17a5..a63aac4d73 100644 --- a/basis/ui/tools/listener/completion/completion.factor +++ b/basis/ui/tools/listener/completion/completion.factor @@ -7,7 +7,7 @@ parser present sequences tools.completion tools.vocabs.browser generic generic.standard.engines.tuple fonts definitions.icons ui.images ui.commands ui.operations ui.gadgets ui.gadgets.editors 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.tools.listener.history combinators vocabs ui.tools.listener.popups ; IN: ui.tools.listener.completion @@ -159,7 +159,7 @@ GENERIC# accept-completion-hook 1 ( item popup -- ) [ vertical completion-popup new-track ] 2dip [ [ >>interactor ] [ >>completion-mode ] bi* ] [ >>table ] 2bi dup [ ] [ completion-mode>> completion-banner ] bi - 1 track-add ; + 1 track-add ; completion-popup H{ { T{ key-down f f "TAB" } [ table>> row-action ] } diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index 4c09baa997..27baefd92e 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -8,7 +8,7 @@ io.styles kernel lexer listener math models models.delay models.filter namespaces parser prettyprint quotations sequences strings threads tools.vocabs vocabs vocabs.loader vocabs.parser words ui ui.commands 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.operations ui.tools.browser ui.tools.common ui.tools.debugger ui.tools.listener.completion ui.tools.listener.popups @@ -294,7 +294,7 @@ M: object accept-completion-hook 2drop ; :: ( interactor error continuation -- popup ) error continuation error compute-restarts [ interactor hide-popup ] - "Error" ; + "Error" ; : debugger-popup ( interactor error continuation -- ) [ [ drop one-line-elt ] 2keep ] dip show-popup ; diff --git a/basis/ui/tools/profiler/profiler.factor b/basis/ui/tools/profiler/profiler.factor index 6b6ddda1ea..50ac702fcb 100644 --- a/basis/ui/tools/profiler/profiler.factor +++ b/basis/ui/tools/profiler/profiler.factor @@ -6,7 +6,7 @@ models.search models.sort models sequences vocabs tools.profiler words prettyprint ui ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks ui.gestures 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.tools.browser ui.tools.common ; FROM: models.filter => ; @@ -113,11 +113,11 @@ M: method-renderer row-value drop first ; profiler vocabs>> profiler vocab>> >>selected-value vocab-renderer >>renderer - "Vocabularies" + "Vocabularies" 1/2 track-add profiler word-renderer >>renderer - "Words" + "Words" 1/2 track-add ; :: ( profiler -- gadget ) @@ -126,17 +126,17 @@ M: method-renderer row-value drop first ; profiler profiler generic>> >>selected-value word-renderer >>renderer - "Generic words" + "Generic words" 1/2 track-add profiler profiler class>> >>selected-value word-renderer >>renderer - "Classes" + "Classes" 1/2 track-add 1/2 track-add profiler methods>> method-renderer >>renderer - "Methods" + "Methods" 1/2 track-add ; : ( -- model ) { f 0 } ; diff --git a/basis/ui/tools/traceback/traceback.factor b/basis/ui/tools/traceback/traceback.factor index 34ccfcc762..f85a1e201a 100644 --- a/basis/ui/tools/traceback/traceback.factor +++ b/basis/ui/tools/traceback/traceback.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. 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.status-bar ui.gadgets.scrollers ui.gadgets.borders ui.gadgets.tables ui.gestures sequences inspector @@ -29,12 +29,12 @@ M: stack-entry-renderer row-value drop object>> ; : ( model quot title -- gadget ) [ '[ dup _ when ] ] dip - ; + ; : ( model -- gadget ) [ [ call>> callstack. ] when* ] t >>scrolls? - "Call stack" ; + "Call stack" ; : ( model -- gadget ) [ data>> ] "Data stack" ; diff --git a/basis/ui/ui-docs.factor b/basis/ui/ui-docs.factor index 9936432e56..6871fbffeb 100644 --- a/basis/ui/ui-docs.factor +++ b/basis/ui/ui-docs.factor @@ -89,7 +89,7 @@ ARTICLE: "gadgets" "Pre-made UI gadgets" { $subsection "ui.gadgets.labels" } { $subsection "gadgets-polygons" } { $subsection "ui.gadgets.borders" } -{ $subsection "ui.gadgets.labelled" } +{ $subsection "ui.gadgets.labeled" } { $subsection "ui.gadgets.buttons" } { $subsection "ui.gadgets.sliders" } { $subsection "ui.gadgets.scrollers" }