From 56c790fc59b3061d260ead2c1e8479ac4a683b09 Mon Sep 17 00:00:00 2001 From: Alain Plantec Date: Sun, 8 Sep 2024 14:11:38 +0200 Subject: [PATCH 1/9] Revert "failing toAlbum tests" This reverts commit c1e19daf0b6d5e6eb0ddeb7540657c450652cd74. --- .../ToAlbumSkinTest.class.st | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/Toplo-Widget-Album-Tests/ToAlbumSkinTest.class.st diff --git a/src/Toplo-Widget-Album-Tests/ToAlbumSkinTest.class.st b/src/Toplo-Widget-Album-Tests/ToAlbumSkinTest.class.st deleted file mode 100644 index a9138f13..00000000 --- a/src/Toplo-Widget-Album-Tests/ToAlbumSkinTest.class.st +++ /dev/null @@ -1,49 +0,0 @@ -" -A ToAlbumTest is a test class for testing the behavior of ToAlbum -" -Class { - #name : #ToAlbumSkinTest, - #superclass : #ToParameterizedHostTest, - #category : #'Toplo-Widget-Album-Tests-TextPane' -} - -{ #category : #tests } -ToAlbumSkinTest >> testFocusedSkinEvent [ - - | a focusCount | - a := ToAlbum new size: 100 asPoint. - space root addChild: a. - self deny: a hasFocus. - focusCount := 0. - a - addEventHandlerOn: ToFocusedSkinEvent - do: [ :event | focusCount := focusCount + 1 ]. - a requestFocus. - self waitTestingSpaces. - space applyAllSkinPhases. - self assert: focusCount equals: 1 -] - -{ #category : #tests } -ToAlbumSkinTest >> testUnfocusedSkinEvent [ - - | a1 a2 unfocusCount | - a1 := ToAlbum new size: 100 asPoint. - a2 := ToAlbum new size: 100 asPoint. - space root addChild: a1. - space root addChild: a2. - self deny: a1 hasFocus. - self deny: a2 hasFocus. - unfocusCount := 0. - a2 - addEventHandlerOn: ToUnfocusedSkinEvent - do: [ :event | unfocusCount := unfocusCount + 1 ]. - a2 requestFocus. - self waitTestingSpaces. - space applyAllSkinPhases. - a1 requestFocus. - self waitTestingSpaces. - space applyAllSkinPhases. - self assert: unfocusCount equals: 1 - -] From 54118da3a1f20e68ea24e4ff246415da9353fc4a Mon Sep 17 00:00:00 2001 From: Alain Plantec Date: Sun, 8 Sep 2024 14:11:44 +0200 Subject: [PATCH 2/9] Revert "Merge pull request #197 from pharo-graphics/dev" This reverts commit 29dc78d79c0a9798de9bdab0b5c8e5adf8b1a833, reversing changes made to 0065c43866386f62615968d5e28a5770e11668a9. --- src/BaselineOfToplo/BaselineOfToplo.class.st | 4 + src/Toplo-Demo/ToploDemoPresenter.class.st | 2 +- ...art.class.st => ToBarNodeExample.class.st} | 27 +- ...ass.st => ToClassNameViewExample.class.st} | 19 +- ...ect.class.st => ToContactExample.class.st} | 19 +- src/Toplo-Examples/ToExperiments.class.st | 301 +++--- .../ToExperimentsMockTest.class.st | 44 - ...ct.class.st => ToIconDescExample.class.st} | 23 +- .../ToLabelInnerElementExample.class.st | 42 + ...ass.st => ToListClassNodeExample.class.st} | 13 +- ...abledSelectionElementExampleSkin.class.st} | 6 +- .../ToListElementStresser.class.st | 27 +- ...ntStresserWithAdditionalSelecters.class.st | 17 +- ...ectionHistoryEventHandlerExample.class.st} | 27 +- ...tableSelectionElementExampleSkin.class.st} | 8 +- src/Toplo-Examples/ToLoginPage.class.st | 19 +- src/Toplo-Examples/ToMiniBrowser.class.st | 4 +- .../ToMultiSelectElementCheckSkin.class.st | 47 + src/Toplo-Examples/ToPaneNodeExample.class.st | 11 + .../ToPaneNodeExamplePart.class.st | 16 - .../ToPaneNodeExampleSkin.class.st | 2 +- .../ToPicsumPhotosGalleryImageData.class.st | 5 +- .../ToPicsumPhotosGalleryImageHolder.class.st | 5 +- .../ToPicsumPhotosGalleryImageNode.class.st | 5 +- ...csumPhotosGallerySelectionElement.class.st | 14 - ...oPicsumPhotosGallerySelectionSkin.class.st | 5 +- src/Toplo-Examples/ToSandBox.class.st | 964 ++++++++++++------ src/Toplo-Examples/ToSandBoxMockTest.class.st | 73 -- .../ToTextFieldPopupExperiment.class.st | 2 +- .../ToTopLevelMockTest.class.st | 46 - .../ToWorkspaceExample.class.st | 9 +- .../TToElementWithLabeledIconTest.class.st | 564 ---------- .../ToElementWithLabeledIconForTest.class.st | 38 - src/Toplo-Tests/ToFocusStateTest.class.st | 12 +- src/Toplo-Tests/ToLabeledIconTest.class.st | 24 +- src/Toplo-Tests/ToSlotPropertyTest.class.st | 28 +- .../ToStyleSheetApplicationTest.class.st | 4 +- .../ToAlbumSkinTest.class.st | 49 + .../ToAlbumEventHandler.class.st | 7 +- src/Toplo-Widget-Album/ToLabel.class.st | 6 + .../ToLabelEditorWindow.class.st | 2 +- src/Toplo-Widget-Album/ToLabelSkin.class.st | 1 - .../ToButtonTest.class.st | 12 +- .../ToCheckableGroupTest.class.st | 8 +- src/Toplo-Widget-Button/TToCheckable.trait.st | 179 +--- .../TToCheckableGroupHolder.trait.st | 100 ++ .../TToCheckableHolder.trait.st | 100 +- .../TToElementWithCheckable.trait.st | 98 -- src/Toplo-Widget-Button/ToButton.class.st | 54 +- src/Toplo-Widget-Button/ToButtonSkin.class.st | 39 +- .../ToCheckableData.class.st | 100 +- .../ToCheckableEventHandler.class.st | 2 +- .../ToCheckableGroup.class.st | 10 +- .../ToCheckableGroupStrictStrategy.class.st | 4 +- .../ToCheckboxSkin.class.st | 1 - .../ToClickableActionEventHandler.class.st | 1 + .../ToSwitchButton.class.st | 12 +- .../ToSwitchButtonSkin.class.st | 1 - .../ToToggleButtonSkin.class.st | 7 +- .../ToImageTest.class.st | 19 +- src/Toplo-Widget-Image/ToImage.class.st | 132 ++- .../ToListElementTest.class.st | 46 +- .../ToPrimarySelectionModelTest.class.st | 10 +- .../TToListElementEventHandler.trait.st | 2 +- .../ToAbstractListElement.class.st | 204 ++-- .../ToAbstractListNode.class.st | 7 - .../ToAbstractListSelectionMode.class.st | 99 +- ...rayBasedSubSelectionModelRegistry.class.st | 46 + src/Toplo-Widget-List/ToBarElement.class.st | 4 +- src/Toplo-Widget-List/ToBarNodeSkin.class.st | 4 +- .../ToBasicListElementSkin.class.st | 8 +- src/Toplo-Widget-List/ToCommandQueue.class.st | 27 + .../ToCompositeSelecter.class.st | 10 +- .../ToCompositeSelectionModel.class.st | 19 +- ...aryBasedSubSelectionModelRegistry.class.st | 46 + .../ToFrontSelectionModel.class.st | 14 +- .../ToIntervalCollection.class.st | 8 + ...ionalSelectionElementEventHandler.class.st | 2 +- .../ToListBasicSelectionElement.class.st | 5 +- ... ToListBasicSelectionElementSkin.class.st} | 14 +- ...tMenuSelectionElementEventHandler.class.st | 9 - .../ToListContextMenuSelectionMode.class.st | 32 +- .../ToListDisabledSelectionElement.class.st | 23 - ...abledSelectionElementEventHandler.class.st | 22 - .../ToListDisabledSelectionMode.class.st | 29 - ...stElementContextMenuWindowManager.class.st | 2 +- .../ToListElementEventHandler.class.st | 47 +- .../ToListElementSieve.class.st | 2 +- ...iddenSelectionElementEventHandler.class.st | 27 - .../ToListHiddenSelectionMode.class.st | 29 - .../ToListNodeHolder.class.st | 17 +- ...deMultiSelectionClickEventHandler.class.st | 18 +- .../ToListNodeSelectedEvent.class.st | 15 +- .../ToListNodeSelectionEventHandler.class.st | 6 +- ...eSingleSelectionClickEventHandler.class.st | 2 +- .../ToListPrimarySelectionDirtyEvent.class.st | 15 +- .../ToListPrimarySelectionElement.class.st | 11 - .../ToListPrimarySelectionMode.class.st | 43 +- .../ToListSecondarySelectionElement.class.st | 11 - ...ndarySelectionElementEventHandler.class.st | 9 - .../ToListSecondarySelectionMode.class.st | 36 +- src/Toplo-Widget-List/ToListSelecter.class.st | 20 +- .../ToListSelectionChangedEvent.class.st | 15 +- ...oListSelectionElementEventHandler.class.st | 37 +- ... => ToListSelectionElementOption.class.st} | 103 +- .../ToListSubSelectionMode.class.st | 14 +- ...oListUnselectableSelectionElement.class.st | 23 - .../ToListUnselectableSelectionMode.class.st | 29 - ...ionBasedSubSelectionModelRegistry.class.st | 44 + .../ToPrimarySelectionModel.class.st | 23 +- ...ueBasedCommandApplierEventHandler.class.st | 2 +- .../ToScrollableBarTrackElement.class.st | 4 +- .../ToSelectionGroupHolder.class.st | 18 +- .../ToSelectionModel.class.st | 21 +- src/Toplo-Widget-List/ToSubSelecter.class.st | 25 +- .../ToSubSelectionModelRegistry.class.st | 54 + .../ToCheckMenuItem.class.st | 30 +- .../ToCheckMenuItemSkin.class.st | 12 +- .../ToChoiceChangedEvent.class.st | 8 +- src/Toplo-Widget-Menu/ToChoiceItem.class.st | 17 +- src/Toplo-Widget-Menu/ToChoiceMenu.class.st | 22 +- .../ToChoiceMenuDataEventHandler.class.st | 8 +- .../ToChoiceMenuSkin.class.st | 14 +- .../ToChoiceSelectedIndexChangeEvent.class.st | 5 - src/Toplo-Widget-Menu/ToMenuItem.class.st | 40 +- src/Toplo-Widget-Menu/ToMenuItemSkin.class.st | 13 +- src/Toplo-Widget-Menu/ToMenuWindow.class.st | 2 +- .../ToSegmentedBarElement.class.st | 4 +- .../ToSegmentedBarElementSkin.class.st | 2 +- .../ToSegmentedElement.class.st | 6 +- .../ToSegmentedNodeManager.class.st | 6 +- .../ToSegmentedSelectionMode.class.st | 25 +- .../TToTagElement.trait.st | 4 - .../ToMultiSelectBarElement.class.st | 48 +- .../ToMultiSelectBarEventHandler.class.st | 3 +- .../ToMultiSelectBarNode.class.st | 87 +- .../ToMultiSelectBarNodeHolder.class.st | 9 + .../ToMultiSelectBarNodeManager.class.st | 22 +- .../ToMultiSelectElement.class.st | 38 +- .../ToMultiSelectListElement.class.st | 6 +- .../ToMultiSelectListWindowManager.class.st | 3 +- .../ToSelectElement.class.st | 61 +- .../ToSelectElementSkin.class.st | 2 +- ...oSelectGroupSelectionChangedEvent.class.st | 2 +- .../ToSelectListElement.class.st | 30 +- .../ToSelectListWindowManager.class.st | 3 +- .../ToSelectTextInputElement.class.st | 14 +- .../ToSingleSelectDataItemView.class.st | 1 - .../ToSingleSelectElement.class.st | 6 - .../ToSmartBarElement.class.st | 185 ++++ src/Toplo-Widget-TabPane/ToTab.class.st | 48 +- .../ToTabPaneHeader.class.st | 4 +- src/Toplo-Widget-Tag/TToTagElement.trait.st | 80 ++ .../ToCheckableTagSkin.class.st | 19 + src/Toplo-Widget-Tag/ToTagElement.class.st | 54 + src/Toplo-Widget-Tag/ToTagLabelSkin.class.st | 46 + .../ToTagRemoveButtonSkin.class.st} | 14 +- src/Toplo-Widget-Tag/ToTagSkin.class.st | 71 ++ src/Toplo-Widget-Tag/package.st | 1 + src/Toplo/BlElement.extension.st | 15 + src/Toplo/TToElementWithLabeledIcon.trait.st | 351 ------- .../TToElementWithTripletElement.trait.st | 173 ---- src/Toplo/TToLabeledIcon.trait.st | 115 +++ src/Toplo/TToOrientable.trait.st | 42 + src/Toplo/TToTripletElement.trait.st | 362 +++++++ src/Toplo/ToAnchoredWindow.class.st | 4 +- src/Toplo/ToDeselectedSkinEvent.class.st | 18 +- src/Toplo/ToFocusState.class.st | 2 +- src/Toplo/ToImportedIconProvider.class.st | 26 +- src/Toplo/ToInnerElementRemovedEvent.class.st | 5 + src/Toplo/ToLabeledIcon.class.st | 175 +--- src/Toplo/ToSelectedSkinEvent.class.st | 18 +- src/Toplo/ToSelectionState.class.st | 15 +- src/Toplo/ToSkinStateGenerator.class.st | 12 +- src/Toplo/ToTooltipWindow.class.st | 4 +- src/Toplo/ToTripletElement.class.st | 379 +------ .../ToTripletElementEventHandler.class.st | 12 + src/Toplo/ToTripletElementProperties.class.st | 266 +++++ src/Toplo/Toplo.class.st | 8 + 179 files changed, 3929 insertions(+), 3980 deletions(-) rename src/Toplo-Examples/{ToBarNodeExamplePart.class.st => ToBarNodeExample.class.st} (70%) rename src/Toplo-Examples/{ToClassNameViewExamplePart.class.st => ToClassNameViewExample.class.st} (69%) rename src/Toplo-Examples/{ToContactExampleObject.class.st => ToContactExample.class.st} (51%) delete mode 100644 src/Toplo-Examples/ToExperimentsMockTest.class.st rename src/Toplo-Examples/{ToIconDescExampleObject.class.st => ToIconDescExample.class.st} (53%) create mode 100644 src/Toplo-Examples/ToLabelInnerElementExample.class.st rename src/Toplo-Examples/{ToListClassNodeExamplePart.class.st => ToListClassNodeExample.class.st} (75%) rename src/{Toplo-Widget-List/ToListDisabledSelectionElementSkin.class.st => Toplo-Examples/ToListDisabledSelectionElementExampleSkin.class.st} (77%) rename src/Toplo-Examples/{ToListSelectionHistoryEventHandlerExamplePart.class.st => ToListSelectionHistoryEventHandlerExample.class.st} (62%) rename src/Toplo-Examples/{ToListUnselectableSelectionElementExempleSkin.class.st => ToListUnselectableSelectionElementExampleSkin.class.st} (84%) create mode 100644 src/Toplo-Examples/ToMultiSelectElementCheckSkin.class.st create mode 100644 src/Toplo-Examples/ToPaneNodeExample.class.st delete mode 100644 src/Toplo-Examples/ToPaneNodeExamplePart.class.st delete mode 100644 src/Toplo-Examples/ToPicsumPhotosGallerySelectionElement.class.st delete mode 100644 src/Toplo-Examples/ToSandBoxMockTest.class.st delete mode 100644 src/Toplo-Examples/ToTopLevelMockTest.class.st delete mode 100644 src/Toplo-Tests/TToElementWithLabeledIconTest.class.st delete mode 100644 src/Toplo-Tests/ToElementWithLabeledIconForTest.class.st create mode 100644 src/Toplo-Widget-Album-Tests/ToAlbumSkinTest.class.st create mode 100644 src/Toplo-Widget-Button/TToCheckableGroupHolder.trait.st delete mode 100644 src/Toplo-Widget-Button/TToElementWithCheckable.trait.st create mode 100644 src/Toplo-Widget-List/ToArrayBasedSubSelectionModelRegistry.class.st create mode 100644 src/Toplo-Widget-List/ToCommandQueue.class.st create mode 100644 src/Toplo-Widget-List/ToDictionaryBasedSubSelectionModelRegistry.class.st rename src/Toplo-Widget-List/{ToListUnselectableSelectionElementSkin.class.st => ToListBasicSelectionElementSkin.class.st} (55%) delete mode 100644 src/Toplo-Widget-List/ToListDisabledSelectionElement.class.st delete mode 100644 src/Toplo-Widget-List/ToListDisabledSelectionElementEventHandler.class.st delete mode 100644 src/Toplo-Widget-List/ToListDisabledSelectionMode.class.st delete mode 100644 src/Toplo-Widget-List/ToListHiddenSelectionElementEventHandler.class.st delete mode 100644 src/Toplo-Widget-List/ToListHiddenSelectionMode.class.st delete mode 100644 src/Toplo-Widget-List/ToListPrimarySelectionElement.class.st delete mode 100644 src/Toplo-Widget-List/ToListSecondarySelectionElement.class.st rename src/Toplo-Widget-List/{ToListSelectionOption.class.st => ToListSelectionElementOption.class.st} (58%) delete mode 100644 src/Toplo-Widget-List/ToListUnselectableSelectionElement.class.st delete mode 100644 src/Toplo-Widget-List/ToListUnselectableSelectionMode.class.st create mode 100644 src/Toplo-Widget-List/ToOrderedCollectionBasedSubSelectionModelRegistry.class.st create mode 100644 src/Toplo-Widget-List/ToSubSelectionModelRegistry.class.st delete mode 100644 src/Toplo-Widget-Menu/ToChoiceSelectedIndexChangeEvent.class.st delete mode 100644 src/Toplo-Widget-Select/TToTagElement.trait.st create mode 100644 src/Toplo-Widget-Select/ToSmartBarElement.class.st create mode 100644 src/Toplo-Widget-Tag/TToTagElement.trait.st create mode 100644 src/Toplo-Widget-Tag/ToCheckableTagSkin.class.st create mode 100644 src/Toplo-Widget-Tag/ToTagElement.class.st create mode 100644 src/Toplo-Widget-Tag/ToTagLabelSkin.class.st rename src/{Toplo-Widget-Select/ToSelectNodeInnerCloseButtonSkin.class.st => Toplo-Widget-Tag/ToTagRemoveButtonSkin.class.st} (62%) create mode 100644 src/Toplo-Widget-Tag/ToTagSkin.class.st create mode 100644 src/Toplo-Widget-Tag/package.st delete mode 100644 src/Toplo/TToElementWithLabeledIcon.trait.st delete mode 100644 src/Toplo/TToElementWithTripletElement.trait.st create mode 100644 src/Toplo/TToLabeledIcon.trait.st create mode 100644 src/Toplo/TToTripletElement.trait.st create mode 100644 src/Toplo/ToInnerElementRemovedEvent.class.st create mode 100644 src/Toplo/ToTripletElementProperties.class.st diff --git a/src/BaselineOfToplo/BaselineOfToplo.class.st b/src/BaselineOfToplo/BaselineOfToplo.class.st index a87466b5..18d98d16 100644 --- a/src/BaselineOfToplo/BaselineOfToplo.class.st +++ b/src/BaselineOfToplo/BaselineOfToplo.class.st @@ -144,6 +144,10 @@ BaselineOfToplo >> registerPackages: spec [ spec package: #'Toplo-Widget-Segmented' with: [ spec requires: #( #Toplo #'Toplo-Widget-Button' #'Toplo-Widget-List' ) ]. + + spec package: #'Toplo-Widget-Tag' with: [ + spec requires: + #( #Toplo #'Toplo-Widget-Button' ) ]. spec package: #'Toplo-Widget-TabPane-Tests' diff --git a/src/Toplo-Demo/ToploDemoPresenter.class.st b/src/Toplo-Demo/ToploDemoPresenter.class.st index af22476a..ef6b2a14 100644 --- a/src/Toplo-Demo/ToploDemoPresenter.class.st +++ b/src/Toplo-Demo/ToploDemoPresenter.class.st @@ -87,7 +87,7 @@ ToploDemoPresenter >> demo3 [ (radioButtonDarkTheme := ToRadioButton new) labelText: 'Dark theme'. (checkableGroup := ToCheckableGroup new) withStrictCheckingStrategy; - registerAll: { + addAll: { radioButtonLightTheme. radioButtonDarkTheme }; addEventHandler: (BlEventHandler diff --git a/src/Toplo-Examples/ToBarNodeExamplePart.class.st b/src/Toplo-Examples/ToBarNodeExample.class.st similarity index 70% rename from src/Toplo-Examples/ToBarNodeExamplePart.class.st rename to src/Toplo-Examples/ToBarNodeExample.class.st index 6c89f116..8ff2ca28 100644 --- a/src/Toplo-Examples/ToBarNodeExamplePart.class.st +++ b/src/Toplo-Examples/ToBarNodeExample.class.st @@ -1,27 +1,14 @@ -" -I'm part of a larger example. I'm not expected to be opened as a standalone. - -Check `ToSandBox >> example_bar` -" Class { - #name : #ToBarNodeExamplePart, + #name : #ToBarNodeExample, #superclass : #ToBarNode, #instVars : [ 'triplet' ], - #category : #'Toplo-Examples-Parts' + #category : #'Toplo-Examples' } -{ #category : #'instance creation' } -ToBarNodeExamplePart class >> open [ - -