diff --git a/.github/workflows/spec-all.yml b/.github/workflows/spec-all.yml index 3fb54d948..44c77acef 100644 --- a/.github/workflows/spec-all.yml +++ b/.github/workflows/spec-all.yml @@ -6,9 +6,9 @@ env: on: push: - branches: [ Pharo11 ] + branches: [ Pharo12 ] pull_request: - branches: [ Pharo11 ] + branches: [ Pharo12 ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -19,15 +19,15 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - smalltalk: [ Pharo64-11 ] + smalltalk: [ Pharo64-12 ] runs-on: ${{ matrix.os }} name: ${{ matrix.smalltalk }} on ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup smalltalkCI uses: hpi-swa/setup-smalltalkCI@v1 with: - smalltalk-version: ${{ matrix.smalltalk }} + smalltalk-image: ${{ matrix.smalltalk }} - name: Load Image and Run Release Tests run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalk.release.ston timeout-minutes: 10 diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index e6fb3248e..6fc295ddc 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -6,9 +6,9 @@ env: on: push: - branches: [ Pharo11, dev-1.0 ] + branches: [ Pharo12, dev-3.0 ] pull_request: - branches: [ Pharo11, dev-1.0 ] + branches: [ Pharo12, dev-3.0 ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - smalltalk: [ Pharo64-11 ] + smalltalk: [ Pharo64-12 ] runs-on: ${{ matrix.os }} name: ${{ matrix.smalltalk }} on ${{ matrix.os }} steps: diff --git a/.smalltalk.all.ston b/.smalltalk.all.ston index 1f49a03ab..1439f921e 100644 --- a/.smalltalk.all.ston +++ b/.smalltalk.all.ston @@ -22,6 +22,7 @@ SmalltalkCISpec { 'Monticello.*', 'Metacello.*', 'System-Settings-Tests.*', + 'RPackage.*', 'ReleaseTests.*' ], #classes : [ #OutOfMemoryTest, diff --git a/README.md b/README.md index 720388169..55feb6a35 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,13 @@ Spec is a framework in Pharo for describing user interfaces. ## Install Spec -It is possible to load the latest version of Spec in Pharo 10 with following script: +Spec is included in any regular Pharo image. +It is possible to load the latest version executing following script: ```Smalltalk Metacello new - repository: 'github://pharo-spec/Spec:Pharo10'; + repository: 'github://pharo-spec/Spec'; baseline: 'Spec2'; onConflict: [ :e | e useIncoming ]; onUpgrade: [ :e | e useIncoming ]; diff --git a/src/BaselineOfSpec2/BaselineOfSpec2.class.st b/src/BaselineOfSpec2/BaselineOfSpec2.class.st index 9f6fcba58..38a12817c 100644 --- a/src/BaselineOfSpec2/BaselineOfSpec2.class.st +++ b/src/BaselineOfSpec2/BaselineOfSpec2.class.st @@ -1,10 +1,11 @@ Class { - #name : #BaselineOfSpec2, - #superclass : #BaselineOf, - #category : #BaselineOfSpec2 + #name : 'BaselineOfSpec2', + #superclass : 'BaselineOf', + #category : 'BaselineOfSpec2', + #package : 'BaselineOfSpec2' } -{ #category : #baseline } +{ #category : 'baseline' } BaselineOfSpec2 >> baseline: spec [ @@ -49,7 +50,7 @@ BaselineOfSpec2 >> baseline: spec [ spec group: 'default' with: #('Base' 'Tests' 'Code' 'CodeTests'). ] -{ #category : #'external projects' } +{ #category : 'external projects' } BaselineOfSpec2 >> defaultRepositoryURL [ ^ self class environment @@ -58,22 +59,7 @@ BaselineOfSpec2 >> defaultRepositoryURL [ ifAbsent: [ 'github://pharo-spec/Spec' ] ] -{ #category : #'external projects' } -BaselineOfSpec2 >> packageRepository [ - - " Tries to determine a repository from which the baseline is being loaded. Useful for - refering other baselines in the same repository. " - - ^ (self class package mcWorkingCopy repositoryGroup repositories - reject: [:each | each = MCCacheRepository uniqueInstance]) - ifNotEmpty: [ :repositories | - repositories - detect: [ :each | each description beginsWith: 'tonel://' ] - ifNone: [ repositories anyOne ] ] - ifEmpty: [ nil ] -] - -{ #category : #accessing } +{ #category : 'accessing' } BaselineOfSpec2 >> project [ "Atomic loading is needed for Spec because we are moving classes of package and it breaks their subclasses. @@ -99,21 +85,23 @@ We need to use atomic loading only during update of existing Spec upgrade" ] -{ #category : #'external projects' } +{ #category : 'external projects' } BaselineOfSpec2 >> specCore: spec [ - spec baseline: 'SpecCore' with: [ - spec - repository: (self packageRepositoryURL ifEmpty: [ self defaultRepositoryURL ]); - loads: #('Base' 'Tests') ] + spec baseline: 'SpecCore' with: [ + spec + repository: ((self packageRepositoryURLForSpec: spec) ifEmpty: [ + self defaultRepositoryURL ]); + loads: #( 'Base' 'Tests' ) ] ] -{ #category : #'external projects' } +{ #category : 'external projects' } BaselineOfSpec2 >> specCoreCode: spec [ - spec baseline: 'SpecCoreCode' with: [ - spec - repository: (self packageRepositoryURL ifEmpty: [ self defaultRepositoryURL ]); + spec baseline: 'SpecCoreCode' with: [ + spec + repository: ((self packageRepositoryURLForSpec: spec) ifEmpty: [ + self defaultRepositoryURL ]); className: 'BaselineOfSpecCore'; - loads: #('Code' 'CodeTests') ] + loads: #( 'Code' 'CodeTests' ) ] ] diff --git a/src/BaselineOfSpec2/package.st b/src/BaselineOfSpec2/package.st index 9d95f050e..84aa79ca0 100644 --- a/src/BaselineOfSpec2/package.st +++ b/src/BaselineOfSpec2/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfSpec2 } +Package { #name : 'BaselineOfSpec2' } diff --git a/src/BaselineOfSpecCore/BaselineOfSpecCore.class.st b/src/BaselineOfSpecCore/BaselineOfSpecCore.class.st index a707771e8..1e3aa1c56 100644 --- a/src/BaselineOfSpecCore/BaselineOfSpecCore.class.st +++ b/src/BaselineOfSpecCore/BaselineOfSpecCore.class.st @@ -1,10 +1,11 @@ Class { - #name : #BaselineOfSpecCore, - #superclass : #BaselineOf, - #category : #BaselineOfSpecCore + #name : 'BaselineOfSpecCore', + #superclass : 'BaselineOf', + #category : 'BaselineOfSpecCore', + #package : 'BaselineOfSpecCore' } -{ #category : #baseline } +{ #category : 'baseline' } BaselineOfSpecCore >> baseline: spec [ @@ -13,15 +14,19 @@ BaselineOfSpecCore >> baseline: spec [ spec "Core" - package: 'Spec2-ObservableSlot'; - package: 'Spec2-Layout' with: [ spec requires: #('Spec2-ObservableSlot') ]; - package: 'Spec2-Core' with: [ spec requires: #('Spec2-ObservableSlot' 'Spec2-Layout') ]; + package: 'Spec2-Layout'; + package: 'Spec2-Core' with: [ spec requires: #('Spec2-Layout') ]; package: 'Spec2-Dialogs' with: [ spec requires: #('Spec2-Core') ]; + package: 'Spec2-Dialogs-Tests' with: [ spec requires: #('Spec2-Dialogs') ]; package: 'Spec2-CommandLine' with: [ spec requires: #('Spec2-Core') ]; package: 'Spec2-Commands'; package: 'Spec2-Transmission' with: [ spec requires: #('Spec2-Core') ]; package: 'Spec2-Interactions' with: [ spec requires: #('Spec2-Core') ]; package: 'Spec2-Commander2' with: [ spec requires: #('Spec2-Core' 'Spec2-Interactions') ]; + "ListView" + package: 'Spec2-ListView' with: [ spec requires: #('Spec2-Core') ]; + package: 'Spec2-Adapters-Morphic-ListView' with: [ spec requires: #('Spec2-ListView') ]; + package: 'Spec2-ListView-Tests' with: [ spec requires: #('Spec2-ListView') ]; "Code" package: 'Spec2-Code' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ]; package: 'Spec2-Code-Commands' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ]; @@ -32,7 +37,7 @@ BaselineOfSpecCore >> baseline: spec [ "Tests" package: 'Spec2-Adapters-Stub' with: [ spec requires: #('Spec2-Core') ]; package: 'Spec2-Commander2-Tests' with: [ spec requires: #('Spec2-Commander2') ]; - package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Core' 'Spec2-Examples') ]; + package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Core' 'Spec2-Examples' 'Spec2-Dialogs-Tests') ]; package: 'Spec2-Code-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code') ]; package: 'Spec2-Code-Diff-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code-Diff') ]; "Examples" @@ -44,7 +49,6 @@ BaselineOfSpecCore >> baseline: spec [ ]. spec group: 'Core' with: #( - 'Spec2-ObservableSlot' 'Spec2-Layout' 'Spec2-Transmission' 'Spec2-Commands' @@ -66,14 +70,14 @@ BaselineOfSpecCore >> baseline: spec [ spec group: 'default' with: #('Base' 'BaseTests' 'Code' 'CodeTests'). ] -{ #category : #'external projects' } +{ #category : 'external projects' } BaselineOfSpecCore >> pillar: spec [ spec baseline: 'PillarCore' with: [ spec repository: 'github://pillar-markup/pillar:dev-8/src' ] ] -{ #category : #accessing } +{ #category : 'accessing' } BaselineOfSpecCore >> project [ "Atomic loading is needed for Spec because we are moving classes of package and it breaks their subclasses. diff --git a/src/BaselineOfSpecCore/package.st b/src/BaselineOfSpecCore/package.st index 9425ac122..1e583c515 100644 --- a/src/BaselineOfSpecCore/package.st +++ b/src/BaselineOfSpecCore/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfSpecCore } +Package { #name : 'BaselineOfSpecCore' } diff --git a/src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st b/src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st new file mode 100644 index 000000000..8a3c2f2c3 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st @@ -0,0 +1,43 @@ +Class { + #name : #SpAlexandrieMorph, + #superclass : #Morph, + #instVars : [ + 'surface', + 'drawBlock', + 'lastExtent' + ], + #category : #'Spec2-Adapters-Morphic-Alexandrie-Base' +} + +{ #category : #accessing } +SpAlexandrieMorph >> drawBlock: aBlock [ + + drawBlock := aBlock +] + +{ #category : #drawing } +SpAlexandrieMorph >> drawOn: aMorphicCanvas [ + + self redraw. + self surface + displayOnMorphicCanvas: aMorphicCanvas + at: bounds origin +] + +{ #category : #drawing } +SpAlexandrieMorph >> redraw [ + + self surface drawDuring: [ :canvas | + drawBlock + cull: canvas + cull: (0@0 extent: self extent) ] +] + +{ #category : #accessing } +SpAlexandrieMorph >> surface [ + + lastExtent = self extent ifFalse: [ surface := nil ]. + ^ surface ifNil: [ + lastExtent := self extent. + surface := AthensCairoSurface extent: self extent ] +] diff --git a/src/Spec2-Adapters-Morphic-Alexandrie/SpMorphicAlexandrieAdapter.class.st b/src/Spec2-Adapters-Morphic-Alexandrie/SpMorphicAlexandrieAdapter.class.st new file mode 100644 index 000000000..eb663dcf7 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-Alexandrie/SpMorphicAlexandrieAdapter.class.st @@ -0,0 +1,34 @@ +Class { + #name : #SpMorphicAlexandrieAdapter, + #superclass : #SpAbstractMorphicAdapter, + #category : #'Spec2-Adapters-Morphic-Alexandrie-Base' +} + +{ #category : #factory } +SpMorphicAlexandrieAdapter >> buildWidget [ + + | instance | + instance := SpAthensMorph new. + self presenter whenDrawBlockChangedDo: [ :newBlock | + instance drawBlock: newBlock ]. + self presenter whenExtentChangedDo: [ :newExtent | + instance extent: newExtent ]. + instance extent: self presenter surfaceExtent. + instance drawBlock: self presenter drawBlock. + instance setBalloonText: self model help. + self presenter whenHelpChangedDo: [ + instance setBalloonText: self model help ]. + ^ instance +] + +{ #category : #drawing } +SpMorphicAlexandrieAdapter >> redraw [ + + widget redraw +] + +{ #category : #accessing } +SpMorphicAlexandrieAdapter >> surface [ + + ^ widget surface +] diff --git a/src/Spec2-Adapters-Morphic-Alexandrie/package.st b/src/Spec2-Adapters-Morphic-Alexandrie/package.st new file mode 100644 index 000000000..5422aea30 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-Alexandrie/package.st @@ -0,0 +1 @@ +Package { #name : #'Spec2-Adapters-Morphic-Alexandrie' } diff --git a/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewAdapter.class.st b/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewAdapter.class.st new file mode 100644 index 000000000..44333deb3 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewAdapter.class.st @@ -0,0 +1,52 @@ +" +A morphic adapter for `SpListViewPresenter` +" +Class { + #name : 'SpMorphicListViewAdapter', + #superclass : 'SpMorphicListAdapter', + #category : 'Spec2-Adapters-Morphic-ListView', + #package : 'Spec2-Adapters-Morphic-ListView' +} + +{ #category : 'factory' } +SpMorphicListViewAdapter >> buildWidget [ + | datasource | + + datasource := self newDataSource. + datasource model: self model. + widget := self newTableWith: datasource. + + self presenter whenModelChangedDo: [ widget refresh ]. + self presenter whenSelectionChangedDo: [ self refreshWidgetSelection ]. + self presenter selection whenChangedDo: [ self refreshWidgetSelection ]. + + self refreshWidgetSelection. + self configureScrolling. + + ^ widget +] + +{ #category : 'factory' } +SpMorphicListViewAdapter >> newDataSource [ + + ^ SpMorphicListViewDataSource new +] + +{ #category : 'factory' } +SpMorphicListViewAdapter >> newTableWith: datasource [ + + ^ SpFTTableMorph new + disableFunction; + dataSource: datasource; + hideColumnHeaders; + beResizable; + setMultipleSelection: self model isMultipleSelection; + dragEnabled: self dragEnabled; + dropEnabled: self dropEnabled; + setBalloonText: self help; + hResizing: #spaceFill; + vResizing: #spaceFill; + onAnnouncement: FTSelectionChanged send: #selectionChanged: to: self; + onAnnouncement: FTStrongSelectionChanged send: #strongSelectionChanged: to: self; + yourself +] diff --git a/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewDataSource.class.st b/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewDataSource.class.st new file mode 100644 index 000000000..ccc7a6320 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-ListView/SpMorphicListViewDataSource.class.st @@ -0,0 +1,33 @@ +" +A morphic datasource for `SpListViewPresenter`, to be used on the `SpMorphicListViewAdapter`. +" +Class { + #name : 'SpMorphicListViewDataSource', + #superclass : 'SpMorphicListDataSource', + #category : 'Spec2-Adapters-Morphic-ListView', + #package : 'Spec2-Adapters-Morphic-ListView' +} + +{ #category : 'accessing' } +SpMorphicListViewDataSource >> cellColumn: column row: rowIndex [ + | cell contentPresenter | + + cell := FTCellMorph new. + + contentPresenter := self model setupAction value: self model. + self model bindAction + value: contentPresenter + value: (self elementAt: rowIndex). + + ^ cell addMorphBack: contentPresenter build +] + +{ #category : 'accessing' } +SpMorphicListViewDataSource >> headerColumn: column [ + + column id ifNil: [ ^ nil ]. + ^ FTCellMorph new + listCentering: #left; + addMorph: column id asMorph asReadOnlyMorph; + yourself +] diff --git a/src/Spec2-Adapters-Morphic-ListView/package.st b/src/Spec2-Adapters-Morphic-ListView/package.st new file mode 100644 index 000000000..6ccea4bf7 --- /dev/null +++ b/src/Spec2-Adapters-Morphic-ListView/package.st @@ -0,0 +1 @@ +Package { #name : 'Spec2-Adapters-Morphic-ListView' } diff --git a/src/Spec2-Adapters-Morphic-Tests/SpApplicationTest.extension.st b/src/Spec2-Adapters-Morphic-Tests/SpApplicationTest.extension.st index e2731a57d..dcb88d0a1 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpApplicationTest.extension.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpApplicationTest.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #SpApplicationTest } +Extension { #name : 'SpApplicationTest' } -{ #category : #'*Spec2-Adapters-Morphic-Tests' } +{ #category : '*Spec2-Adapters-Morphic-Tests' } SpApplicationTest >> testAdapterBindings [ self assert: application adapterBindings class equals: SpStubAdapterBindings. diff --git a/src/Spec2-Adapters-Morphic-Tests/SpDrawStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpDrawStyleTest.class.st index a404fd62a..6557fc2b4 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpDrawStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpDrawStyleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpDrawStyleTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpDrawStyleTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #tests } +{ #category : 'tests' } SpDrawStyleTest >> testToColor [ | style | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpFontStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpFontStyleTest.class.st index 5758b2ec7..056e06641 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpFontStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpFontStyleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpFontStyleTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpFontStyleTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #tests } +{ #category : 'tests' } SpFontStyleTest >> testResetFont [ | styleSheet app presenter font | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpMergeStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpMergeStyleTest.class.st index f0c517150..ee5a645eb 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpMergeStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpMergeStyleTest.class.st @@ -1,15 +1,16 @@ Class { - #name : #SpMergeStyleTest, - #superclass : #TestCase, + #name : 'SpMergeStyleTest', + #superclass : 'TestCase', #instVars : [ 'result', 'left', 'right' ], - #category : #'Spec2-Adapters-Morphic-Tests' + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #running } +{ #category : 'running' } SpMergeStyleTest >> setUp [ super setUp. @@ -32,7 +33,7 @@ SpMergeStyleTest >> setUp [ ] -{ #category : #tests } +{ #category : 'tests' } SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasClassInBothSides [ result := (left mergeWith: right) flattenClasses. @@ -42,7 +43,7 @@ SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasClassInBothSides [ ] -{ #category : #tests } +{ #category : 'tests' } SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasCorrectNumberOfEntries [ result := (left mergeWith: right) flattenClasses. @@ -51,7 +52,7 @@ SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasCorrectNumberOfEntries ] -{ #category : #tests } +{ #category : 'tests' } SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasLeftOnlyClass [ result := (left mergeWith: right) flattenClasses. @@ -60,7 +61,7 @@ SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasLeftOnlyClass [ ] -{ #category : #tests } +{ #category : 'tests' } SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasRightOnlyClass [ result := (left mergeWith: right) flattenClasses. @@ -69,7 +70,7 @@ SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasRightOnlyClass [ ] -{ #category : #tests } +{ #category : 'tests' } SpMergeStyleTest >> testMergingTwoStylesWithASameClassHasThePropertiesCorrectInCommonClass [ | innerClass | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpMorphStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpMorphStyleTest.class.st index 314f68db9..09a9c9225 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpMorphStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpMorphStyleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpMorphStyleTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpMorphStyleTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #private } +{ #category : 'private' } SpMorphStyleTest >> newLookup: aString [ | rootClass | @@ -12,7 +13,7 @@ SpMorphStyleTest >> newLookup: aString [ ^ SpMorphStyle newStyles: rootClass flattenClasses ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testApplyTo [ | styleResolver morph | @@ -34,7 +35,7 @@ SpMorphStyleTest >> testApplyTo [ self assert: morph width equals: 42 ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testDeepLookup [ "This should answer the deepest width" | styleResolver | @@ -52,7 +53,7 @@ SpMorphStyleTest >> testDeepLookup [ self assert: styleResolver width equals: 42 ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testDeepMultipleLookup [ "This should answer the deepest width (last appearence)" | styleResolver | @@ -73,7 +74,7 @@ SpMorphStyleTest >> testDeepMultipleLookup [ self assert: styleResolver width equals: 42 ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testFromStylesheetAdapter [ | lookup labelAdapter | @@ -117,7 +118,7 @@ SpMorphStyleTest >> testFromStylesheetAdapter [ adapter: labelAdapter ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testNestedStyles [ | lookup labelAdapter styleSheet | @@ -160,7 +161,7 @@ SpMorphStyleTest >> testNestedStyles [ self assert: lookup width equals: 84 ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testSimpleLookup [ "this should answer the width defined in the only level" | styleResolver | @@ -172,7 +173,7 @@ SpMorphStyleTest >> testSimpleLookup [ self assert: styleResolver width equals: 42 ] -{ #category : #tests } +{ #category : 'tests' } SpMorphStyleTest >> testTwoClassWithSameName [ | morphStyle style1 style2 property label | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpPropertyStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpPropertyStyleTest.class.st index 19c157398..47a6cd7b3 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpPropertyStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpPropertyStyleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpPropertyStyleTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpPropertyStyleTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #tests } +{ #category : 'tests' } SpPropertyStyleTest >> testMergeWith [ | p1 p2 p3 | @@ -23,7 +24,7 @@ SpPropertyStyleTest >> testMergeWith [ self assert: p3 height equals: 40 ] -{ #category : #tests } +{ #category : 'tests' } SpPropertyStyleTest >> testMergeWithFontDoNotRemovePredefinedFontWhenNoFontIsDefined [ | p1 p2 p3 | @@ -41,7 +42,7 @@ SpPropertyStyleTest >> testMergeWithFontDoNotRemovePredefinedFontWhenNoFontIsDef self assert: p3 color equals: Color white ] -{ #category : #tests } +{ #category : 'tests' } SpPropertyStyleTest >> testMergeWithFontRemovePredefinedFont [ | p1 p2 p3 | @@ -59,7 +60,7 @@ SpPropertyStyleTest >> testMergeWithFontRemovePredefinedFont [ ] -{ #category : #tests } +{ #category : 'tests' } SpPropertyStyleTest >> testMergeWithPredefinedFontCanBeDecorated [ | p1 p2 p3 | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpStyleEnvironmentColorProxyTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpStyleEnvironmentColorProxyTest.class.st new file mode 100644 index 000000000..465329b7a --- /dev/null +++ b/src/Spec2-Adapters-Morphic-Tests/SpStyleEnvironmentColorProxyTest.class.st @@ -0,0 +1,24 @@ +Class { + #name : 'SpStyleEnvironmentColorProxyTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' +} + +{ #category : 'tests' } +SpStyleEnvironmentColorProxyTest >> testSerializationWithFuelMaintainProxy [ + + | proxy byteArray deserialized | + + proxy := SpStyleEnvironmentColorProxy new + colorSelector: #backgroundColor; + yourself. + + self assert: proxy class equals: SpStyleEnvironmentColorProxy. + + byteArray := FLSerializer serializeToByteArray: proxy. + deserialized := FLMaterializer materializeFromByteArray: byteArray. + + self assert: deserialized class equals: proxy class. + self assert: (MirrorPrimitives fieldOf: deserialized at: 1) equals: (MirrorPrimitives fieldOf: proxy at: 1) +] diff --git a/src/Spec2-Adapters-Morphic-Tests/SpStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpStyleTest.class.st index 49ac8dd53..4b948fcd2 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpStyleTest.class.st @@ -1,20 +1,21 @@ Class { - #name : #SpStyleTest, - #superclass : #TestCase, + #name : 'SpStyleTest', + #superclass : 'TestCase', #instVars : [ 'aClass' ], - #category : #'Spec2-Adapters-Morphic-Tests' + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #running } +{ #category : 'running' } SpStyleTest >> tearDown [ aClass ifNotNil: [ :e | e removeFromSystem ]. super tearDown ] -{ #category : #tests } +{ #category : 'tests' } SpStyleTest >> testParsingAStyleIsNotAffectedByExistingClass [ | aStylesheet | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpStyleVariableTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpStyleVariableTest.class.st index d1ca32aa3..c2a38bf26 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpStyleVariableTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpStyleVariableTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpStyleVariableTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpStyleVariableTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #tests } +{ #category : 'tests' } SpStyleVariableTest >> testParseBasicValue [ | property | @@ -13,7 +14,7 @@ SpStyleVariableTest >> testParseBasicValue [ self assert: property heightVariable value equals: 25 ] -{ #category : #tests } +{ #category : 'tests' } SpStyleVariableTest >> testParseColorVariable [ | property | @@ -29,7 +30,7 @@ SpStyleVariableTest >> testParseColorVariable [ self assert: property borderColorVariable valueAsColor equals: Color red ] -{ #category : #tests } +{ #category : 'tests' } SpStyleVariableTest >> testParseFontVariable [ | property | @@ -39,7 +40,7 @@ SpStyleVariableTest >> testParseFontVariable [ ] -{ #category : #tests } +{ #category : 'tests' } SpStyleVariableTest >> testParseResetVariable [ | property | diff --git a/src/Spec2-Adapters-Morphic-Tests/SpTextInputFieldPresenterStyleTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpTextInputFieldPresenterStyleTest.class.st index aaf7704ec..8f4c9c555 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpTextInputFieldPresenterStyleTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpTextInputFieldPresenterStyleTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #SpTextInputFieldPresenterStyleTest, - #superclass : #TestCase, - #category : #'Spec2-Adapters-Morphic-Tests' + #name : 'SpTextInputFieldPresenterStyleTest', + #superclass : 'TestCase', + #category : 'Spec2-Adapters-Morphic-Tests', + #package : 'Spec2-Adapters-Morphic-Tests' } -{ #category : #tests } +{ #category : 'tests' } SpTextInputFieldPresenterStyleTest >> testApplyHeightChangesTheHeightOfTheWidget [ | app presenter textInputField | diff --git a/src/Spec2-Adapters-Morphic-Tests/package.st b/src/Spec2-Adapters-Morphic-Tests/package.st index 1c7ad01cc..141014974 100644 --- a/src/Spec2-Adapters-Morphic-Tests/package.st +++ b/src/Spec2-Adapters-Morphic-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Spec2-Adapters-Morphic-Tests' } +Package { #name : 'Spec2-Adapters-Morphic-Tests' } diff --git a/src/Spec2-Adapters-Morphic/FTAbstractSortingState.extension.st b/src/Spec2-Adapters-Morphic/FTAbstractSortingState.extension.st index f837286ef..416d4a7c0 100644 --- a/src/Spec2-Adapters-Morphic/FTAbstractSortingState.extension.st +++ b/src/Spec2-Adapters-Morphic/FTAbstractSortingState.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTAbstractSortingState } +Extension { #name : 'FTAbstractSortingState' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTAbstractSortingState >> isSorted [ ^ true ] diff --git a/src/Spec2-Adapters-Morphic/FTBasicItem.extension.st b/src/Spec2-Adapters-Morphic/FTBasicItem.extension.st index 952c7a157..1a968fe3f 100644 --- a/src/Spec2-Adapters-Morphic/FTBasicItem.extension.st +++ b/src/Spec2-Adapters-Morphic/FTBasicItem.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTBasicItem } +Extension { #name : 'FTBasicItem' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTBasicItem >> hasComputedChildren [ "I return true if I have computed children or if I don't have computed children." diff --git a/src/Spec2-Adapters-Morphic/FTStaticBasicItem.extension.st b/src/Spec2-Adapters-Morphic/FTStaticBasicItem.extension.st index 7fcf75597..80dc72ff6 100644 --- a/src/Spec2-Adapters-Morphic/FTStaticBasicItem.extension.st +++ b/src/Spec2-Adapters-Morphic/FTStaticBasicItem.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTStaticBasicItem } +Extension { #name : 'FTStaticBasicItem' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTStaticBasicItem >> hasComputedChildren [ ^ self hasChildren ] diff --git a/src/Spec2-Adapters-Morphic/FTTableMorph.extension.st b/src/Spec2-Adapters-Morphic/FTTableMorph.extension.st index 1ee0a12d9..9817b55aa 100644 --- a/src/Spec2-Adapters-Morphic/FTTableMorph.extension.st +++ b/src/Spec2-Adapters-Morphic/FTTableMorph.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTTableMorph } +Extension { #name : 'FTTableMorph' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTTableMorph >> clickOnColumnHeaderAt: anIndex [ | header | header := self container headerRow submorphs at: anIndex. @@ -10,7 +10,7 @@ FTTableMorph >> clickOnColumnHeaderAt: anIndex [ ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTTableMorph >> hasFilter [ function ifNil: [ ^ false ]. diff --git a/src/Spec2-Adapters-Morphic/FTTreeItem.extension.st b/src/Spec2-Adapters-Morphic/FTTreeItem.extension.st index faae200a1..a8283bf9f 100644 --- a/src/Spec2-Adapters-Morphic/FTTreeItem.extension.st +++ b/src/Spec2-Adapters-Morphic/FTTreeItem.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTTreeItem } +Extension { #name : 'FTTreeItem' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTTreeItem >> hasComputedChildren [ "I return true if I have computed children or if I don't have computed children." diff --git a/src/Spec2-Adapters-Morphic/FTUnsortedSortingState.extension.st b/src/Spec2-Adapters-Morphic/FTUnsortedSortingState.extension.st index 97a403db7..d16d9e465 100644 --- a/src/Spec2-Adapters-Morphic/FTUnsortedSortingState.extension.st +++ b/src/Spec2-Adapters-Morphic/FTUnsortedSortingState.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FTUnsortedSortingState } +Extension { #name : 'FTUnsortedSortingState' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } FTUnsortedSortingState >> isSorted [ ^ false ] diff --git a/src/Spec2-Adapters-Morphic/ManifestSpec2AdaptersMorphic.class.st b/src/Spec2-Adapters-Morphic/ManifestSpec2AdaptersMorphic.class.st index 4295da00f..02d7f1699 100644 --- a/src/Spec2-Adapters-Morphic/ManifestSpec2AdaptersMorphic.class.st +++ b/src/Spec2-Adapters-Morphic/ManifestSpec2AdaptersMorphic.class.st @@ -6,32 +6,34 @@ Spec is a framework in Pharo for describing user interfaces. It allows for the c I am implementing the spec layer between presenters and the morphic widgets. I will be used when the morphic backend of Spec is selected to build the Morphic widgets during the GUI creation. " Class { - #name : #ManifestSpec2AdaptersMorphic, - #superclass : #PackageManifest, - #category : #'Spec2-Adapters-Morphic-Manifest' + #name : 'ManifestSpec2AdaptersMorphic', + #superclass : 'PackageManifest', + #category : 'Spec2-Adapters-Morphic-Manifest', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Manifest' } -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2AdaptersMorphic class >> ruleCollectionMessagesToExternalObjectRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpMorphicButtonBarAdapter #addModelTo: #false)) #'2020-11-13T23:10:31.921402+01:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2AdaptersMorphic class >> ruleCollectionProtocolRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpMorphicDialogWindowAdapter #buildButtonBar #false)) #'2020-11-13T22:08:25.752583+01:00') #(#(#RGMethodDefinition #(#SpMorphicButtonBarAdapter #addModelTo: #false)) #'2020-11-13T23:10:24.35015+01:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2AdaptersMorphic class >> ruleGTExampleNotDefinedRuleV1FalsePositive [ ^ #(#(#(#RGClassDefinition #(#SpAbstractMorphicAdapter)) #'2016-07-01T15:56:13.367433+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2AdaptersMorphic class >> ruleRBOverridesDeprecatedMethodRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpMorphicMenuItemAdapter #name #false)) #'2016-07-01T15:56:13.381999+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2AdaptersMorphic class >> ruleUtilityMethodsRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpMorphicTextAdapter #setWrapWord:to: #false)) #'2020-11-13T22:40:20.610215+01:00') ) ] diff --git a/src/Spec2-Adapters-Morphic/MillerScrollPaneMorph.class.st b/src/Spec2-Adapters-Morphic/MillerScrollPaneMorph.class.st index b4099648e..81e756094 100644 --- a/src/Spec2-Adapters-Morphic/MillerScrollPaneMorph.class.st +++ b/src/Spec2-Adapters-Morphic/MillerScrollPaneMorph.class.st @@ -2,24 +2,26 @@ A scroll pane to show a miller column list. " Class { - #name : #MillerScrollPaneMorph, - #superclass : #GeneralScrollPaneMorph, + #name : 'MillerScrollPaneMorph', + #superclass : 'GeneralScrollPaneMorph', #instVars : [ 'layoutChangeAction', 'updating', 'firstShowingMorph', 'keepShowingPage' ], - #category : #'Spec2-Adapters-Morphic-Layout' + #category : 'Spec2-Adapters-Morphic-Layout', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Layout' } -{ #category : #private } +{ #category : 'private' } MillerScrollPaneMorph >> basicShowMorph: aMorph [ scroller offset: aMorph topLeft ] -{ #category : #scrollbars } +{ #category : 'scrollbars' } MillerScrollPaneMorph >> hScrollbarShowNever [ super hScrollbarShowNever. @@ -27,7 +29,7 @@ MillerScrollPaneMorph >> hScrollbarShowNever [ self keepShowingPage: true ] -{ #category : #scrollbars } +{ #category : 'scrollbars' } MillerScrollPaneMorph >> hScrollbarShowWhenNeeded [ super hScrollbarShowWhenNeeded. @@ -35,7 +37,7 @@ MillerScrollPaneMorph >> hScrollbarShowWhenNeeded [ self keepShowingPage: false ] -{ #category : #initialization } +{ #category : 'initialization' } MillerScrollPaneMorph >> initialize [ super initialize. @@ -43,13 +45,13 @@ MillerScrollPaneMorph >> initialize [ keepShowingPage := false ] -{ #category : #testing } +{ #category : 'testing' } MillerScrollPaneMorph >> isUpdating [ ^ updating ifNil: [ updating := false ] ] -{ #category : #private } +{ #category : 'private' } MillerScrollPaneMorph >> keepShowingPage: aBoolean [ keepShowingPage := aBoolean. @@ -57,7 +59,7 @@ MillerScrollPaneMorph >> keepShowingPage: aBoolean [ firstShowingMorph := nil ] ] -{ #category : #events } +{ #category : 'events' } MillerScrollPaneMorph >> layoutChanged [ self isUpdating ifTrue: [ ^ self ]. @@ -68,13 +70,13 @@ MillerScrollPaneMorph >> layoutChanged [ updating := false ] ] -{ #category : #events } +{ #category : 'events' } MillerScrollPaneMorph >> onLayoutChange: aBlock [ layoutChangeAction := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MillerScrollPaneMorph >> showMorph: aMorph [ keepShowingPage @@ -82,7 +84,7 @@ MillerScrollPaneMorph >> showMorph: aMorph [ self basicShowMorph: aMorph ] -{ #category : #updating } +{ #category : 'updating' } MillerScrollPaneMorph >> updateScrollbars [ super updateScrollbars. @@ -90,7 +92,7 @@ MillerScrollPaneMorph >> updateScrollbars [ scroller offset: firstShowingMorph topLeft ] ] -{ #category : #scrollbars } +{ #category : 'scrollbars' } MillerScrollPaneMorph >> vScrollbarNeeded [ "Return whether the vertical scrollbar is needed." diff --git a/src/Spec2-Adapters-Morphic/Morph.extension.st b/src/Spec2-Adapters-Morphic/Morph.extension.st index fa4984d60..163cba199 100644 --- a/src/Spec2-Adapters-Morphic/Morph.extension.st +++ b/src/Spec2-Adapters-Morphic/Morph.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #Morph } +Extension { #name : 'Morph' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } Morph >> presenter [ ^ self valueOfProperty: #presenter ifAbsent: [ nil ] ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } Morph >> presenter: aPresenter [ self @@ -14,7 +14,7 @@ Morph >> presenter: aPresenter [ toValue: aPresenter ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } Morph >> spEnsureLayoutAndAddMorph: aMorph [ aMorph layoutFrame diff --git a/src/Spec2-Adapters-Morphic/MorphicAPartTreeTableAdapter.class.st b/src/Spec2-Adapters-Morphic/MorphicAPartTreeTableAdapter.class.st index 879a9eee4..10cf24b01 100644 --- a/src/Spec2-Adapters-Morphic/MorphicAPartTreeTableAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/MorphicAPartTreeTableAdapter.class.st @@ -1,10 +1,12 @@ Class { - #name : #MorphicAPartTreeTableAdapter, - #superclass : #SpMorphicTreeTableAdapter, - #category : #'Spec2-Adapters-Morphic-Table' + #name : 'MorphicAPartTreeTableAdapter', + #superclass : 'SpMorphicTreeTableAdapter', + #category : 'Spec2-Adapters-Morphic-Table', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Table' } -{ #category : #accessing } +{ #category : 'accessing' } MorphicAPartTreeTableAdapter class >> adaptingName [ ^ #APartTreeTableAdapter diff --git a/src/Spec2-Adapters-Morphic/Object.extension.st b/src/Spec2-Adapters-Morphic/Object.extension.st index b1ff110e3..b9dcdac25 100644 --- a/src/Spec2-Adapters-Morphic/Object.extension.st +++ b/src/Spec2-Adapters-Morphic/Object.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Object } +Extension { #name : 'Object' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } Object >> asStyleVariable [ ^ SpStyleVariable newValue: self diff --git a/src/Spec2-Adapters-Morphic/PharoDarkTheme.extension.st b/src/Spec2-Adapters-Morphic/PharoDarkTheme.extension.st index 37ba2e7e7..243305cc7 100644 --- a/src/Spec2-Adapters-Morphic/PharoDarkTheme.extension.st +++ b/src/Spec2-Adapters-Morphic/PharoDarkTheme.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #PharoDarkTheme } +Extension { #name : 'PharoDarkTheme' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } PharoDarkTheme >> paginatorSelectionColor [ ^ self lightBaseColor alpha: 0.8 ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } PharoDarkTheme >> popoverButtonColor [ ^ self lightBaseColor diff --git a/src/Spec2-Adapters-Morphic/RubEditingState.extension.st b/src/Spec2-Adapters-Morphic/RubEditingState.extension.st index 4cade7d15..cc879f1e0 100644 --- a/src/Spec2-Adapters-Morphic/RubEditingState.extension.st +++ b/src/Spec2-Adapters-Morphic/RubEditingState.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RubEditingState } +Extension { #name : 'RubEditingState' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } RubEditingState >> undoManager: aHistoryIterator [ undoManager := aHistoryIterator diff --git a/src/Spec2-Adapters-Morphic/RubScrolledTextMorph.extension.st b/src/Spec2-Adapters-Morphic/RubScrolledTextMorph.extension.st index e36ac2485..bd023dd28 100644 --- a/src/Spec2-Adapters-Morphic/RubScrolledTextMorph.extension.st +++ b/src/Spec2-Adapters-Morphic/RubScrolledTextMorph.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #RubScrolledTextMorph } +Extension { #name : 'RubScrolledTextMorph' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } RubScrolledTextMorph >> registerScrollChanges: aSelector [ self scrollPane announcer when: PaneScrolling send: aSelector to: self model ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } RubScrolledTextMorph >> setSelectionSelector: aSelector [ setSelectionSelector := aSelector ] diff --git a/src/Spec2-Adapters-Morphic/RubTextEditor.extension.st b/src/Spec2-Adapters-Morphic/RubTextEditor.extension.st index 1ce265bdc..a4002ee32 100644 --- a/src/Spec2-Adapters-Morphic/RubTextEditor.extension.st +++ b/src/Spec2-Adapters-Morphic/RubTextEditor.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RubTextEditor } +Extension { #name : 'RubTextEditor' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } RubTextEditor >> lineAtCursorPosition [ | string | @@ -10,7 +10,7 @@ RubTextEditor >> lineAtCursorPosition [ ifNil: [ '' ] ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } RubTextEditor >> lineIntervalAtCursorPosition [ | string lastEnd index lastStart | diff --git a/src/Spec2-Adapters-Morphic/SpAbstractAdapter.extension.st b/src/Spec2-Adapters-Morphic/SpAbstractAdapter.extension.st index 0f9f17519..12f7865c2 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractAdapter.extension.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractAdapter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #SpAbstractAdapter } +Extension { #name : 'SpAbstractAdapter' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpAbstractAdapter >> isMorphicAdapter [ ^ false diff --git a/src/Spec2-Adapters-Morphic/SpAbstractListPresenter.extension.st b/src/Spec2-Adapters-Morphic/SpAbstractListPresenter.extension.st index 41ed25f70..3d210ce49 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractListPresenter.extension.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractListPresenter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #SpAbstractListPresenter } +Extension { #name : 'SpAbstractListPresenter' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpAbstractListPresenter >> iconFor: anItem [ "This is needed for the Morphic backend because all of them share the same datasource asking for this method. For lists without icons it will return nil." diff --git a/src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st b/src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st index 8a803abfc..aa40b32f8 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st @@ -2,12 +2,14 @@ I am an abstract class providing all the properties shared amongs all the morphic specific adapters " Class { - #name : #SpAbstractMorphicAdapter, - #superclass : #SpAbstractAdapter, - #category : #'Spec2-Adapters-Morphic-Base' + #name : 'SpAbstractMorphicAdapter', + #superclass : 'SpAbstractAdapter', + #category : 'Spec2-Adapters-Morphic-Base', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractMorphicAdapter class >> adaptingName [ "Override me if adapter will not follow the common pattern" @@ -16,25 +18,31 @@ SpAbstractMorphicAdapter class >> adaptingName [ ^ (self name withoutPrefix: 'SpMorphic') asSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractMorphicAdapter class >> allAdapters [ ^ self allSubclasses ] -{ #category : #'drag and drop' } +{ #category : 'testing' } +SpAbstractMorphicAdapter class >> isAbstract [ + + ^ self == SpAbstractMorphicAdapter +] + +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> acceptDropBlock [ ^ self model acceptDropBlock ] -{ #category : #'drag and drop - private' } +{ #category : 'drag and drop - private' } SpAbstractMorphicAdapter >> acceptDroppingMorph: draggedMorph event: event inMorph: source [ ^ self acceptDropBlock cull: draggedMorph model model cull: event cull: source model model ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicAdapter >> adapt: aPresenter [ super adapt: aPresenter. @@ -43,12 +51,12 @@ SpAbstractMorphicAdapter >> adapt: aPresenter [ self addEventsTo: self widget ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> add: anAdapter [ self widgetDo: [ :w | w spEnsureLayoutAndAddMorph: anAdapter widget ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicAdapter >> addContextMenuKeyBindings: aWidget [ self flag: #TODO. "Take this from a configuration" @@ -58,7 +66,7 @@ SpAbstractMorphicAdapter >> addContextMenuKeyBindings: aWidget [ ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicAdapter >> addFocusRotationKeyBindings [ self presenter canTakeKeyboardFocus ifFalse: [ ^ self ]. @@ -71,7 +79,7 @@ SpAbstractMorphicAdapter >> addFocusRotationKeyBindings [ toAction: [ self focusPrevious ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicAdapter >> addKeyBindingsTo: aMorph [ self addFocusRotationKeyBindings. @@ -82,7 +90,7 @@ SpAbstractMorphicAdapter >> addKeyBindingsTo: aMorph [ toAction: each action ] ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicAdapter >> addSettingsTo: aMorph [ self widget ifNil: [ ^ self ]. @@ -94,36 +102,36 @@ SpAbstractMorphicAdapter >> addSettingsTo: aMorph [ self applyVisibility ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> addStyle: aStyle [ "ignore style and just apply it again (the new style will not there)" self applyStyle: self widget ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractMorphicAdapter >> application [ ^ self presenter application ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> applyStyle [ self applyStyle: self widget ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> applyStyle: morph [ "this will apply general properties to the built morph" self style applyTo: morph ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicAdapter >> applyVisibility [ - "It may happen that some presenters use generic adapters and they do not have an associated presenter. - In that case, do not manage visibility..." + "It may happen that some presenters use generic adapters and they do not have an + associated presenter. In that case, do not manage visibility..." self presenter ifNil: [ ^ self ]. self widget visible: self presenter isVisible. @@ -133,7 +141,7 @@ SpAbstractMorphicAdapter >> applyVisibility [ ifFalse: [ self widget hide ] ] ] -{ #category : #'protocol - shortcuts' } +{ #category : 'protocol - shortcuts' } SpAbstractMorphicAdapter >> bindKeyCombination: aShortcut toAction: aBlock [ self widgetDo: [ :w | @@ -142,31 +150,31 @@ SpAbstractMorphicAdapter >> bindKeyCombination: aShortcut toAction: aBlock [ toAction: aBlock ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> borderColor [ ^ self model borderColor ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> borderColor: color [ self widget ifNotNil: [ :w | w borderColor: color ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> borderWidth [ ^ self model borderWidth ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> borderWidth: width [ self widget ifNotNil: [ :w | w borderWidth: width ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicAdapter >> buildMenu: aMenuPresenter [ ^ aMenuPresenter @@ -174,84 +182,84 @@ SpAbstractMorphicAdapter >> buildMenu: aMenuPresenter [ build ] -{ #category : #'spec protocol' } +{ #category : 'spec protocol' } SpAbstractMorphicAdapter >> changed [ ^ self widgetDo: [ :w | w changed ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> color [ ^ self model color ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> color: color [ self widgetDo: [ :w | w color: color ] ] -{ #category : #'spec protocol' } +{ #category : 'spec protocol' } SpAbstractMorphicAdapter >> delete [ self widgetDo: [ :w | w delete ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> disable [ self model enabled: false ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> dragEnabled [ ^ self presenter dragEnabled ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> dragEnabled: aBoolean [ self widget ifNotNil: [ :w | w dragEnabled: aBoolean ] ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> dropEnabled [ ^ self presenter dropEnabled ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> dropEnabled: aBoolean [ self widget ifNotNil: [ :w | w dropEnabled: aBoolean ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> enable [ self model enabled: true ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> enabled [ ^ self presenter isEnabled ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> enabled: aBoolean [ self widgetDo: [ :w | w enabled: aBoolean ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> extent [ ^ self widget extent ] -{ #category : #'focus handling' } +{ #category : 'focus handling' } SpAbstractMorphicAdapter >> focusNext [ self presenter withWindowDo: [ :window | | presenters | @@ -262,7 +270,7 @@ SpAbstractMorphicAdapter >> focusNext [ takeKeyboardFocus ] ] -{ #category : #'focus handling' } +{ #category : 'focus handling' } SpAbstractMorphicAdapter >> focusPrevious [ self presenter withWindowDo: [ :window | | presenters | @@ -273,37 +281,37 @@ SpAbstractMorphicAdapter >> focusPrevious [ takeKeyboardFocus ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> hRigid [ self widgetDo: [ :w | w hResizing: #rigid ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> hShrinkWrap [ self widgetDo: [ :w | w hResizing: #shrinkWrap ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> hSpaceFill [ self widgetDo: [ :w | w hResizing: #spaceFill ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> help [ ^ self model help ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractMorphicAdapter >> helpText [ ^ self widget balloonText ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installEvent: anEvent [ "Used when installing events into presenters already built" @@ -313,23 +321,25 @@ SpAbstractMorphicAdapter >> installEvent: anEvent [ target: (self eventHandlerReceiver: w) ] ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installFocusLostEvent: anEvent to: aWidget [ - aWidget announcer + aWidget announcer when: MorphLostFocus do: [ anEvent action value ] + for: self ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installFocusReceivedEvent: anEvent to: aWidget [ - aWidget announcer + aWidget announcer when: MorphGotFocus - do: [ anEvent action value ] + do: [ anEvent action cull: anEvent ] + for: self ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installKeyDownEvent: anEvent to: aWidget [ aWidget @@ -338,7 +348,7 @@ SpAbstractMorphicAdapter >> installKeyDownEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installKeyUpEvent: anEvent to: aWidget [ aWidget @@ -347,7 +357,7 @@ SpAbstractMorphicAdapter >> installKeyUpEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseDoubleClickEvent: anEvent to: aWidget [ aWidget @@ -356,7 +366,7 @@ SpAbstractMorphicAdapter >> installMouseDoubleClickEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseDownEvent: anEvent to: aWidget [ aWidget @@ -365,7 +375,7 @@ SpAbstractMorphicAdapter >> installMouseDownEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseEnterEvent: anEvent to: aWidget [ aWidget @@ -374,7 +384,7 @@ SpAbstractMorphicAdapter >> installMouseEnterEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseLeaveEvent: anEvent to: aWidget [ aWidget @@ -383,7 +393,7 @@ SpAbstractMorphicAdapter >> installMouseLeaveEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseMoveEvent: anEvent to: aWidget [ aWidget @@ -392,7 +402,7 @@ SpAbstractMorphicAdapter >> installMouseMoveEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #'event installing' } +{ #category : 'event installing' } SpAbstractMorphicAdapter >> installMouseUpEvent: anEvent to: aWidget [ aWidget @@ -401,19 +411,19 @@ SpAbstractMorphicAdapter >> installMouseUpEvent: anEvent to: aWidget [ to: anEvent action ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractMorphicAdapter >> isMorphicAdapter [ ^ true ] -{ #category : #visibility } +{ #category : 'visibility' } SpAbstractMorphicAdapter >> isVisible [ ^ widget visible ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> keyDown: keyCode shift: shiftBoolean meta: metaBoolean control: controlBoolean option: optionBoolean [ ^ self @@ -425,7 +435,7 @@ SpAbstractMorphicAdapter >> keyDown: keyCode shift: shiftBoolean meta: metaBoole option: optionBoolean ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> keyEvent: type code: keyCode shift: shiftBoolean meta: metaBoolean control: controlBoolean option: optionBoolean [ | evt modifiers | @@ -456,7 +466,7 @@ SpAbstractMorphicAdapter >> keyEvent: type code: keyCode shift: shiftBoolean met 10 milliSeconds wait ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> keyPressed: keyCode shift: shiftBoolean meta: metaBoolean control: controlBoolean option: optionBoolean [ ^ self @@ -468,40 +478,40 @@ SpAbstractMorphicAdapter >> keyPressed: keyCode shift: shiftBoolean meta: metaBo option: optionBoolean ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> layout: aLayout [ | layout | layout := aLayout asMorphicLayout. self widgetDo: [ :w | w layoutFrame: layout ]. ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> presenterStyles [ "The presenters in the style" ^ self presenter styles ] -{ #category : #'protocol - shortcuts' } +{ #category : 'protocol - shortcuts' } SpAbstractMorphicAdapter >> removeKeyCombination: aShortcut [ self widgetDo: [ :w | w removeKeyCombination: aShortcut ] ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> removeStyle: aStyle [ "ignore style and just apply it again (the removed style will not be there)" self applyStyle: self widget ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> removeSubWidgets [ self widgetDo: [ :w | w removeAllMorphs ] ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> sendClickEvent [ | evt | @@ -518,7 +528,7 @@ SpAbstractMorphicAdapter >> sendClickEvent [ widget handleMouseUp: evt ] ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> sendMouseDownEvent: aMouseButtonEvent [ | evt | @@ -534,7 +544,7 @@ SpAbstractMorphicAdapter >> sendMouseDownEvent: aMouseButtonEvent [ ifTrue: [ widget handleMouseDown: evt ] ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> sendMouseUpEvent: aMouseButtonEvent [ | evt | @@ -552,7 +562,7 @@ SpAbstractMorphicAdapter >> sendMouseUpEvent: aMouseButtonEvent [ ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> sendRightClickEvent [ | evt | @@ -569,7 +579,7 @@ SpAbstractMorphicAdapter >> sendRightClickEvent [ widget mouseUp: evt ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> setBalloonText: aString [ self widget ifNotNil: [ :w | @@ -578,20 +588,20 @@ SpAbstractMorphicAdapter >> setBalloonText: aString [ ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> show [ self widgetDo: #show ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicAdapter >> showContextMenu [ self presenter contextMenu ifNil: [ ^ self ]. self showMenu: self presenter contextMenu ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicAdapter >> showMenu: aValuable [ | lastShownMenu | @@ -599,7 +609,7 @@ SpAbstractMorphicAdapter >> showMenu: aValuable [ lastShownMenu open ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> style [ ^ SpMorphStyle @@ -607,26 +617,26 @@ SpAbstractMorphicAdapter >> style [ adapter: self ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> styleName [ "i.e. SpButtonAdapter = button" ^ ((self className withoutPrefix: 'SpMorphic') allButLast: 7) uncapitalized ] -{ #category : #styling } +{ #category : 'styling' } SpAbstractMorphicAdapter >> styleSheet [ ^ self application styleSheet ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> takeKeyboardFocus [ self widgetDo: [ :w | w takeKeyboardFocus ] ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicAdapter >> transferFor: passenger from: source [ ^ SpTransferPresenter new @@ -635,7 +645,7 @@ SpAbstractMorphicAdapter >> transferFor: passenger from: source [ yourself ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> type: aString [ aString do: [ :each | @@ -647,49 +657,50 @@ SpAbstractMorphicAdapter >> type: aString [ option: false ] ] -{ #category : #releasing } +{ #category : 'releasing' } SpAbstractMorphicAdapter >> unsubscribe [ super unsubscribe. - self presenter hasAnnouncer ifFalse: [ ^ self ]. self presenter announcer unsubscribe: self widget; unsubscribe: self ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> useProportionalLayout [ self widgetDo: [ :w | w changeProportionalLayout ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> vRigid [ self widgetDo: [ :w | w vResizing: #rigid ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> vShrinkWrap [ self widgetDo: [ :w | w vResizing: #shrinkWrap ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> vSpaceFill [ self widgetDo: [ :w | w vResizing: #spaceFill ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractMorphicAdapter >> when: anAnnouncement do: aBlock [ - self widgetDo: [ :w | w announcer - when: anAnnouncement do: aBlock ] + self widgetDo: [ :w | + w announcer + when: anAnnouncement + do: aBlock ] ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicAdapter >> widgetEventReceiver [ ^ self eventHandlerReceiver: widget diff --git a/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st b/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st index bb0174f93..cbc7587d3 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st @@ -3,17 +3,19 @@ I am an abstract class with common behaviour for list and table adapters. See my subclasses for more details. " Class { - #name : #SpAbstractMorphicListAdapter, - #superclass : #SpAbstractMorphicAdapter, - #category : #'Spec2-Adapters-Morphic-List' + #name : 'SpAbstractMorphicListAdapter', + #superclass : 'SpAbstractMorphicAdapter', + #category : 'Spec2-Adapters-Morphic-List', + #package : 'Spec2-Adapters-Morphic', + #tag : 'List' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractMorphicListAdapter class >> isAbstract [ ^ self = SpAbstractMorphicListAdapter ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicListAdapter >> acceptDroppingMorph: aTransferMorph event: anEvent [ self presenter acceptDrop cull: (self @@ -21,7 +23,7 @@ SpAbstractMorphicListAdapter >> acceptDroppingMorph: aTransferMorph event: anEve event: anEvent) ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicListAdapter >> addActivationKeyBindings: aWidget [ self @@ -29,7 +31,7 @@ SpAbstractMorphicListAdapter >> addActivationKeyBindings: aWidget [ toAction: [ self triggerActivationAction ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractMorphicListAdapter >> addKeyBindingsTo: aWidget [ super addKeyBindingsTo: aWidget. @@ -37,35 +39,35 @@ SpAbstractMorphicListAdapter >> addKeyBindingsTo: aWidget [ self addActivationKeyBindings: aWidget ] -{ #category : #scrolling } +{ #category : 'scrolling' } SpAbstractMorphicListAdapter >> configureScrolling [ - self presenter verticalAlignment - whenChangedDo: [ widget - scrollToIndex: self presenter verticalAlignment desiredVisibleRow ]. - - self presenter - whenDisplayDo: [ widget - scrollToIndex: self presenter verticalAlignment desiredVisibleRow. - self scrollingChanged ]. + | vAlignment | + + vAlignment := self presenter verticalAlignment. + vAlignment whenChangedDo: [ + widget scrollToIndex: vAlignment desiredVisibleRow ]. + self presenter whenDisplayDo: [ + widget scrollToIndex: vAlignment desiredVisibleRow. + self scrollingChanged ]. widget onAnnouncement: FTScrollingChanged send: #scrollingChanged - to: self. + to: self ] -{ #category : #'widget API' } +{ #category : 'widget API' } SpAbstractMorphicListAdapter >> elementAt: index [ ^ self widget dataSource elementAt: index ] -{ #category : #'widget API' } +{ #category : 'widget API' } SpAbstractMorphicListAdapter >> itemFilter [ ^ self model itemFilter ] -{ #category : #scrolling } +{ #category : 'scrolling' } SpAbstractMorphicListAdapter >> scrollingChanged [ widget container updateAllRows. self presenter verticalAlignment @@ -73,7 +75,7 @@ SpAbstractMorphicListAdapter >> scrollingChanged [ lastVisibleRowIndex: widget lastVisibleRowIndex ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicListAdapter >> sendClickEventToRow: aNumber [ | evt rowWidget | @@ -91,7 +93,7 @@ SpAbstractMorphicListAdapter >> sendClickEventToRow: aNumber [ widget handleMouseUp: evt ] ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractMorphicListAdapter >> sendClickWithShiftEventToRow: aNumber [ | evt rowWidget | @@ -109,14 +111,14 @@ SpAbstractMorphicListAdapter >> sendClickWithShiftEventToRow: aNumber [ widget handleMouseUp: evt ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicListAdapter >> showContextMenu [ self widgetDo: [ :w | w showMenuForIndex: { self presenter selection selectedIndex. 1 } ] ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicListAdapter >> transferFrom: aTransferMorph event: anEvent [ | rowAndColumn | @@ -127,13 +129,13 @@ SpAbstractMorphicListAdapter >> transferFrom: aTransferMorph event: anEvent [ yourself ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicListAdapter >> triggerActivationAction [ self presenter doActivateAtIndex: self presenter selection selectedIndex ] -{ #category : #factory } +{ #category : 'factory' } SpAbstractMorphicListAdapter >> updateItemFilterBlockWith: block [ ^ block @@ -145,7 +147,7 @@ SpAbstractMorphicListAdapter >> updateItemFilterBlockWith: block [ self updateSearch ] ] -{ #category : #factory } +{ #category : 'factory' } SpAbstractMorphicListAdapter >> updateSearch [ self presenter isSearchEnabled @@ -153,7 +155,7 @@ SpAbstractMorphicListAdapter >> updateSearch [ ifFalse: [ widget disableFunction ] ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractMorphicListAdapter >> wantsDroppedMorph: aTransferMorph event: anEvent [ ^ self presenter wantsDrop cull: (self diff --git a/src/Spec2-Adapters-Morphic/SpAbstractMorphicWindowAdapter.class.st b/src/Spec2-Adapters-Morphic/SpAbstractMorphicWindowAdapter.class.st index fd8d0f552..df4ca09f7 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractMorphicWindowAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractMorphicWindowAdapter.class.st @@ -2,22 +2,24 @@ I am the adapter used to bridge window presenters and windows or worlds " Class { - #name : #SpAbstractMorphicWindowAdapter, - #superclass : #SpAbstractMorphicAdapter, + #name : 'SpAbstractMorphicWindowAdapter', + #superclass : 'SpAbstractMorphicAdapter', #instVars : [ 'toolbarMorph', 'menuMorph' ], - #category : #'Spec2-Adapters-Morphic-Base' + #category : 'Spec2-Adapters-Morphic-Base', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Base' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractMorphicWindowAdapter class >> isAbstract [ - ^self name = #SpAbstractMorphicWindowAdapter + ^self == SpAbstractMorphicWindowAdapter ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> add: containerMorph toWindow: aSpecWindow [ aSpecWindow @@ -25,7 +27,7 @@ SpAbstractMorphicWindowAdapter >> add: containerMorph toWindow: aSpecWindow [ fullFrame: LayoutFrame identity ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> addContent: aMorph toWindow: aSpecWindow [ | containerMorph | @@ -49,7 +51,7 @@ SpAbstractMorphicWindowAdapter >> addContent: aMorph toWindow: aSpecWindow [ self add: containerMorph toWindow: aSpecWindow ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> addMenuTo: aMorph [ menuMorph := self model menu build. @@ -59,7 +61,7 @@ SpAbstractMorphicWindowAdapter >> addMenuTo: aMorph [ vResizing: #rigid ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> addStatusBarTo: aMorph [ | statusBarMorph | @@ -70,7 +72,7 @@ SpAbstractMorphicWindowAdapter >> addStatusBarTo: aMorph [ vResizing: #rigid ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> newContainerMorph [ ^ Morph new @@ -82,7 +84,7 @@ SpAbstractMorphicWindowAdapter >> newContainerMorph [ yourself ] -{ #category : #private } +{ #category : 'private' } SpAbstractMorphicWindowAdapter >> setToolbarTo: aMorph [ | newToolbarMorph toolbarPresenter | diff --git a/src/Spec2-Adapters-Morphic/SpAbstractTextPresenter.extension.st b/src/Spec2-Adapters-Morphic/SpAbstractTextPresenter.extension.st index c6cba4964..11bf6483a 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractTextPresenter.extension.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractTextPresenter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #SpAbstractTextPresenter } +Extension { #name : 'SpAbstractTextPresenter' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpAbstractTextPresenter >> pendingText [ "Return the current pending text" @@ -10,7 +10,7 @@ SpAbstractTextPresenter >> pendingText [ ^ self getText ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpAbstractTextPresenter >> pendingText: aText [ "Set the pending text. Do no accept it" diff --git a/src/Spec2-Adapters-Morphic/SpApplication.extension.st b/src/Spec2-Adapters-Morphic/SpApplication.extension.st index c1bc55dfd..b59895cdd 100644 --- a/src/Spec2-Adapters-Morphic/SpApplication.extension.st +++ b/src/Spec2-Adapters-Morphic/SpApplication.extension.st @@ -1,24 +1,24 @@ -Extension { #name : #SpApplication } +Extension { #name : 'SpApplication' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpApplication >> addStyleSheet: aStylesheet [ self ensureConfiguration addStyleSheet: aStylesheet ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpApplication >> addStyleSheetFromString: aString [ self ensureConfiguration addStyleSheetFromString: aString ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpApplication >> defaultConfigurationForMorphic [ ^ SpMorphicConfiguration new ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpApplication >> styleSheet [ "A stylesheet defines the application style. You can defins your own (but it don't, we will take the default)" @@ -26,7 +26,7 @@ SpApplication >> styleSheet [ ^ self ensureConfiguration styleSheet ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpApplication >> styleSheet: aStyleSheet [ self ensureConfiguration styleSheet: aStyleSheet diff --git a/src/Spec2-Adapters-Morphic/SpAthensMorph.class.st b/src/Spec2-Adapters-Morphic/SpAthensMorph.class.st index af1c477e4..d5825d0fc 100644 --- a/src/Spec2-Adapters-Morphic/SpAthensMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpAthensMorph.class.st @@ -2,23 +2,25 @@ It exposes an athens surface in a morph " Class { - #name : #SpAthensMorph, - #superclass : #Morph, + #name : 'SpAthensMorph', + #superclass : 'Morph', #instVars : [ 'surface', 'drawBlock', 'lastExtent' ], - #category : #'Spec2-Adapters-Morphic-Base' + #category : 'Spec2-Adapters-Morphic-Base', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SpAthensMorph >> drawBlock: aBlock [ drawBlock := aBlock ] -{ #category : #drawing } +{ #category : 'drawing' } SpAthensMorph >> drawOn: aMorphicCanvas [ self redraw. @@ -27,7 +29,7 @@ SpAthensMorph >> drawOn: aMorphicCanvas [ at: bounds origin ] -{ #category : #drawing } +{ #category : 'drawing' } SpAthensMorph >> redraw [ self surface drawDuring: [ :canvas | @@ -36,7 +38,7 @@ SpAthensMorph >> redraw [ cull: (0@0 extent: self extent) ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpAthensMorph >> surface [ lastExtent = self extent ifFalse: [ surface := nil ]. diff --git a/src/Spec2-Adapters-Morphic/SpClassStyle.class.st b/src/Spec2-Adapters-Morphic/SpClassStyle.class.st index 107e726fb..b294d4ff8 100644 --- a/src/Spec2-Adapters-Morphic/SpClassStyle.class.st +++ b/src/Spec2-Adapters-Morphic/SpClassStyle.class.st @@ -27,23 +27,25 @@ myStyle := SpStyle defaultStyleSheet, myOwnStyleDefinition ]]] " Class { - #name : #SpClassStyle, - #superclass : #SpStyle, + #name : 'SpClassStyle', + #superclass : 'SpStyle', #instVars : [ 'parent', 'name', 'styles' ], - #category : #'Spec2-Adapters-Morphic-StyleSheet' + #category : 'Spec2-Adapters-Morphic-StyleSheet', + #package : 'Spec2-Adapters-Morphic', + #tag : 'StyleSheet' } -{ #category : #copying } +{ #category : 'copying' } SpClassStyle >> , joinStyle [ ^ self mergeWith: joinStyle ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addClass: aName with: aBlock [ | class | @@ -56,7 +58,7 @@ SpClassStyle >> addClass: aName with: aBlock [ self addStyle: class ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addProperty: aClass with: aBlock [ | property | @@ -65,51 +67,51 @@ SpClassStyle >> addProperty: aClass with: aBlock [ self addStyle: property ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addPropertyContainerWith: aBlock [ self addProperty: SpContainerStyle with: aBlock ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addPropertyDrawWith: aBlock [ self addProperty: SpDrawStyle with: aBlock ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addPropertyFontWith: aBlock [ self addProperty: SpFontStyle with: aBlock ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addPropertyGeometryWith: aBlock [ self addProperty: SpGeometryStyle with: aBlock ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addPropertyTextWith: aBlock [ self addProperty: SpTextStyle with: aBlock ] -{ #category : #adding } +{ #category : 'adding' } SpClassStyle >> addStyle: aStyle [ styles ifNil: [ styles := #() ]. styles := styles copyWith: aStyle ] -{ #category : #operations } +{ #category : 'operations' } SpClassStyle >> applyTo: aMorph [ self properties do: [ :each | each applyTo: aMorph ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> flattenClasses [ ^ (self styles @@ -120,7 +122,7 @@ SpClassStyle >> flattenClasses [ flattened ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> flattenProperties [ ^ (self flattenClasses @@ -129,13 +131,13 @@ SpClassStyle >> flattenProperties [ flattened ] -{ #category : #initialization } +{ #category : 'initialization' } SpClassStyle >> fromSton: stonReader [ styles := stonReader parseList ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> fullName [ ^ (self parent @@ -148,20 +150,20 @@ SpClassStyle >> fullName [ ifNil: [ self name ]) ] -{ #category : #initialization } +{ #category : 'initialization' } SpClassStyle >> initialize [ super initialize. styles := #() ] -{ #category : #testing } +{ #category : 'testing' } SpClassStyle >> isStyleClass [ ^ true ] -{ #category : #copying } +{ #category : 'copying' } SpClassStyle >> mergeWith: joinStyle [ ^ self class new @@ -170,7 +172,7 @@ SpClassStyle >> mergeWith: joinStyle [ yourself ] -{ #category : #private } +{ #category : 'private' } SpClassStyle >> mergedStylesWith: anotherStyle [ | allStyles results| @@ -186,50 +188,50 @@ SpClassStyle >> mergedStylesWith: anotherStyle [ ^ results asArray ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> name: aString [ name := aString ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> parent [ ^ parent ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> parent: aStyle [ parent := aStyle ] -{ #category : #printing } +{ #category : 'printing' } SpClassStyle >> printOn: stream [ super printOn: stream. stream << '(' << self fullName << ')' ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> properties [ ^ self styles select: [ :each | each isStyleProperty ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpClassStyle >> styles [ ^ styles ] -{ #category : #private } +{ #category : 'private' } SpClassStyle >> styles: aCollection [ styles := aCollection asArray diff --git a/src/Spec2-Adapters-Morphic/SpComponentListDataSource.class.st b/src/Spec2-Adapters-Morphic/SpComponentListDataSource.class.st index 9ace27796..947a3ae50 100644 --- a/src/Spec2-Adapters-Morphic/SpComponentListDataSource.class.st +++ b/src/Spec2-Adapters-Morphic/SpComponentListDataSource.class.st @@ -1,13 +1,15 @@ Class { - #name : #SpComponentListDataSource, - #superclass : #FTDataSource, + #name : 'SpComponentListDataSource', + #superclass : 'FTDataSource', #instVars : [ 'model' ], - #category : #'Spec2-Adapters-Morphic-List' + #category : 'Spec2-Adapters-Morphic-List', + #package : 'Spec2-Adapters-Morphic', + #tag : 'List' } -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> cellColumn: column row: rowIndex [ | cell item | @@ -20,19 +22,19 @@ SpComponentListDataSource >> cellColumn: column row: rowIndex [ ^ cell ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> elementAt: rowIndex [ ^ self presenters at: rowIndex ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> elements [ ^ self presenters ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> headerColumn: column [ column id ifNil: [ ^ nil ]. @@ -42,7 +44,7 @@ SpComponentListDataSource >> headerColumn: column [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> menuColumn: column row: rowIndex [ | menuPresenter | @@ -58,17 +60,17 @@ SpComponentListDataSource >> menuColumn: column row: rowIndex [ ifFalse: [ m build ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> model [ ^ model ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> model: anObject [ model := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> newDataSourceMatching: aFTFilter [ | newElements wrappedItem text newDataSource modelCopy | @@ -86,7 +88,7 @@ SpComponentListDataSource >> newDataSourceMatching: aFTFilter [ ^newDataSource ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> numberOfRows [ ^ model @@ -94,20 +96,20 @@ SpComponentListDataSource >> numberOfRows [ ifNotNil: [ self presenters size ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> presenters [ ^ self model presenters ] -{ #category : #accessing } +{ #category : 'accessing' } SpComponentListDataSource >> rowHeight: rowIndex [ rowIndex = 0 ifTrue: [ ^ super rowHeight: rowIndex ]. ^ (self widgetFor: (self elementAt: rowIndex)) height ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpComponentListDataSource >> transferFor: passenger from: aMorph [ ^ (self model adapter @@ -116,7 +118,7 @@ SpComponentListDataSource >> transferFor: passenger from: aMorph [ build ] -{ #category : #private } +{ #category : 'private' } SpComponentListDataSource >> widgetFor: aPresenter [ | widget | diff --git a/src/Spec2-Adapters-Morphic/SpContainerStyle.class.st b/src/Spec2-Adapters-Morphic/SpContainerStyle.class.st index 33c101daf..175ce96d5 100644 --- a/src/Spec2-Adapters-Morphic/SpContainerStyle.class.st +++ b/src/Spec2-Adapters-Morphic/SpContainerStyle.class.st @@ -21,23 +21,25 @@ Container { ``` " Class { - #name : #SpContainerStyle, - #superclass : #SpPropertyStyle, + #name : 'SpContainerStyle', + #superclass : 'SpPropertyStyle', #instVars : [ 'borderWidth', 'padding', 'borderColor' ], - #category : #'Spec2-Adapters-Morphic-StyleSheet' + #category : 'Spec2-Adapters-Morphic-StyleSheet', + #package : 'Spec2-Adapters-Morphic', + #tag : 'StyleSheet' } -{ #category : #'ston-core' } +{ #category : 'ston-core' } SpContainerStyle class >> stonName [ - ^ 'Container' + ^ #Container ] -{ #category : #operations } +{ #category : 'operations' } SpContainerStyle >> applyTo: aMorph [ self borderColorVariable ifNotNil: [ :aVariable | aMorph borderColor: aVariable valueAsColor ]. @@ -45,7 +47,7 @@ SpContainerStyle >> applyTo: aMorph [ self paddingVariable ifNotNil: [ :aVariable | aMorph cellInset: aVariable scaledValue ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> borderColor [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== @@ -55,13 +57,13 @@ SpContainerStyle >> borderColor [ ^ self borderColorVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> borderColor: aColor [ borderColor := aColor asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpContainerStyle >> borderColorVariable [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== @@ -71,37 +73,37 @@ SpContainerStyle >> borderColorVariable [ ^ self toVariable: borderColor ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> borderWidth [ ^ self borderWidthVariable scaledValue ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> borderWidth: aNumber [ borderWidth := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpContainerStyle >> borderWidthVariable [ ^ self toVariable: borderWidth ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> padding [ ^ self paddingVariable scaledValue ] -{ #category : #accessing } +{ #category : 'accessing' } SpContainerStyle >> padding: aNumber [ padding := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpContainerStyle >> paddingVariable [ ^ self toVariable: padding diff --git a/src/Spec2-Adapters-Morphic/SpDialogWindowMorph.class.st b/src/Spec2-Adapters-Morphic/SpDialogWindowMorph.class.st index 62ba3c85d..64446ffb1 100644 --- a/src/Spec2-Adapters-Morphic/SpDialogWindowMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpDialogWindowMorph.class.st @@ -3,50 +3,52 @@ A SpecDialogWindow is a window made for embedding Spec models into dialog window " Class { - #name : #SpDialogWindowMorph, - #superclass : #DialogWindowMorph, + #name : 'SpDialogWindowMorph', + #superclass : 'DialogWindowMorph', #instVars : [ 'toolbar' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #actions } +{ #category : 'actions' } SpDialogWindowMorph >> addInitialPanel [ "Do nothing here because Spec will take care of adding the content" ] -{ #category : #protocol } +{ #category : 'protocol' } SpDialogWindowMorph >> cancelAction: aBlock [ self toolbar cancelAction: aBlock ] -{ #category : #protocol } +{ #category : 'protocol' } SpDialogWindowMorph >> cancelled [ ^ self toolbar cancelled ] -{ #category : #actions } +{ #category : 'actions' } SpDialogWindowMorph >> escapePressed [ self model triggerCancelAction ] -{ #category : #focus } +{ #category : 'focus' } SpDialogWindowMorph >> giveFocusToNextFrom: aModel [ ^ self model giveFocusToNextFrom: aModel ] -{ #category : #focus } +{ #category : 'focus' } SpDialogWindowMorph >> giveFocusToPreviousFrom: aModel [ ^ self model giveFocusToPreviousFrom: aModel ] -{ #category : #'open/close' } +{ #category : 'open/close' } SpDialogWindowMorph >> initialExtent [ ^ self model @@ -55,25 +57,25 @@ SpDialogWindowMorph >> initialExtent [ ifNil: [ super initialExtent ]] ] -{ #category : #initialization } +{ #category : 'initialization' } SpDialogWindowMorph >> initialize [ super initialize. self beResizeable ] -{ #category : #accessing } +{ #category : 'accessing' } SpDialogWindowMorph >> newButtonRow [ ^ self toolbar ifNotNil: [ :t | t build ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpDialogWindowMorph >> okAction: aBlock [ self toolbar okAction: aBlock ] -{ #category : #protocol } +{ #category : 'protocol' } SpDialogWindowMorph >> setToolbarFrom: aBlock [ | newToolbar | @@ -81,14 +83,14 @@ SpDialogWindowMorph >> setToolbarFrom: aBlock [ self toolbar: newToolbar ] -{ #category : #accessing } +{ #category : 'accessing' } SpDialogWindowMorph >> toolbar [ "Lazy initialization because this method is called efore the initialize method" ^ toolbar ] -{ #category : #accessing } +{ #category : 'accessing' } SpDialogWindowMorph >> toolbar: anObject [ | content | diff --git a/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st b/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st index 5a9db36e6..4d0da6bd6 100644 --- a/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st +++ b/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st @@ -1,19 +1,21 @@ Class { - #name : #SpDragAndDropTransfer, - #superclass : #Object, + #name : 'SpDragAndDropTransfer', + #superclass : 'Object', #instVars : [ 'passenger' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransfer >> passenger [ ^ passenger ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransfer >> passenger: anObject [ passenger := anObject diff --git a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToList.class.st b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToList.class.st index faa833156..edb48f29b 100644 --- a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToList.class.st +++ b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToList.class.st @@ -1,19 +1,21 @@ Class { - #name : #SpDragAndDropTransferToList, - #superclass : #SpDragAndDropTransfer, + #name : 'SpDragAndDropTransferToList', + #superclass : 'SpDragAndDropTransfer', #instVars : [ 'index' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToList >> index [ ^ index ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToList >> index: anInteger [ index := anInteger diff --git a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTable.class.st b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTable.class.st index df0c34402..90330ec9f 100644 --- a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTable.class.st +++ b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTable.class.st @@ -1,32 +1,34 @@ Class { - #name : #SpDragAndDropTransferToTable, - #superclass : #SpDragAndDropTransfer, + #name : 'SpDragAndDropTransferToTable', + #superclass : 'SpDragAndDropTransfer', #instVars : [ 'row', 'column' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTable >> column [ ^ column ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTable >> column: anInteger [ column := anInteger ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTable >> row [ ^ row ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTable >> row: anInteger [ row := anInteger diff --git a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTree.class.st b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTree.class.st index aed610a82..665c36dfd 100644 --- a/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTree.class.st +++ b/src/Spec2-Adapters-Morphic/SpDragAndDropTransferToTree.class.st @@ -1,19 +1,21 @@ Class { - #name : #SpDragAndDropTransferToTree, - #superclass : #SpDragAndDropTransferToTable, + #name : 'SpDragAndDropTransferToTree', + #superclass : 'SpDragAndDropTransferToTable', #instVars : [ 'target' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTree >> target [ ^ target ] -{ #category : #accessing } +{ #category : 'accessing' } SpDragAndDropTransferToTree >> target: anObject [ target := anObject diff --git a/src/Spec2-Adapters-Morphic/SpDrawStyle.class.st b/src/Spec2-Adapters-Morphic/SpDrawStyle.class.st index ba4eb58dc..ba542d5f0 100644 --- a/src/Spec2-Adapters-Morphic/SpDrawStyle.class.st +++ b/src/Spec2-Adapters-Morphic/SpDrawStyle.class.st @@ -20,22 +20,24 @@ Draw { ``` " Class { - #name : #SpDrawStyle, - #superclass : #SpPropertyStyle, + #name : 'SpDrawStyle', + #superclass : 'SpPropertyStyle', #instVars : [ 'color', 'backgroundColor' ], - #category : #'Spec2-Adapters-Morphic-StyleSheet' + #category : 'Spec2-Adapters-Morphic-StyleSheet', + #package : 'Spec2-Adapters-Morphic', + #tag : 'StyleSheet' } -{ #category : #'ston-core' } +{ #category : 'ston-core' } SpDrawStyle class >> stonName [ - ^ 'Draw' + ^ #Draw ] -{ #category : #operations } +{ #category : 'operations' } SpDrawStyle >> applyTo: aMorph [ self color ifNotNil: [ :aColor | @@ -50,7 +52,7 @@ SpDrawStyle >> applyTo: aMorph [ ifFalse: [ aMorph fillStyle: aColor asStyleVariable valueAsColor ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDrawStyle >> backgroundColor [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== @@ -60,13 +62,13 @@ SpDrawStyle >> backgroundColor [ ^ self backgroundColorVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpDrawStyle >> backgroundColor: aColorOrSymbol [ backgroundColor := aColorOrSymbol asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpDrawStyle >> backgroundColorVariable [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== @@ -76,7 +78,7 @@ SpDrawStyle >> backgroundColorVariable [ ^ self toVariable: backgroundColor ] -{ #category : #accessing } +{ #category : 'accessing' } SpDrawStyle >> color [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== @@ -86,13 +88,13 @@ SpDrawStyle >> color [ ^ self colorVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpDrawStyle >> color: aColorOrSymbol [ color := aColorOrSymbol asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpDrawStyle >> colorVariable [ "This property can be expressed as - a STON map: ==Color { #red : 1., #green : 0, #blue : 0, #alpha : 1 }== diff --git a/src/Spec2-Adapters-Morphic/SpDropListMorph.class.st b/src/Spec2-Adapters-Morphic/SpDropListMorph.class.st index d349bc197..70be8f497 100644 --- a/src/Spec2-Adapters-Morphic/SpDropListMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpDropListMorph.class.st @@ -2,45 +2,47 @@ I am a special DropList with icons " Class { - #name : #SpDropListMorph, - #superclass : #DropListMorph, + #name : 'SpDropListMorph', + #superclass : 'DropListMorph', #instVars : [ 'currentIcon' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #configuring } +{ #category : 'configuring' } SpDropListMorph >> configureWith: displayModel item: itemPresenter [ displayModel configureDropList: self item: itemPresenter ] -{ #category : #private } +{ #category : 'private' } SpDropListMorph >> currentIcon [ ^ currentIcon ] -{ #category : #protocol } +{ #category : 'protocol' } SpDropListMorph >> getIconFor: anItem [ ^ self model getIconFor: anItem ] -{ #category : #private } +{ #category : 'private' } SpDropListMorph >> listHeight [ "Answer the height for the list." ^ super listHeight + 12 ] -{ #category : #private } +{ #category : 'private' } SpDropListMorph >> listMorphClass [ ^ PluggableIconListMorph ] -{ #category : #drawing } +{ #category : 'drawing' } SpDropListMorph >> newListMorph [ "Answer a new list morph" @@ -61,7 +63,7 @@ SpDropListMorph >> newListMorph [ yourself ] -{ #category : #private } +{ #category : 'private' } SpDropListMorph >> updateListSelectionIndex [ currentIcon ifNotNil: [ self removeMorph: currentIcon ]. @@ -74,7 +76,7 @@ SpDropListMorph >> updateListSelectionIndex [ self addMorphFront: currentIcon ] ] ] -{ #category : #private } +{ #category : 'private' } SpDropListMorph >> wrapItem: anItem index: anIndex [ ^ self model wrapItem: anItem index: anIndex diff --git a/src/Spec2-Adapters-Morphic/SpFTSpecFilter.class.st b/src/Spec2-Adapters-Morphic/SpFTSpecFilter.class.st index a338a7903..e19a89809 100644 --- a/src/Spec2-Adapters-Morphic/SpFTSpecFilter.class.st +++ b/src/Spec2-Adapters-Morphic/SpFTSpecFilter.class.st @@ -10,32 +10,34 @@ Example FTSpecFilter block: [ :each :pattern | each asLowercase includesSubstring: pattern asLowercase ] " Class { - #name : #SpFTSpecFilter, - #superclass : #FTFilter, + #name : 'SpFTSpecFilter', + #superclass : 'FTFilter', #instVars : [ 'block' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpFTSpecFilter class >> block: aBlockClosure [ ^ self new block: aBlockClosure; yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTSpecFilter >> block [ ^ block ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTSpecFilter >> block: anObject [ block := anObject ] -{ #category : #matching } +{ #category : 'matching' } SpFTSpecFilter >> matches: anObject [ ^ self block cull: anObject cull: pattern ] diff --git a/src/Spec2-Adapters-Morphic/SpFTTableMorph.class.st b/src/Spec2-Adapters-Morphic/SpFTTableMorph.class.st index cf0863a0b..5af9488a5 100644 --- a/src/Spec2-Adapters-Morphic/SpFTTableMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpFTTableMorph.class.st @@ -1,13 +1,15 @@ Class { - #name : #SpFTTableMorph, - #superclass : #FTTableMorph, + #name : 'SpFTTableMorph', + #superclass : 'FTTableMorph', #instVars : [ 'movementDispatcher' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpFTTableMorph >> acceptDroppingMorph: aTransferMorph event: anEvent [ ^ self dataSource model adapter @@ -15,14 +17,14 @@ SpFTTableMorph >> acceptDroppingMorph: aTransferMorph event: anEvent [ event: anEvent ] -{ #category : #drawing } +{ #category : 'drawing' } SpFTTableMorph >> drawKeyboardFocusOn: aCanvas [ self color = Color transparent ifTrue: [ ^ self ]. ^ super drawKeyboardFocusOn: aCanvas ] -{ #category : #'events-processing' } +{ #category : 'events-processing' } SpFTTableMorph >> handleKeyDown: anEvent [ "System level event handling." @@ -45,7 +47,7 @@ SpFTTableMorph >> handleKeyDown: anEvent [ fromMorph: self ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpFTTableMorph >> initializeKeyBindings [ "add keybindings used by table" @@ -73,7 +75,7 @@ SpFTTableMorph >> initializeKeyBindings [ toAction: [ self selectAll ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTTableMorph >> minWidth [ "answer the receiver's minHeight" ^ self @@ -81,7 +83,7 @@ SpFTTableMorph >> minWidth [ ifAbsent: [ 100 ] ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpFTTableMorph >> wantsDroppedMorph: aTransferMorph event: anEvent [ aTransferMorph isTransferable ifFalse: [ ^ false ]. diff --git a/src/Spec2-Adapters-Morphic/SpFixedProgressBarState.extension.st b/src/Spec2-Adapters-Morphic/SpFixedProgressBarState.extension.st index c0ac60f9b..bae86e396 100644 --- a/src/Spec2-Adapters-Morphic/SpFixedProgressBarState.extension.st +++ b/src/Spec2-Adapters-Morphic/SpFixedProgressBarState.extension.st @@ -1,13 +1,13 @@ -Extension { #name : #SpFixedProgressBarState } +Extension { #name : 'SpFixedProgressBarState' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpFixedProgressBarState >> customizeMorphicBar: aProgressBarMorph [ aProgressBarMorph value: self value ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpFixedProgressBarState >> customizeMorphicLabel: aLabelMorph [ - aLabelMorph contents: (self value * 100) asInteger asString, '%' + aLabelMorph contents: ((self value * 100) asInteger min: 100) asString, '%' ] diff --git a/src/Spec2-Adapters-Morphic/SpFontStyle.class.st b/src/Spec2-Adapters-Morphic/SpFontStyle.class.st index 85644c4a8..cfa8e1c90 100644 --- a/src/Spec2-Adapters-Morphic/SpFontStyle.class.st +++ b/src/Spec2-Adapters-Morphic/SpFontStyle.class.st @@ -43,8 +43,8 @@ Font { " Class { - #name : #SpFontStyle, - #superclass : #SpPropertyStyle, + #name : 'SpFontStyle', + #superclass : 'SpPropertyStyle', #instVars : [ 'predefinedFont', 'name', @@ -54,45 +54,66 @@ Class { 'color' ], #classVars : [ + 'ApplyDisplayScaleFactor', 'FontCache' ], - #category : #'Spec2-Adapters-Morphic-StyleSheet' + #category : 'Spec2-Adapters-Morphic-StyleSheet', + #package : 'Spec2-Adapters-Morphic', + #tag : 'StyleSheet' } -{ #category : #private } +{ #category : 'private' } SpFontStyle class >> addFontToCache: aFont [ self fontCache add: aFont ] -{ #category : #private } +{ #category : 'accessing' } +SpFontStyle class >> applyDisplayScaleFactor [ + + ^ ApplyDisplayScaleFactor ifNil: [ true ] +] + +{ #category : 'accessing' } +SpFontStyle class >> applyDisplayScaleFactor: aBoolean [ + + ApplyDisplayScaleFactor := aBoolean +] + +{ #category : 'private' } SpFontStyle class >> fontCache [ ^ FontCache ifNil: [ FontCache := WeakSet new ] ] -{ #category : #'ston-core' } +{ #category : 'ston-core' } SpFontStyle class >> stonName [ - ^ 'Font' + ^ #Font ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> addFontToCache: aFont [ self class addFontToCache: aFont ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> anyFontDecorator [ - ^ color notNil - or: [ size notNil - or: [ bold notNil - or: [ italic notNil ] ] ] + ^ color isNotNil + or: [ size isNotNil + or: [ bold isNotNil + or: [ italic isNotNil ] ] ] ] -{ #category : #operations } +{ #category : 'private' } +SpFontStyle >> applyDisplayScaleFactor [ + + ^ self class applyDisplayScaleFactor +] + +{ #category : 'operations' } SpFontStyle >> applyTo: aMorph [ "not all morphs understand font, I need to verify it (which is not cool verifying a @@ -108,25 +129,25 @@ SpFontStyle >> applyTo: aMorph [ aMorph textColor: self colorVariable valueAsColor ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> bold [ ^ self boldVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> bold: aBoolean [ bold := aBoolean asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpFontStyle >> boldVariable [ ^ self toVariable: bold ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> calculateDefinedFont [ | font | @@ -140,7 +161,7 @@ SpFontStyle >> calculateDefinedFont [ ^ font ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> calculateFontName [ | var | @@ -150,21 +171,21 @@ SpFontStyle >> calculateFontName [ ifFalse: [ var value ] ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> calculateFontSize [ self sizeVariable ifNotNil: [ :aVariable | aVariable value ifNotNil: [ - ^ self sizeVariable scaledValue ] ]. + ^ self scaledSize ] ]. self nameVariable isEnvironmentVariable ifTrue: [ - ^ self nameVariable pointSize * self currentWorld displayScaleFactor ]. + ^ self nameVariable pointSize * self displayScaleFactor ]. self hasPredefinedFont ifTrue: [ - ^ self obtainPredefinedFont pointSize * self currentWorld displayScaleFactor ]. + ^ self obtainPredefinedFont pointSize * self displayScaleFactor ]. ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> color [ "This is meant to set the text color. This property can be expressed as @@ -175,13 +196,13 @@ SpFontStyle >> color [ ^ self colorVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> color: aColorOrSymbol [ color := aColorOrSymbol asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpFontStyle >> colorVariable [ "This is meant to set the text color. This property can be expressed as @@ -192,11 +213,11 @@ SpFontStyle >> colorVariable [ ^ self toVariable: color ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> definedFont [ | definedFont | - (self predefinedFont notNil and: [ self anyFontDecorator not ]) ifTrue: [ + (self predefinedFont isNotNil and: [ self anyFontDecorator not ]) ifTrue: [ ^ self obtainPredefinedFont ]. self withCachedFontDo: [ :aFont | ^ aFont ]. @@ -206,51 +227,59 @@ SpFontStyle >> definedFont [ ^ definedFont ] -{ #category : #private } +{ #category : 'private' } +SpFontStyle >> displayScaleFactor [ + + ^ self applyDisplayScaleFactor + ifTrue: [ self currentWorld displayScaleFactor ] + ifFalse: [ 1 ] +] + +{ #category : 'private' } SpFontStyle >> hasPredefinedFont [ - ^ self predefinedFont notNil + ^ self predefinedFont isNotNil ] -{ #category : #testing } +{ #category : 'testing' } SpFontStyle >> isBold [ "property may be nil, we verify with strict comparisson" ^ self boldVariable value == true ] -{ #category : #testing } +{ #category : 'testing' } SpFontStyle >> isItalic [ "property may be nil, we verify with strict comparisson" ^ self italicVariable value == true ] -{ #category : #testing } +{ #category : 'testing' } SpFontStyle >> isReset [ - ^ name notNil and: [ name isResetVariable ] + ^ name isNotNil and: [ name isResetVariable ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> italic [ ^ self italicVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> italic: aBoolean [ italic := aBoolean asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpFontStyle >> italicVariable [ ^ italic ] -{ #category : #operations } +{ #category : 'operations' } SpFontStyle >> mergeWith: otherProperty [ | merged | @@ -266,67 +295,69 @@ SpFontStyle >> mergeWith: otherProperty [ ^ merged ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> name [ ^ self nameVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> name: aString [ name := aString asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpFontStyle >> nameVariable [ ^ self toVariable: name ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> obtainPredefinedFont [ ^ StandardFonts perform: (self predefinedFont value, 'Font') asSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> predefinedFont [ ^ predefinedFont ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> predefinedFont: aSymbol [ predefinedFont := aSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> scaledSize [ - ^ self sizeVariable scaledValue + ^ self applyDisplayScaleFactor + ifTrue: [ self sizeVariable scaledValue ] + ifFalse: [ self sizeVariable nonscaledValue ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> size [ ^ self sizeVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFontStyle >> size: aNumber [ size := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpFontStyle >> sizeVariable [ ^ size ] -{ #category : #private } +{ #category : 'private' } SpFontStyle >> withCachedFontDo: aBlock [ self class fontCache diff --git a/src/Spec2-Adapters-Morphic/SpGeometryStyle.class.st b/src/Spec2-Adapters-Morphic/SpGeometryStyle.class.st index cedbdb4aa..81a632058 100644 --- a/src/Spec2-Adapters-Morphic/SpGeometryStyle.class.st +++ b/src/Spec2-Adapters-Morphic/SpGeometryStyle.class.st @@ -29,8 +29,8 @@ Geometry { ``` " Class { - #name : #SpGeometryStyle, - #superclass : #SpPropertyStyle, + #name : 'SpGeometryStyle', + #superclass : 'SpPropertyStyle', #instVars : [ 'width', 'height', @@ -39,16 +39,18 @@ Class { 'hResizing', 'vResizing' ], - #category : #'Spec2-Adapters-Morphic-StyleSheet' + #category : 'Spec2-Adapters-Morphic-StyleSheet', + #package : 'Spec2-Adapters-Morphic', + #tag : 'StyleSheet' } -{ #category : #'ston-core' } +{ #category : 'ston-core' } SpGeometryStyle class >> stonName [ - ^ 'Geometry' + ^ #Geometry ] -{ #category : #operations } +{ #category : 'operations' } SpGeometryStyle >> applyTo: aMorph [ (self widthVariable preferredScaledValueWith: aMorph width) @@ -65,7 +67,7 @@ SpGeometryStyle >> applyTo: aMorph [ ifNotNil: [ :aVariable | aMorph vResizing: (self resizingStringFor: aVariable value) ] ] -{ #category : #private } +{ #category : 'private' } SpGeometryStyle >> geometryValueBetween: baseNumber and: otherNumber [ ^ baseNumber = 0 @@ -73,49 +75,49 @@ SpGeometryStyle >> geometryValueBetween: baseNumber and: otherNumber [ ifFalse: [ baseNumber ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> hResizing [ ^ self hResizingVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> hResizing: aBoolean [ hResizing := aBoolean asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> hResizingVariable [ ^ self toVariable: hResizing ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> height [ ^ self heightVariable scaledValue ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> height: aNumber [ height := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> heightVariable [ ^ self toVariable: (height ifNil: [ 0 ]) ] -{ #category : #testing } +{ #category : 'testing' } SpGeometryStyle >> isGeometry [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> minHeight [ ^ self minHeightVariable @@ -123,19 +125,19 @@ SpGeometryStyle >> minHeight [ ifNil: [ 0 ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> minHeight: aNumber [ minHeight := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> minHeightVariable [ ^ self toVariable: minHeight ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> minWidth [ ^ self minWidthVariable @@ -143,19 +145,19 @@ SpGeometryStyle >> minWidth [ ifNil: [ 0 ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> minWidth: aNumber [ minWidth := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> minWidthVariable [ ^ self toVariable: minWidth ] -{ #category : #private } +{ #category : 'private' } SpGeometryStyle >> resizingStringFor: expand [ ^ expand @@ -163,37 +165,37 @@ SpGeometryStyle >> resizingStringFor: expand [ ifFalse: [ #rigid ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> vResizing [ ^ self vResizingVariable value ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> vResizing: aBoolean [ vResizing := aBoolean asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> vResizingVariable [ ^ self toVariable: vResizing ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> width [ ^ self widthVariable scaledValue ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeometryStyle >> width: aNumber [ width := aNumber asStyleVariable ] -{ #category : #'accessing - variables' } +{ #category : 'accessing - variables' } SpGeometryStyle >> widthVariable [ ^ self toVariable: (width ifNil: [ 0 ]) diff --git a/src/Spec2-Adapters-Morphic/SpHeaderCellMorph.class.st b/src/Spec2-Adapters-Morphic/SpHeaderCellMorph.class.st index 436166422..8ca3ac3ad 100644 --- a/src/Spec2-Adapters-Morphic/SpHeaderCellMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpHeaderCellMorph.class.st @@ -5,18 +5,20 @@ I am used to allow a header to have some extra properties (sort, etc.). Instead using a FTHeaderColumnCellMorph I extent FTIndentedCellMorph becaue I need the text to be indented. " Class { - #name : #SpHeaderCellMorph, - #superclass : #FTIndentedCellMorph, - #category : #'Spec2-Adapters-Morphic-Table' + #name : 'SpHeaderCellMorph', + #superclass : 'FTIndentedCellMorph', + #category : 'Spec2-Adapters-Morphic-Table', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Table' } -{ #category : #accessing } +{ #category : 'accessing' } SpHeaderCellMorph class >> indent [ ^ 2 ] -{ #category : #initialization } +{ #category : 'initialization' } SpHeaderCellMorph >> initialize [ super initialize. @@ -24,7 +26,7 @@ SpHeaderCellMorph >> initialize [ self indentBy: self class indent ] -{ #category : #utilities } +{ #category : 'utilities' } SpHeaderCellMorph >> prepareAsSortableColumn: aColumn [ diff --git a/src/Spec2-Adapters-Morphic/SpHorizontalLayoutDirection.extension.st b/src/Spec2-Adapters-Morphic/SpHorizontalLayoutDirection.extension.st index 7cbeaf30b..af733aa89 100644 --- a/src/Spec2-Adapters-Morphic/SpHorizontalLayoutDirection.extension.st +++ b/src/Spec2-Adapters-Morphic/SpHorizontalLayoutDirection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #SpHorizontalLayoutDirection } +Extension { #name : 'SpHorizontalLayoutDirection' } -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpHorizontalLayoutDirection >> addPadding: aNumber toMorph: aMorph into: anAdapter [ ^ anAdapter @@ -8,25 +8,25 @@ SpHorizontalLayoutDirection >> addPadding: aNumber toMorph: aMorph into: anAdapt toMorph: aMorph ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpHorizontalLayoutDirection >> applyHomogeneousLayoutOn: aLayout to: aMorph in: aRect [ aLayout applyHorizontalHomogeneousLayout: aMorph in: aRect ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpHorizontalLayoutDirection >> newSplitter [ ^ SpPanedResizerMorph newHorizontal ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpHorizontalLayoutDirection >> recalculatePages: anAdaptor [ ^ anAdaptor recalculatePageWidths ] -{ #category : #'*Spec2-Adapters-Morphic' } +{ #category : '*Spec2-Adapters-Morphic' } SpHorizontalLayoutDirection >> setRigidityOfNonExpandedMorph: aMorph [ aMorph diff --git a/src/Spec2-Adapters-Morphic/SpIndeterminatedProgressBarMorph.class.st b/src/Spec2-Adapters-Morphic/SpIndeterminatedProgressBarMorph.class.st index a5560e7a1..b8140ef56 100644 --- a/src/Spec2-Adapters-Morphic/SpIndeterminatedProgressBarMorph.class.st +++ b/src/Spec2-Adapters-Morphic/SpIndeterminatedProgressBarMorph.class.st @@ -19,15 +19,17 @@ Internal Representation and Key Implementation Points. " Class { - #name : #SpIndeterminatedProgressBarMorph, - #superclass : #ProgressBarMorph, + #name : 'SpIndeterminatedProgressBarMorph', + #superclass : 'ProgressBarMorph', #instVars : [ 'oddPassage' ], - #category : #'Spec2-Adapters-Morphic-Support' + #category : 'Spec2-Adapters-Morphic-Support', + #package : 'Spec2-Adapters-Morphic', + #tag : 'Support' } -{ #category : #examples } +{ #category : 'examples' } SpIndeterminatedProgressBarMorph class >> example [