From 69dab6657dcfdb60037558d363c152f98434e5b8 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 1 Aug 2024 15:37:40 +0200 Subject: [PATCH 1/8] update strings to inputModel + fix the copy/paste plugin --- .../PyramidBackgroundBlocPlugin.class.st | 118 +++++++++--------- ...amidBackgroundStopsModalPresenter.class.st | 4 +- .../PyramidBlocLayoutPlugin.class.st | 64 +++++----- src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 26 ++-- .../PyramidBlocTextPlugin.class.st | 16 +-- .../PyramidCopyPastePlugin.class.st | 65 ++++++---- .../PyramidCornerRadiiInputPresenter.class.st | 4 +- .../PyramidInsetsInputPresenter.class.st | 4 +- .../PyramidLibraryController.class.st | 2 +- .../PyramidNavigationDefaultColumns.class.st | 2 +- .../PyramidSwitchInputPresenter.class.st | 22 ++-- ...midMagicButtonsInputPresenterTest.class.st | 6 +- .../PyramidPropertiesManagerTest.class.st | 6 +- .../TPyramidInputPresenterTest.trait.st | 2 +- .../PyramidThemePropertyStrategy.class.st | 10 +- ...amidColorInputSingleLinePresenter.class.st | 16 ++- ...ngleLineWithPickupButtonPresenter.class.st | 4 +- .../PyramidDashArrayInputPresenter.class.st | 6 +- ...gs.class.st => PyramidInputModel.class.st} | 10 +- src/Pyramid/PyramidInputPresenter.class.st | 34 ++--- ...PyramidMagicButtonsInputPresenter.class.st | 8 +- src/Pyramid/PyramidModalInputModel.class.st | 27 ++++ src/Pyramid/PyramidModalInputStrings.class.st | 27 ---- .../PyramidNumberArrayInputPresenter.class.st | 6 +- .../PyramidNumberInputPresenter.class.st | 6 +- ...ass.st => PyramidPointInputModel.class.st} | 16 +-- .../PyramidPointInputPresenter.class.st | 16 +-- src/Pyramid/PyramidProperty.class.st | 40 +++--- ...ramidSinglePopingPresenterBuilder.class.st | 4 +- ...ss.st => PyramidSwitchInputModel.class.st} | 20 +-- .../PyramidTextInputPresenter.class.st | 6 +- 31 files changed, 305 insertions(+), 292 deletions(-) rename src/Pyramid/{PyramidInputStrings.class.st => PyramidInputModel.class.st} (53%) create mode 100644 src/Pyramid/PyramidModalInputModel.class.st delete mode 100644 src/Pyramid/PyramidModalInputStrings.class.st rename src/Pyramid/{PyramidPointInputStrings.class.st => PyramidPointInputModel.class.st} (50%) rename src/Pyramid/{PyramidSwitchInputStrings.class.st => PyramidSwitchInputModel.class.st} (52%) diff --git a/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st index efa43549..e2702d10 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st @@ -16,7 +16,7 @@ PyramidBackgroundBlocPlugin class >> backgroundImageSelector [ property := PyramidProperty new name: 'Background Image Selector'; command: PyramidBackgroundImageCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidBackgroundImageInputPresenter; yourself. ^ property @@ -29,9 +29,9 @@ PyramidBackgroundBlocPlugin class >> backgroundLinearEnd [ property := PyramidProperty new name: 'Background Linear End'; command: PyramidBackgroundPaintLinearEndCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the end of the linear gradient.'; labelX: 'x'; labelY: 'y'. @@ -45,10 +45,10 @@ PyramidBackgroundBlocPlugin class >> backgroundLinearGradientDirection [ property := PyramidProperty new name: 'Background Linear Direction'; command: PyramidBackgroundPaintLinearDirectionCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the direction of the linear gradient.'; labelX: 'Start'; labelY: 'End'. @@ -63,9 +63,9 @@ PyramidBackgroundBlocPlugin class >> backgroundLinearStart [ name: 'Background Linear Start'; command: PyramidBackgroundPaintLinearStartCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the start of the linear gradient.'; labelX: 'x'; labelY: 'y'. @@ -79,9 +79,9 @@ PyramidBackgroundBlocPlugin class >> backgroundOpacity [ property := PyramidProperty new name: 'Background Opacity'; command: PyramidBackgroundOpacityCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the opacity of the background.'. ^ property ] @@ -93,7 +93,7 @@ PyramidBackgroundBlocPlugin class >> backgroundPaintColor [ property := PyramidProperty new name: 'Background Paint Color'; command: PyramidBackgroundPaintColorCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidColorInputSingleLineWithPickupButtonPresenter; yourself. ^ property @@ -106,7 +106,7 @@ PyramidBackgroundBlocPlugin class >> backgroundPaintStops [ property := PyramidProperty new name: 'Background Paint Stops'; command: PyramidBackgroundPaintStopsCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidBackgroundStopsInputPresenter; yourself. ^ property @@ -119,10 +119,10 @@ PyramidBackgroundBlocPlugin class >> backgroundPaintType [ property := PyramidProperty new name: 'Background Paint Type'; command: PyramidBackgroundPaintCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #windowMaximize); helpSelected: 'The value is Solid.'; @@ -175,9 +175,9 @@ PyramidBackgroundBlocPlugin class >> backgroundRadialInnerCenter [ property := PyramidProperty new name: 'Background Radial Center In'; command: PyramidBackgroundPaintRadialInnerCenterCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the center of the inner radial gradient.'; labelX: 'x'; labelY: 'y'. @@ -192,9 +192,9 @@ PyramidBackgroundBlocPlugin class >> backgroundRadialInnerRadius [ name: 'Background Radial Radius In'; command: PyramidBackgroundPaintRadialInnerRadiusCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the center of the inner radius gradient.'. ^ property ] @@ -207,9 +207,9 @@ PyramidBackgroundBlocPlugin class >> backgroundRadialOuterCenter [ name: 'Background Radial Center Out'; command: PyramidBackgroundPaintRadialOuterCenterCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the center of the outer radial gradient.'; labelX: 'x'; labelY: 'y'. @@ -224,9 +224,9 @@ PyramidBackgroundBlocPlugin class >> backgroundRadialOuterRadius [ name: 'Background Radial Radius Out'; command: PyramidBackgroundPaintRadialOuterRadiusCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the center of the outer radius gradient.'. ^ property ] @@ -238,10 +238,10 @@ PyramidBackgroundBlocPlugin class >> backgroundType [ property := PyramidProperty new name: 'Background Type'; command: PyramidBackgroundTypeCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #uncheckedBox); helpSelected: 'The value is Transparent.'; @@ -278,9 +278,9 @@ PyramidBackgroundBlocPlugin class >> borderDashArray [ property := PyramidProperty new name: 'Border Dash Array'; command: PyramidBorderDashArrayCommand new; - pyramidInputPresenterClass: PyramidDashArrayInputPresenter; + inputPresenterClass: PyramidDashArrayInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the dash array.'. ^ property ] @@ -292,9 +292,9 @@ PyramidBackgroundBlocPlugin class >> borderDashOffset [ property := PyramidProperty new name: 'Border Dash Offset'; command: PyramidBorderDashOffsetCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the offset of the dash.'. ^ property ] @@ -306,10 +306,10 @@ PyramidBackgroundBlocPlugin class >> borderLineCap [ property := PyramidProperty new name: 'Border Line Cap'; command: PyramidBorderLineCapCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: ((Smalltalk ui icons iconNamed: #windowMenu) rotateBy: -45); helpSelected: 'The value is Butt.'; @@ -345,10 +345,10 @@ PyramidBackgroundBlocPlugin class >> borderLineJoin [ property := PyramidProperty new name: 'Border Line Join'; command: PyramidBorderLineJoinCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: ((Smalltalk ui icons iconNamed: #windowMenu) rotateBy: -45); helpSelected: 'The value is Bevel.'; @@ -384,9 +384,9 @@ PyramidBackgroundBlocPlugin class >> borderLinearEnd [ property := PyramidProperty new name: 'Border Linear End'; command: PyramidBorderPaintLinearDirectionEndCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the end of the linear gradient.'; labelX: 'x'; labelY: 'y'. @@ -401,9 +401,9 @@ PyramidBackgroundBlocPlugin class >> borderLinearGradientDirection [ name: 'Border Linear Direction'; command: PyramidBorderPaintLinearDirectionCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the direction of the linear gradient.'; labelX: 'Start'; labelY: 'End'. @@ -417,9 +417,9 @@ PyramidBackgroundBlocPlugin class >> borderLinearStart [ property := PyramidProperty new name: 'Border Linear Start'; command: PyramidBorderPaintLinearDirectionStartCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the start of the linear gradient.'; labelX: 'x'; labelY: 'y'. @@ -433,9 +433,9 @@ PyramidBackgroundBlocPlugin class >> borderMiterLimit [ property := PyramidProperty new name: 'Border Miter Limit'; command: PyramidBorderMiterLimitCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the miter limit of the border.'. ^ property ] @@ -447,9 +447,9 @@ PyramidBackgroundBlocPlugin class >> borderOpacity [ property := PyramidProperty new name: 'Border Opacity'; command: PyramidBorderOpacityCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the opacity of the border.'. ^ property ] @@ -461,7 +461,7 @@ PyramidBackgroundBlocPlugin class >> borderPaintColor [ property := PyramidProperty new name: 'Border Paint Color'; command: PyramidBorderPaintColorCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidColorInputSingleLineWithPickupButtonPresenter; yourself. ^ property @@ -474,7 +474,7 @@ PyramidBackgroundBlocPlugin class >> borderPaintStops [ property := PyramidProperty new name: 'Border Paint Stops'; command: PyramidBorderPaintStopsCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidBackgroundStopsInputPresenter; yourself. ^ property @@ -487,10 +487,10 @@ PyramidBackgroundBlocPlugin class >> borderPaintType [ property := PyramidProperty new name: 'Border Paint Type'; command: PyramidBorderPaintCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #windowMaximize); helpSelected: 'The value is Solid.'; @@ -547,9 +547,9 @@ PyramidBackgroundBlocPlugin class >> borderRadialInnerCenter [ name: 'Border Radial Center In'; command: PyramidBorderPaintRadialInnerCenterCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the center of the inner radial gradient.'; labelX: 'x'; labelY: 'y'. @@ -564,9 +564,9 @@ PyramidBackgroundBlocPlugin class >> borderRadialInnerRadius [ name: 'Border Radial Radius In'; command: PyramidBorderPaintRadialInnerRadiusCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the center of the inner radius gradient.'. ^ property ] @@ -579,9 +579,9 @@ PyramidBackgroundBlocPlugin class >> borderRadialOuterCenter [ name: 'Border Radial Center Out'; command: PyramidBorderPaintRadialOuterCenterCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the center of the outer radial gradient.'; labelX: 'x'; labelY: 'y'. @@ -596,9 +596,9 @@ PyramidBackgroundBlocPlugin class >> borderRadialOuterRadius [ name: 'Border Radial Radius Out'; command: PyramidBorderPaintRadialOuterRadiusCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the center of the outer radius gradient.'. ^ property ] @@ -610,10 +610,10 @@ PyramidBackgroundBlocPlugin class >> borderWidth [ property := PyramidProperty new name: 'Border Width'; command: PyramidBorderWidthCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the width of the border.'. ^ property ] @@ -625,9 +625,9 @@ PyramidBackgroundBlocPlugin class >> opacity [ property := PyramidProperty new name: 'Element Opacity'; command: PyramidOpacityCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the opacity of the element.'. ^ property ] @@ -639,10 +639,10 @@ PyramidBackgroundBlocPlugin class >> outskirts [ property := PyramidProperty new name: 'Element Outskirts'; command: PyramidOutskirtsCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #menuPin); helpSelected: 'The value is Inside.'; diff --git a/src/Pyramid-Bloc/PyramidBackgroundStopsModalPresenter.class.st b/src/Pyramid-Bloc/PyramidBackgroundStopsModalPresenter.class.st index 1590f050..70ef96be 100644 --- a/src/Pyramid-Bloc/PyramidBackgroundStopsModalPresenter.class.st +++ b/src/Pyramid-Bloc/PyramidBackgroundStopsModalPresenter.class.st @@ -93,8 +93,8 @@ PyramidBackgroundStopsModalPresenter >> initializePresenters [ yourself. colorInput := PyramidColorInputSingleLineWithPickupButtonPresenter new. - positionInput := PyramidNumberInputPresenter new strings: - (PyramidInputStrings new help: + positionInput := PyramidNumberInputPresenter new inputModel: + (PyramidInputModel new help: 'Set the position of the color in the gradiant (generally between 0 and 1).'). tableStops := SpTablePresenter new whenSelectedItemChangedDo: [ :stop | diff --git a/src/Pyramid-Bloc/PyramidBlocLayoutPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocLayoutPlugin.class.st index 0def65d9..3495bd3f 100644 --- a/src/Pyramid-Bloc/PyramidBlocLayoutPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocLayoutPlugin.class.st @@ -17,7 +17,7 @@ PyramidBlocLayoutPlugin class >> constraintsBasicH [ name: 'Constraints - horizontal'; command: PyramidBasicHorizontalConstraintsBlocCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidBasicConstraintsInputPresenter; yourself. ^ property @@ -31,9 +31,9 @@ PyramidBlocLayoutPlugin class >> constraintsBasicHExact [ name: 'Constraints - width'; command: PyramidBasicExactHorizontalConstraintsBlocCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the width of the object'. ^ property ] @@ -46,7 +46,7 @@ PyramidBlocLayoutPlugin class >> constraintsBasicV [ name: 'Constraints - vertical'; command: PyramidBasicVerticalConstraintsBlocCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidBasicConstraintsInputPresenter; yourself. ^ property @@ -60,9 +60,9 @@ PyramidBlocLayoutPlugin class >> constraintsBasicVExact [ name: 'Constraints - height'; command: PyramidBasicExactVerticalConstraintsBlocCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the height of the object'. ^ property ] @@ -74,7 +74,7 @@ PyramidBlocLayoutPlugin class >> constraintsFrameH [ property := PyramidProperty new name: 'Constraints - Frame - horizontal'; command: PyramidFrameHorizontalConstraintsCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidHorizontalFrameConstraintsInputPresenter; yourself. ^ property @@ -87,7 +87,7 @@ PyramidBlocLayoutPlugin class >> constraintsFrameV [ property := PyramidProperty new name: 'Constraints - Frame - vertical'; command: PyramidFrameVerticalConstraintsCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidVerticalFrameConstraintsInputPresenter; yourself. ^ property @@ -101,9 +101,9 @@ PyramidBlocLayoutPlugin class >> constraintsPropH [ name: 'Constraints - horizontal'; command: PyramidProportionnalHorizontalConstraintsCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the proportion of the horizontal component.'; labelX: 'Left'; labelY: 'Right'. @@ -118,9 +118,9 @@ PyramidBlocLayoutPlugin class >> constraintsPropV [ name: 'Constraints - vertical'; command: PyramidProportionnalVerticalConstraintsCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel help: 'Define the proportion of the vertical component.'; labelX: 'Top'; labelY: 'Bottom'. @@ -134,9 +134,9 @@ PyramidBlocLayoutPlugin class >> constraintsWeight [ property := PyramidProperty new name: 'Constraints - weight'; command: PyramidWeightConstraintsCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Define the weight of the element to compute its size. The constraints must be "matchParent" to have an effect.'. ^ property ] @@ -149,14 +149,14 @@ PyramidBlocLayoutPlugin class >> flowLayoutOrientation [ name: 'Flow - Orientation'; command: PyramidLayoutChangeOrientationForFlowCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidFlowLayoutOrientationPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the orientation of the flow layout.'. - property pyramidInputPresenterStrings onLabel: 'Vertical'. - property pyramidInputPresenterStrings offLabel: 'Horizontal'. - property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'. + property inputPresenterModel onLabel: 'Vertical'. + property inputPresenterModel offLabel: 'Horizontal'. + property inputPresenterModel uncertainLabel: 'Uncertain'. ^ property ] @@ -167,10 +167,10 @@ PyramidBlocLayoutPlugin class >> layout [ property := PyramidProperty new name: 'Layout Type'; command: PyramidLayoutBlocCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. - property pyramidInputPresenterStrings + property inputPresenterModel addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #radioButtonUnselected); helpSelected: 'The element have no layout.'; @@ -222,14 +222,14 @@ PyramidBlocLayoutPlugin class >> linearLayoutOrientation [ name: 'Linear - Orientation'; command: PyramidLayoutChangeOrientationForLinearCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidLinearLayoutOrientationPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the orientation of the linear layout.'. - property pyramidInputPresenterStrings onLabel: 'Vertical'. - property pyramidInputPresenterStrings offLabel: 'Horizontal'. - property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'. + property inputPresenterModel onLabel: 'Vertical'. + property inputPresenterModel offLabel: 'Horizontal'. + property inputPresenterModel uncertainLabel: 'Uncertain'. ^ property ] @@ -240,9 +240,9 @@ PyramidBlocLayoutPlugin class >> margin [ property := PyramidProperty new name: 'Margin'; command: PyramidMarginCommand new; - pyramidInputPresenterClass: PyramidInsetsInputPresenter; + inputPresenterClass: PyramidInsetsInputPresenter; yourself. - property pyramidInputPresenterStrings help: 'Change the margin. The margin will affect the space between the border and the elements outside. For example: + property inputPresenterModel help: 'Change the margin. The margin will affect the space between the border and the elements outside. For example: - "10" to set a margin of 10 px on each size. - "10 20" to set a margin of 10 px on the top and bottom and 20 px on the right and left. - "10 20 30 40" to set a margin of 10 px on top, 20 px on left, 30 px on bottom and 40 px on right.'.. @@ -256,9 +256,9 @@ PyramidBlocLayoutPlugin class >> padding [ property := PyramidProperty new name: 'Padding'; command: PyramidPaddingCommand new; - pyramidInputPresenterClass: PyramidInsetsInputPresenter; + inputPresenterClass: PyramidInsetsInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the padding. The padding will affect the space between the border and the elements inside. For example: - "10" to set a padding of 10 px on each size. - "10 20" to set a padding of 10 px on the top and bottom and 20 px on the right and left. @@ -273,9 +273,9 @@ PyramidBlocLayoutPlugin class >> position [ property := PyramidProperty new name: 'Position'; command: PyramidPositionCommand new; - pyramidInputPresenterClass: PyramidPointInputPresenter; + inputPresenterClass: PyramidPointInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Set the position x and y of the element inside his parent.'. ^ property ] diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 8d606241..0e8b6e10 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -18,13 +18,13 @@ PyramidBlocPlugin class >> clipChildren [ property := PyramidProperty new name: 'Clip Children'; command: PyramidClipChildrenCommand new; - pyramidInputPresenterClass: PyramidSwitchInputPresenter; + inputPresenterClass: PyramidSwitchInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'If clipChildren is true, the children will not display outside the geometry of the parent element. If clipChildren is false, the children will display outside the geometry of the parent element.'. - property pyramidInputPresenterStrings onLabel: 'True'. - property pyramidInputPresenterStrings offLabel: 'False'. - property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'. + property inputPresenterModel onLabel: 'True'. + property inputPresenterModel offLabel: 'False'. + property inputPresenterModel uncertainLabel: 'Uncertain'. ^ property ] @@ -35,10 +35,10 @@ PyramidBlocPlugin class >> cornerRadii [ property := PyramidProperty new name: 'Corner radius'; command: PyramidRoundedRectangleCornerRadiiCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidCornerRadiiInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the corner radius of the geometry. For example: - "10" to set a radius of 10 px on each corner. - "10 20" to set a radius of 10 px on the top-left and bottom-right corner and 20 px on the top-right and bottom-left corner. @@ -53,9 +53,9 @@ PyramidBlocPlugin class >> elementId [ property := PyramidProperty new name: 'Element ID'; command: PyramidElementIdCommand new; - pyramidInputPresenterClass: PyramidTextInputPresenter; + inputPresenterClass: PyramidTextInputPresenter; yourself. - property pyramidInputPresenterStrings help: 'Change the id.'. + property inputPresenterModel help: 'Change the id.'. ^ property ] @@ -66,7 +66,7 @@ PyramidBlocPlugin class >> geometry [ property := PyramidProperty new name: 'Geometry'; command: PyramidGeometryCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidGeometryInputPresenter; yourself. ^ property @@ -79,7 +79,7 @@ PyramidBlocPlugin class >> visibility [ property := PyramidProperty new name: 'Visibility'; command: PyramidVisibilityCommand new; - pyramidInputPresenterClass: PyramidVisibilityInputPresenter; + inputPresenterClass: PyramidVisibilityInputPresenter; yourself. ^ property ] @@ -91,9 +91,9 @@ PyramidBlocPlugin class >> zIndex [ property := PyramidProperty new name: 'Elevation'; command: PyramidZIndexCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the elevation (#zIndex:). Bloc will used the elevation to determine wich of two sibling must be draw on top. The higher zIndex will be drawn on top of the lesser one.'. ^ property ] diff --git a/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st index 28cb89ca..da2ed208 100644 --- a/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st @@ -13,9 +13,9 @@ PyramidBlocTextPlugin class >> changeText [ property := PyramidProperty new name: 'Text'; command: PyramidChangeTextCommand new; - pyramidInputPresenterClass: PyramidTextInputPresenter; + inputPresenterClass: PyramidTextInputPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the value of the text'. ^ property ] @@ -27,9 +27,9 @@ PyramidBlocTextPlugin class >> fontSize [ property := PyramidProperty new name: 'Font size'; command: PyramidFontSizeCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: 'Change the font size.'. + property inputPresenterModel help: 'Change the font size.'. ^ property ] @@ -40,9 +40,9 @@ PyramidBlocTextPlugin class >> fontWeight [ property := PyramidProperty new name: 'Font weight'; command: PyramidFontWeightCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. - property pyramidInputPresenterStrings help: 'Change the font weight.'. + property inputPresenterModel help: 'Change the font weight.'. ^ property ] @@ -53,10 +53,10 @@ PyramidBlocTextPlugin class >> textForeground [ property := PyramidProperty new name: 'Text foreground'; command: PyramidTextForegroundCommand new; - pyramidInputPresenterClass: + inputPresenterClass: PyramidColorInputSingleLineWithPickupButtonPresenter; yourself. - property pyramidInputPresenterStrings help: + property inputPresenterModel help: 'Change the color of the text'. ^ property ] diff --git a/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st b/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st index 4b69c85a..40d61f99 100644 --- a/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st @@ -4,7 +4,7 @@ Class { #traits : 'TPyramidPlugin', #classTraits : 'TPyramidPlugin classTrait', #instVars : [ - 'projectModel' + 'editor' ], #category : #'Pyramid-Bloc-plugin-copy-paste' } @@ -20,7 +20,7 @@ PyramidCopyPastePlugin >> addPanelsOn: aPyramidSimpleWindow [ { #category : #connecting } PyramidCopyPastePlugin >> connectOn: aPyramidEditor [ - self projectModel: aPyramidEditor projectModel + self editor: aPyramidEditor. ] { #category : #copying } @@ -45,7 +45,7 @@ PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [ item icon: (Smalltalk ui icons iconNamed: #smallPaste); name: 'Paste'; - action: [ self pasteAsStonInClipboardOnRoots ]; + action: [ self pasteFromClipboardOnFirstLevelElements ]; yourself ]; yourself ] order: 20. @@ -57,13 +57,13 @@ PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [ item icon: (Smalltalk ui icons iconNamed: #smallCopy); name: 'Copy'; - action: [ self copyAsStonInClipboard: { single } ]; + action: [ self copyAsStonInClipboard: single ]; yourself ]; addItem: [ :item | item icon: (Smalltalk ui icons iconNamed: #smallPaste); name: 'Paste'; - action: [ self pasteAsStonInClipboard: single ]; + action: [ self pasteFromClipboardOnSelection: single ]; yourself ]; yourself ] order: 20. @@ -87,40 +87,53 @@ PyramidCopyPastePlugin >> copyAsStonMenu: aBuilder [ order: 20 ] -{ #category : #copying } -PyramidCopyPastePlugin >> pasteAsStonInClipboard: aBlElement [ +{ #category : #accessing } +PyramidCopyPastePlugin >> editor [ - | copiedElement | - [ copiedElement := BlSerializer materialize: Clipboard clipboardText ] - on: BlocMaterializationError - do: [ - UIManager default inform: 'Cannot paste the clipboard.'. - ^ self ]. - aBlElement addChildren: copiedElement. - self projectModel informElementsChanged + ^ editor +] + +{ #category : #accessing } +PyramidCopyPastePlugin >> editor: anObject [ + + editor := anObject ] { #category : #copying } -PyramidCopyPastePlugin >> pasteAsStonInClipboardOnRoots [ +PyramidCopyPastePlugin >> pasteFromClipboard: aBlock [ | copiedElement | - [ copiedElement := BlSerializer materialize: Clipboard clipboardText ] + [ + copiedElement := BlSerializer materialize: Clipboard clipboardText. + copiedElement isCollection ifFalse: [ + copiedElement := { copiedElement } ] ] on: BlocMaterializationError do: [ - UIManager default inform: 'Cannot paste the clipboard.'. + UIManager default inform: 'Cannot materialize the clipboard.'. + ^ self ]. + + [TBlSerializer verifyCollection: copiedElement] on: BlocSerializationError do: [ UIManager default inform: 'No BlElements in the clipboard.'. ^ self ]. - self projectModel firstLevelElements addAll: copiedElement. - self projectModel informFirstLevelElementsChanged + + aBlock value: copiedElement ] -{ #category : #accessing } -PyramidCopyPastePlugin >> projectModel [ +{ #category : #copying } +PyramidCopyPastePlugin >> pasteFromClipboardOnFirstLevelElements [ - ^ projectModel + self pasteFromClipboard: [ :copiedElement | self editor commandExecutor + use: PyramidAddAllToCollectionCommand new + on: { self editor projectModel firstLevelElements } + with: copiedElement ] + ] -{ #category : #accessing } -PyramidCopyPastePlugin >> projectModel: anObject [ +{ #category : #copying } +PyramidCopyPastePlugin >> pasteFromClipboardOnSelection: aBlElement [ - projectModel := anObject + self pasteFromClipboard: [ :copiedElement | + self editor commandExecutor + use: PyramidAddChildrenCommand new + on: self editor projectModel selection + with: copiedElement ] ] diff --git a/src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st b/src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st index 336be849..0e2380b1 100644 --- a/src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st +++ b/src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st @@ -9,9 +9,9 @@ Class { } { #category : #'as yet unclassified' } -PyramidCornerRadiiInputPresenter >> applyStrings [ +PyramidCornerRadiiInputPresenter >> applyInputModel [ - self inputArray strings: self strings + self inputArray inputModel: self inputModel ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st b/src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st index 8f94d482..5a6c632f 100644 --- a/src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st +++ b/src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st @@ -9,9 +9,9 @@ Class { } { #category : #'as yet unclassified' } -PyramidInsetsInputPresenter >> applyStrings [ +PyramidInsetsInputPresenter >> applyInputModel [ - self inputArray strings: self strings. + self inputArray inputModel: self inputModel ] { #category : #layout } diff --git a/src/Pyramid-Bloc/PyramidLibraryController.class.st b/src/Pyramid-Bloc/PyramidLibraryController.class.st index c82099b4..067ab8e6 100644 --- a/src/Pyramid-Bloc/PyramidLibraryController.class.st +++ b/src/Pyramid-Bloc/PyramidLibraryController.class.st @@ -116,7 +116,7 @@ PyramidLibraryController >> openForRoot [ PyramidLibraryController >> openForSelection [ self addElementsBlock: [ :arrayOfElement | - self editor propertiesManager commandExecutor + self editor commandExecutor use: PyramidAddChildrenCommand new on: self editor projectModel selection with: arrayOfElement ]. diff --git a/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st b/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st index 664173d1..d9b4a106 100644 --- a/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st +++ b/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st @@ -84,7 +84,7 @@ PyramidNavigationDefaultColumns >> columnVisibility [ "self editor is present on the class that will recover the pragma . This class should be: PyramidNavigationTreePresenter." self editor ifNotNil: [ :e | - e propertiesManager commandExecutor + e commandExecutor use: PyramidVisibilityCommand new on: { aBlElement } with: aBlElement visibility nextVisibilityForTree ] ]; diff --git a/src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st b/src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st index f008e1a4..d0d9f35c 100644 --- a/src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st +++ b/src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st @@ -164,16 +164,16 @@ PyramidSwitchInputPresenter class >> formToggleUncertain [ ] { #category : #accessing } -PyramidSwitchInputPresenter class >> stringsClass [ +PyramidSwitchInputPresenter class >> inputModelClass [ - ^ PyramidSwitchInputStrings + ^ PyramidSwitchInputModel ] { #category : #'as yet unclassified' } -PyramidSwitchInputPresenter >> applyStrings [ +PyramidSwitchInputPresenter >> applyInputModel [ - self button help: self strings help. - self button label: self strings offLabel + self button help: self inputModel help. + self button label: self inputModel offLabel ] { #category : #accessing } @@ -240,14 +240,16 @@ PyramidSwitchInputPresenter >> value: aBoolean [ self state: aBoolean. self button action: [ self switchState ]. aBoolean - ifTrue: [ self button icon: self class formToggleOn. - self button label: self strings onLabel ] - ifFalse: [ self button icon: self class formToggleOff. - self button label: self strings offLabel ]. + ifTrue: [ + self button icon: self class formToggleOn. + self button label: self inputModel onLabel ] + ifFalse: [ + self button icon: self class formToggleOff. + self button label: self inputModel offLabel ]. ^ self ]. self state: PyramidUnknowState new. self button icon: self class formToggleUncertain. - self button label: self strings uncertainLabel. + self button label: self inputModel uncertainLabel. self button action: [ ] ] diff --git a/src/Pyramid-Tests/PyramidMagicButtonsInputPresenterTest.class.st b/src/Pyramid-Tests/PyramidMagicButtonsInputPresenterTest.class.st index 65ddba88..d66c1eeb 100644 --- a/src/Pyramid-Tests/PyramidMagicButtonsInputPresenterTest.class.st +++ b/src/Pyramid-Tests/PyramidMagicButtonsInputPresenterTest.class.st @@ -28,14 +28,14 @@ PyramidMagicButtonsInputPresenterTest >> expectedMixedValues [ PyramidMagicButtonsInputPresenterTest >> makeNewInput [ ^ PyramidMagicButtonsInputPresenter new - strings: (PyramidMagicButtonsModel new + inputModel: (PyramidMagicButtonsModel new addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #smallOk); helpSelected: 'The value is ok.'; helpNotSelected: 'Set the value to ok.'; label: 'ok'; inputValue: #ok; - inputValidation: [ :val | val = #ok ]; + inputValidation: [ :val | val = #ok ]; yourself); addButtonModel: (PyramidMagicButtonModel new icon: (Smalltalk ui icons iconNamed: #smallCancel); @@ -43,7 +43,7 @@ PyramidMagicButtonsInputPresenterTest >> makeNewInput [ helpNotSelected: 'Set the value to cancel.'; label: 'cancel'; inputValue: #cancel; - inputValidation: [ :val | val = #cancel ]; + inputValidation: [ :val | val = #cancel ]; yourself); yourself); yourself diff --git a/src/Pyramid-Tests/PyramidPropertiesManagerTest.class.st b/src/Pyramid-Tests/PyramidPropertiesManagerTest.class.st index baaae46c..3bf3f8c4 100644 --- a/src/Pyramid-Tests/PyramidPropertiesManagerTest.class.st +++ b/src/Pyramid-Tests/PyramidPropertiesManagerTest.class.st @@ -63,17 +63,17 @@ PyramidPropertiesManagerTest >> setUp [ prop1 := PyramidProperty new name: 'Porp1'; command: PyramidSimpleMockCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. prop2 := PyramidProperty new name: 'Porp2'; command: PyramidSimpleMockCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. prop3 := PyramidProperty new name: 'Porp3'; command: PyramidSimpleMockCommand new; - pyramidInputPresenterClass: PyramidNumberInputPresenter; + inputPresenterClass: PyramidNumberInputPresenter; yourself. presenterStrategy := PyramidFakePropertyForTestStrategy new. diff --git a/src/Pyramid-Tests/TPyramidInputPresenterTest.trait.st b/src/Pyramid-Tests/TPyramidInputPresenterTest.trait.st index 9373bc0b..5998b484 100644 --- a/src/Pyramid-Tests/TPyramidInputPresenterTest.trait.st +++ b/src/Pyramid-Tests/TPyramidInputPresenterTest.trait.st @@ -40,7 +40,7 @@ TPyramidInputPresenterTest >> makeNewInputWithModel [ | input | input := self makeNewInput. - input strings: input class stringsClass new. + input inputModel: input class inputModelClass new. ^ input ] diff --git a/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st b/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st index 59a0ac89..73f525f4 100644 --- a/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st +++ b/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st @@ -1,7 +1,7 @@ Class { #name : #PyramidThemePropertyStrategy, #superclass : #PyramidHideEmptyPropertyStrategy, - #category : 'Pyramid-Toplo-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } @@ -37,9 +37,9 @@ PyramidThemePropertyStrategy >> propertiesFor: aCollectionOfElements [ PyramidThemePropertyStrategy >> propertyForStamp: aStamp [ | property | - property := PyramidProperty new name: aStamp; command: (PyramidStampCommand new stamp: aStamp; yourself); pyramidInputPresenterClass: PyramidSwitchInputPresenter ; yourself. - property pyramidInputPresenterStrings onLabel: 'Has stamp'. - property pyramidInputPresenterStrings offLabel: 'Has not stamp'. - property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'. + property := PyramidProperty new name: aStamp; command: (PyramidStampCommand new stamp: aStamp; yourself); inputPresenterClass: PyramidSwitchInputPresenter ; yourself. + property inputPresenterModel onLabel: 'Has stamp'. + property inputPresenterModel offLabel: 'Has not stamp'. + property inputPresenterModel uncertainLabel: 'Uncertain'. ^ property ] diff --git a/src/Pyramid/PyramidColorInputSingleLinePresenter.class.st b/src/Pyramid/PyramidColorInputSingleLinePresenter.class.st index 7e360de6..d8a415cb 100644 --- a/src/Pyramid/PyramidColorInputSingleLinePresenter.class.st +++ b/src/Pyramid/PyramidColorInputSingleLinePresenter.class.st @@ -7,7 +7,7 @@ Class { 'previewPresenter', 'whenValueChangedDo' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #accessing } @@ -17,10 +17,10 @@ PyramidColorInputSingleLinePresenter >> alphaInput [ ] { #category : #'as yet unclassified' } -PyramidColorInputSingleLinePresenter >> applyStrings [ +PyramidColorInputSingleLinePresenter >> applyInputModel [ - self alphaInput strings: self strings. - self hexInput strings: self strings + self alphaInput inputModel: self inputModel. + self hexInput inputModel: self inputModel ] { #category : #'as yet unclassified' } @@ -64,11 +64,15 @@ PyramidColorInputSingleLinePresenter >> initializePresenter [ whenValueChangedDo := [ :c | ]. hexInput := PyramidTextInputPresenter new value: 'FF0000'; - strings: (PyramidInputStrings new help: 'Set the color value as an hex.'); + inputModel: + (PyramidInputModel new help: + 'Set the color value as an hex.'); yourself. alphaInput := PyramidNumberInputPresenter new value: 100; - strings: (PyramidInputStrings new help:'Set the alpha value as a %.'); + inputModel: + (PyramidInputModel new help: + 'Set the alpha value as a %.'); yourself. previewPresenter := SpMorphPresenter new morph: Morph new; diff --git a/src/Pyramid/PyramidColorInputSingleLineWithPickupButtonPresenter.class.st b/src/Pyramid/PyramidColorInputSingleLineWithPickupButtonPresenter.class.st index 1555fb4c..e21c1b4c 100644 --- a/src/Pyramid/PyramidColorInputSingleLineWithPickupButtonPresenter.class.st +++ b/src/Pyramid/PyramidColorInputSingleLineWithPickupButtonPresenter.class.st @@ -7,13 +7,13 @@ Class { 'multiLinesInput', 'whenValueChangedDo' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #'as yet unclassified' } PyramidColorInputSingleLineWithPickupButtonPresenter >> applytStrings [ - self singleLineInput strings: self strings. + self singleLineInput inputModel: self inputModel ] { #category : #accessing } diff --git a/src/Pyramid/PyramidDashArrayInputPresenter.class.st b/src/Pyramid/PyramidDashArrayInputPresenter.class.st index f6681a39..6f33726f 100644 --- a/src/Pyramid/PyramidDashArrayInputPresenter.class.st +++ b/src/Pyramid/PyramidDashArrayInputPresenter.class.st @@ -5,13 +5,13 @@ Class { 'submitBlock', 'inputArray' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #'as yet unclassified' } -PyramidDashArrayInputPresenter >> applyStrings [ +PyramidDashArrayInputPresenter >> applyInputModel [ - self inputArray help: self strings help + self inputArray help: self inputModel help ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid/PyramidInputStrings.class.st b/src/Pyramid/PyramidInputModel.class.st similarity index 53% rename from src/Pyramid/PyramidInputStrings.class.st rename to src/Pyramid/PyramidInputModel.class.st index 3c6c87c5..d84f9cf3 100644 --- a/src/Pyramid/PyramidInputStrings.class.st +++ b/src/Pyramid/PyramidInputModel.class.st @@ -1,26 +1,26 @@ Class { - #name : #PyramidInputStrings, + #name : #PyramidInputModel, #superclass : #Object, #instVars : [ 'help' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #accessing } -PyramidInputStrings >> help [ +PyramidInputModel >> help [ ^ help ] { #category : #accessing } -PyramidInputStrings >> help: anObject [ +PyramidInputModel >> help: anObject [ help := anObject ] { #category : #initialization } -PyramidInputStrings >> initialize [ +PyramidInputModel >> initialize [ help := '' ] diff --git a/src/Pyramid/PyramidInputPresenter.class.st b/src/Pyramid/PyramidInputPresenter.class.st index 07234de5..7d652b49 100644 --- a/src/Pyramid/PyramidInputPresenter.class.st +++ b/src/Pyramid/PyramidInputPresenter.class.st @@ -15,23 +15,23 @@ Class { #instVars : [ 'strings' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } -{ #category : #testing } -PyramidInputPresenter class >> isAbstract [ +{ #category : #accessing } +PyramidInputPresenter class >> inputModelClass [ - ^ self == PyramidInputPresenter + ^ PyramidInputModel ] -{ #category : #accessing } -PyramidInputPresenter class >> stringsClass [ +{ #category : #testing } +PyramidInputPresenter class >> isAbstract [ - ^ PyramidInputStrings + ^ self == PyramidInputPresenter ] { #category : #'as yet unclassified' } -PyramidInputPresenter >> applyStrings [ +PyramidInputPresenter >> applyInputModel [ ] @@ -42,23 +42,23 @@ PyramidInputPresenter >> emptyValue [ self value: PyramidEmptyValue new ] -{ #category : #'as yet unclassified' } -PyramidInputPresenter >> mixedValues [ - - self value: PyramidMixedValues new -] - { #category : #accessing } -PyramidInputPresenter >> strings [ +PyramidInputPresenter >> inputModel [ ^ strings ] { #category : #accessing } -PyramidInputPresenter >> strings: anObject [ +PyramidInputPresenter >> inputModel: anObject [ strings := anObject. - self applyStrings + self applyInputModel +] + +{ #category : #'as yet unclassified' } +PyramidInputPresenter >> mixedValues [ + + self value: PyramidMixedValues new ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st b/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st index 78aeeb53..db311cbd 100644 --- a/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st +++ b/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st @@ -13,19 +13,19 @@ Class { #classInstVars : [ 'whenValueChangedDo' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #deprecated } -PyramidMagicButtonsInputPresenter class >> stringsClass [ +PyramidMagicButtonsInputPresenter class >> inputModelClass [ ^ PyramidMagicButtonsModel ] { #category : #'as yet unclassified' } -PyramidMagicButtonsInputPresenter >> applyStrings [ +PyramidMagicButtonsInputPresenter >> applyInputModel [ - self strings buttonsModel do: [ :each | + self inputModel buttonsModel do: [ :each | self makeAssociatedButtonFor: each ]. self selectedIndex: 0. self setUnknowValue diff --git a/src/Pyramid/PyramidModalInputModel.class.st b/src/Pyramid/PyramidModalInputModel.class.st new file mode 100644 index 00000000..4a723ec2 --- /dev/null +++ b/src/Pyramid/PyramidModalInputModel.class.st @@ -0,0 +1,27 @@ +Class { + #name : #PyramidModalInputModel, + #superclass : #PyramidInputModel, + #instVars : [ + 'windowTitle' + ], + #category : #'Pyramid-specs-custom' +} + +{ #category : #initialization } +PyramidModalInputModel >> initialize [ + +super initialize. +windowTitle := '' +] + +{ #category : #accessing } +PyramidModalInputModel >> windowTitle [ + + ^ windowTitle +] + +{ #category : #accessing } +PyramidModalInputModel >> windowTitle: anObject [ + + windowTitle := anObject +] diff --git a/src/Pyramid/PyramidModalInputStrings.class.st b/src/Pyramid/PyramidModalInputStrings.class.st deleted file mode 100644 index 5dfc8a0a..00000000 --- a/src/Pyramid/PyramidModalInputStrings.class.st +++ /dev/null @@ -1,27 +0,0 @@ -Class { - #name : #PyramidModalInputStrings, - #superclass : #PyramidInputStrings, - #instVars : [ - 'windowTitle' - ], - #category : 'Pyramid-specs-custom' -} - -{ #category : #initialization } -PyramidModalInputStrings >> initialize [ - -super initialize. -windowTitle := '' -] - -{ #category : #accessing } -PyramidModalInputStrings >> windowTitle [ - - ^ windowTitle -] - -{ #category : #accessing } -PyramidModalInputStrings >> windowTitle: anObject [ - - windowTitle := anObject -] diff --git a/src/Pyramid/PyramidNumberArrayInputPresenter.class.st b/src/Pyramid/PyramidNumberArrayInputPresenter.class.st index cae0b377..4b5b4618 100644 --- a/src/Pyramid/PyramidNumberArrayInputPresenter.class.st +++ b/src/Pyramid/PyramidNumberArrayInputPresenter.class.st @@ -5,13 +5,13 @@ Class { 'submitBlock', 'inputArray' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #'as yet unclassified' } -PyramidNumberArrayInputPresenter >> applyStrings [ +PyramidNumberArrayInputPresenter >> applyInputModel [ - self inputArray help: self strings help + self inputArray help: self inputModel help ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid/PyramidNumberInputPresenter.class.st b/src/Pyramid/PyramidNumberInputPresenter.class.st index a39df4d2..90c6be2e 100644 --- a/src/Pyramid/PyramidNumberInputPresenter.class.st +++ b/src/Pyramid/PyramidNumberInputPresenter.class.st @@ -8,13 +8,13 @@ Class { 'inputNumber', 'submitBlock' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #'as yet unclassified' } -PyramidNumberInputPresenter >> applyStrings [ +PyramidNumberInputPresenter >> applyInputModel [ - self inputNumber help: self strings help + self inputNumber help: self inputModel help ] { #category : #layout } diff --git a/src/Pyramid/PyramidPointInputStrings.class.st b/src/Pyramid/PyramidPointInputModel.class.st similarity index 50% rename from src/Pyramid/PyramidPointInputStrings.class.st rename to src/Pyramid/PyramidPointInputModel.class.st index 692431d8..38581c97 100644 --- a/src/Pyramid/PyramidPointInputStrings.class.st +++ b/src/Pyramid/PyramidPointInputModel.class.st @@ -1,15 +1,15 @@ Class { - #name : #PyramidPointInputStrings, - #superclass : #PyramidInputStrings, + #name : #PyramidPointInputModel, + #superclass : #PyramidInputModel, #instVars : [ 'labelX', 'labelY' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #initialization } -PyramidPointInputStrings >> initialize [ +PyramidPointInputModel >> initialize [ super initialize. labelX := 'x'. @@ -17,25 +17,25 @@ PyramidPointInputStrings >> initialize [ ] { #category : #accessing } -PyramidPointInputStrings >> labelX [ +PyramidPointInputModel >> labelX [ ^ labelX ] { #category : #accessing } -PyramidPointInputStrings >> labelX: anObject [ +PyramidPointInputModel >> labelX: anObject [ labelX := anObject ] { #category : #accessing } -PyramidPointInputStrings >> labelY [ +PyramidPointInputModel >> labelY [ ^ labelY ] { #category : #accessing } -PyramidPointInputStrings >> labelY: anObject [ +PyramidPointInputModel >> labelY: anObject [ labelY := anObject ] diff --git a/src/Pyramid/PyramidPointInputPresenter.class.st b/src/Pyramid/PyramidPointInputPresenter.class.st index 863b777a..679411d2 100644 --- a/src/Pyramid/PyramidPointInputPresenter.class.st +++ b/src/Pyramid/PyramidPointInputPresenter.class.st @@ -8,22 +8,22 @@ Class { 'labelX', 'labelY' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #accessing } -PyramidPointInputPresenter class >> stringsClass [ +PyramidPointInputPresenter class >> inputModelClass [ - ^ PyramidPointInputStrings + ^ PyramidPointInputModel ] { #category : #'as yet unclassified' } -PyramidPointInputPresenter >> applyStrings [ +PyramidPointInputPresenter >> applyInputModel [ - self inputX inputNumber help: self strings help. - self inputY inputNumber help: self strings help. - self labelX label: self strings labelX. - self labelY label: self strings labelY + self inputX inputNumber help: self inputModel help. + self inputY inputNumber help: self inputModel help. + self labelX label: self inputModel labelX. + self labelY label: self inputModel labelY ] { #category : #layout } diff --git a/src/Pyramid/PyramidProperty.class.st b/src/Pyramid/PyramidProperty.class.st index 907bba7c..3a46178b 100644 --- a/src/Pyramid/PyramidProperty.class.st +++ b/src/Pyramid/PyramidProperty.class.st @@ -4,10 +4,10 @@ Class { #instVars : [ 'command', 'commandExecutor', - 'pyramidInputPresenterClass', + 'inputPresenterClass', 'presenterBuilder', 'name', - 'pyramidInputPresenterStrings' + 'inputPresenterModel' ], #category : #'Pyramid-property' } @@ -52,50 +52,44 @@ PyramidProperty >> initialize [ ] { #category : #accessing } -PyramidProperty >> name [ - - ^ name -] - -{ #category : #accessing } -PyramidProperty >> name: anObject [ +PyramidProperty >> inputPresenterClass [ - name := anObject + ^ inputPresenterClass ] { #category : #accessing } -PyramidProperty >> presenterBuilder [ +PyramidProperty >> inputPresenterClass: anObject [ - ^ presenterBuilder + inputPresenterClass := anObject. + inputPresenterModel := anObject inputModelClass new ] { #category : #accessing } -PyramidProperty >> presenterBuilder: anObject [ +PyramidProperty >> inputPresenterModel [ - presenterBuilder := anObject + ^ inputPresenterModel ] { #category : #accessing } -PyramidProperty >> pyramidInputPresenterClass [ +PyramidProperty >> name [ - ^ pyramidInputPresenterClass + ^ name ] { #category : #accessing } -PyramidProperty >> pyramidInputPresenterClass: anObject [ +PyramidProperty >> name: anObject [ - pyramidInputPresenterClass := anObject. - self pyramidInputPresenterStrings: anObject stringsClass new + name := anObject ] { #category : #accessing } -PyramidProperty >> pyramidInputPresenterStrings [ +PyramidProperty >> presenterBuilder [ - ^ pyramidInputPresenterStrings + ^ presenterBuilder ] { #category : #accessing } -PyramidProperty >> pyramidInputPresenterStrings: anObject [ +PyramidProperty >> presenterBuilder: anObject [ - pyramidInputPresenterStrings := anObject + presenterBuilder := anObject ] diff --git a/src/Pyramid/PyramidSinglePopingPresenterBuilder.class.st b/src/Pyramid/PyramidSinglePopingPresenterBuilder.class.st index 17c8000e..17d6ce5a 100644 --- a/src/Pyramid/PyramidSinglePopingPresenterBuilder.class.st +++ b/src/Pyramid/PyramidSinglePopingPresenterBuilder.class.st @@ -165,8 +165,8 @@ PyramidSinglePopingPresenterBuilder >> layoutForLabel: aString input: anInput bu { #category : #'as yet unclassified' } PyramidSinglePopingPresenterBuilder >> makeNewInput [ - ^ self property pyramidInputPresenterClass new - strings: self property pyramidInputPresenterStrings; + ^ self property inputPresenterClass new + inputModel: self property inputPresenterModel; yourself ] diff --git a/src/Pyramid/PyramidSwitchInputStrings.class.st b/src/Pyramid/PyramidSwitchInputModel.class.st similarity index 52% rename from src/Pyramid/PyramidSwitchInputStrings.class.st rename to src/Pyramid/PyramidSwitchInputModel.class.st index f7c1c547..fb2b9546 100644 --- a/src/Pyramid/PyramidSwitchInputStrings.class.st +++ b/src/Pyramid/PyramidSwitchInputModel.class.st @@ -1,16 +1,16 @@ Class { - #name : #PyramidSwitchInputStrings, - #superclass : #PyramidInputStrings, + #name : #PyramidSwitchInputModel, + #superclass : #PyramidInputModel, #instVars : [ 'onLabel', 'offLabel', 'uncertainLabel' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #initialization } -PyramidSwitchInputStrings >> initialize [ +PyramidSwitchInputModel >> initialize [ super initialize. onLabel := ''. @@ -19,37 +19,37 @@ PyramidSwitchInputStrings >> initialize [ ] { #category : #accessing } -PyramidSwitchInputStrings >> offLabel [ +PyramidSwitchInputModel >> offLabel [ ^ offLabel ] { #category : #accessing } -PyramidSwitchInputStrings >> offLabel: anObject [ +PyramidSwitchInputModel >> offLabel: anObject [ offLabel := anObject ] { #category : #accessing } -PyramidSwitchInputStrings >> onLabel [ +PyramidSwitchInputModel >> onLabel [ ^ onLabel ] { #category : #accessing } -PyramidSwitchInputStrings >> onLabel: anObject [ +PyramidSwitchInputModel >> onLabel: anObject [ onLabel := anObject ] { #category : #accessing } -PyramidSwitchInputStrings >> uncertainLabel [ +PyramidSwitchInputModel >> uncertainLabel [ ^ uncertainLabel ] { #category : #accessing } -PyramidSwitchInputStrings >> uncertainLabel: anObject [ +PyramidSwitchInputModel >> uncertainLabel: anObject [ uncertainLabel := anObject ] diff --git a/src/Pyramid/PyramidTextInputPresenter.class.st b/src/Pyramid/PyramidTextInputPresenter.class.st index 81f20676..384cda61 100644 --- a/src/Pyramid/PyramidTextInputPresenter.class.st +++ b/src/Pyramid/PyramidTextInputPresenter.class.st @@ -8,13 +8,13 @@ Class { #instVars : [ 'textInput' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #'as yet unclassified' } -PyramidTextInputPresenter >> applyStrings [ +PyramidTextInputPresenter >> applyInputModel [ - self textInput help: self strings help + self textInput help: self inputModel help ] { #category : #layout } From 840f961ed7b0344c0dcdf459237dc691762f226a Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 1 Aug 2024 16:51:27 +0200 Subject: [PATCH 2/8] bug on addChild --- src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 46 ++++++++++++++++++- ...PyramidElementsManipulationHelper.class.st | 21 +++++++++ .../PyramidNavigationTreePresenter.class.st | 32 +++++++++++-- .../PyramidProjectModel.extension.st | 7 +++ ...midElementsManipulationHelperTest.class.st | 36 +++++++++++++++ src/Pyramid/PyramidProjectModel.class.st | 8 ++-- 6 files changed, 139 insertions(+), 11 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 0e8b6e10..51abeb67 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -84,6 +84,47 @@ PyramidBlocPlugin class >> visibility [ ^ property ] +{ #category : #accessing } +PyramidBlocPlugin class >> visibility2 [ + + | property | + property := PyramidProperty new + name: 'Visibility2'; + command: PyramidVisibilityCommand new; + inputPresenterClass: PyramidMagicButtonsInputPresenter; + yourself. + property inputPresenterModel + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #windowMaximize); + helpSelected: 'The object is visible.'; + helpNotSelected: 'Set the value to visible.'; + label: 'Visible'; + inputValue: [ BlVisibility visible ]; + inputValidation: [ :value | value isVisible ]; + yourself); + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #windowMaximize); + helpSelected: + 'The object is hidden. (Still computed for the layout)'; + helpNotSelected: + 'Set the value to hidden. (Still computed for the layout)'; + label: 'Hidden'; + inputValue: [ BlVisibility hidden ]; + inputValidation: [ :value | + value isHidden and: [ value isGone not ] ]; + yourself); + addButtonModel: (PyramidMagicButtonModel new + icon: (Smalltalk ui icons iconNamed: #windowMaximize); + helpSelected: 'The object is gone. (Not computed for the layout)'; + helpNotSelected: + 'Set the value to gone. (Not computed for the layout)'; + label: 'Gone'; + inputValue: [ BlVisibility gone ]; + inputValidation: [ :value | value isGone ]; + yourself). + ^ property +] + { #category : #accessing } PyramidBlocPlugin class >> zIndex [ @@ -192,13 +233,14 @@ PyramidBlocPlugin >> groupMenuBlockSingle [ PyramidBlocPlugin >> initialize [ super initialize. - + groupCommand := PyramidGroupCommand new. - + propertiesManager := PyramidPropertiesManagerForSelection new. propertiesManager addProperty: self class elementId. propertiesManager addProperty: self class visibility. + propertiesManager addProperty: self class visibility2. propertiesManager addProperty: self class zIndex. propertiesManager addProperty: self class clipChildren. propertiesManager addProperty: self class geometry. diff --git a/src/Pyramid-Bloc/PyramidElementsManipulationHelper.class.st b/src/Pyramid-Bloc/PyramidElementsManipulationHelper.class.st index 30c82f83..b1afef44 100644 --- a/src/Pyramid-Bloc/PyramidElementsManipulationHelper.class.st +++ b/src/Pyramid-Bloc/PyramidElementsManipulationHelper.class.st @@ -36,6 +36,17 @@ PyramidElementsManipulationHelper class >> accumulateParentsOf: aCollectionOfBlE self accumulateParentsOf: nextCollection in: result ] +{ #category : #'as yet unclassified' } +PyramidElementsManipulationHelper class >> countElementsIn: aCollection [ + + | result | + aCollection ifEmpty: [ ^ 0 ]. + result := aCollection size. + aCollection do: [ :each | + result := result + (self recursiveCountElementsIn: each) ]. + ^ result +] + { #category : #'as yet unclassified' } PyramidElementsManipulationHelper class >> flattenChildrenOfCollection: aCollection [ "Consider: @@ -79,3 +90,13 @@ PyramidElementsManipulationHelper class >> onlyParents: aCollectionOfBlElement [ self accumulateParentsOf: aCollectionOfBlElement in: result. ^ result asArray ] + +{ #category : #'as yet unclassified' } +PyramidElementsManipulationHelper class >> recursiveCountElementsIn: aBlElement [ + + | result | + aBlElement childrenCount = 0 ifTrue: [ ^ 0 ]. + result := aBlElement childrenCount. + aBlElement childrenDo: [ :each | result := result + (self recursiveCountElementsIn: each) ]. + ^ result +] diff --git a/src/Pyramid-Bloc/PyramidNavigationTreePresenter.class.st b/src/Pyramid-Bloc/PyramidNavigationTreePresenter.class.st index 5bab04d8..f37b41c2 100644 --- a/src/Pyramid-Bloc/PyramidNavigationTreePresenter.class.st +++ b/src/Pyramid-Bloc/PyramidNavigationTreePresenter.class.st @@ -5,7 +5,8 @@ Class { 'navigationModel', 'treeTable', 'editor', - 'shouldUpdateSelection' + 'shouldUpdateSelection', + 'previousNumberOfElement' ], #category : #'Pyramid-Bloc-plugin-navigation' } @@ -127,6 +128,18 @@ PyramidNavigationTreePresenter >> navigationModel: anObject [ self treeTable expandAll ] ] +{ #category : #accessing } +PyramidNavigationTreePresenter >> previousNumberOfElement [ + + ^ previousNumberOfElement +] + +{ #category : #accessing } +PyramidNavigationTreePresenter >> previousNumberOfElement: anObject [ + + previousNumberOfElement := anObject +] + { #category : #api } PyramidNavigationTreePresenter >> roots: aCollection [ @@ -154,14 +167,23 @@ PyramidNavigationTreePresenter >> treeTable [ { #category : #'as yet unclassified' } PyramidNavigationTreePresenter >> updateRoots [ - | currentTreeRoots roots parent shouldOrder | + | currentTreeRoots roots parent shouldOrder calculatedNumberOfElement | self shouldUpdateSelection: false. roots := self editor projectModel firstLevelElements asArray. currentTreeRoots := self treeTable roots. - - (roots size = currentTreeRoots size and: [ roots includesAll: currentTreeRoots ] )ifTrue: [ self shouldUpdateSelection: true. ^ self ]. - + + (roots size = currentTreeRoots size and: [ + (roots includesAll: currentTreeRoots) and: [ + calculatedNumberOfElement := self editor projectModel + numberOfElements. + calculatedNumberOfElement = self previousNumberOfElement ] ]) + ifTrue: [ + self shouldUpdateSelection: true. + ^ self ]. + + self previousNumberOfElement: calculatedNumberOfElement. + parent := nil. "If roots all have the same parent then it should be ordered by the parent children order." diff --git a/src/Pyramid-Bloc/PyramidProjectModel.extension.st b/src/Pyramid-Bloc/PyramidProjectModel.extension.st index b4728115..c337776f 100644 --- a/src/Pyramid-Bloc/PyramidProjectModel.extension.st +++ b/src/Pyramid-Bloc/PyramidProjectModel.extension.st @@ -6,3 +6,10 @@ PyramidProjectModel >> allElements [ ^ PyramidElementsManipulationHelper flattenChildrenOfCollection: self firstLevelElements ] + +{ #category : #'*Pyramid-Bloc' } +PyramidProjectModel >> numberOfElements [ + + ^ PyramidElementsManipulationHelper countElementsIn: + self firstLevelElements. +] diff --git a/src/Pyramid-Tests/PyramidElementsManipulationHelperTest.class.st b/src/Pyramid-Tests/PyramidElementsManipulationHelperTest.class.st index 691ca691..f5dd54cf 100644 --- a/src/Pyramid-Tests/PyramidElementsManipulationHelperTest.class.st +++ b/src/Pyramid-Tests/PyramidElementsManipulationHelperTest.class.st @@ -38,6 +38,42 @@ D1 -> D2 -> D3. ] +{ #category : #'as yet unclassified' } +PyramidElementsManipulationHelperTest >> makeNestedElement: aNumber [ + + | origin current | + origin := current := BlElement new. + 2 to: aNumber do: [ :i | + | temp | + temp := BlElement new. + current addChild: temp. + current := temp ]. + ^ origin +] + +{ #category : #tests } +PyramidElementsManipulationHelperTest >> testCountElement [ + "selection := {A1 . B1 . B2 . C1 . C3}. + PyramidElementsManipulationHelper onlyParents: selection + returns: { A1 . B1 . C1 }" + + self + assert: (PyramidElementsManipulationHelper countElementsIn: { }) + equals: 0. + self + assert: (PyramidElementsManipulationHelper countElementsIn: + { (self makeNestedElement: 1) }) + equals: 1. + self + assert: (PyramidElementsManipulationHelper countElementsIn: + { (self makeNestedElement: 10) }) + equals: 10. + self + assert: (PyramidElementsManipulationHelper countElementsIn: + { (self makeNestedElement: 10) . (self makeNestedElement: 10) . (self makeNestedElement: 10) }) + equals: 30 +] + { #category : #tests } PyramidElementsManipulationHelperTest >> testFlattenChildrenOfCollection [ diff --git a/src/Pyramid/PyramidProjectModel.class.st b/src/Pyramid/PyramidProjectModel.class.st index 1d53fa03..4cb9ccf6 100644 --- a/src/Pyramid/PyramidProjectModel.class.st +++ b/src/Pyramid/PyramidProjectModel.class.st @@ -42,10 +42,10 @@ PyramidProjectModel >> firstLevelElements [ { #category : #'as yet unclassified' } PyramidProjectModel >> informElementsChanged [ - self announce: (PyramidElementsChangedEvent new - firstLevelElements: self firstLevelElements; - selection: self selection; - yourself) + self announce: (PyramidElementsChangedEvent new + firstLevelElements: self firstLevelElements; + selection: self selection; + yourself) ] { #category : #'as yet unclassified' } From 62d49a4da6b803832f2af6443a778ae3ec44d003 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 1 Aug 2024 16:53:23 +0200 Subject: [PATCH 3/8] Fix bug of no id on add element --- src/Pyramid-Bloc/PyramidLibraryController.class.st | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Pyramid-Bloc/PyramidLibraryController.class.st b/src/Pyramid-Bloc/PyramidLibraryController.class.st index 067ab8e6..43c2a811 100644 --- a/src/Pyramid-Bloc/PyramidLibraryController.class.st +++ b/src/Pyramid-Bloc/PyramidLibraryController.class.st @@ -116,6 +116,7 @@ PyramidLibraryController >> openForRoot [ PyramidLibraryController >> openForSelection [ self addElementsBlock: [ :arrayOfElement | + self renameElements: arrayOfElement. self editor commandExecutor use: PyramidAddChildrenCommand new on: self editor projectModel selection From 4ba0e54728e780cc8f0f97b1e657bb1fc4f57aca Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 1 Aug 2024 18:29:35 +0200 Subject: [PATCH 4/8] Remove old visibility input in favor of magic button --- .../BlVisibilityGone.extension.st | 4 +- .../BlVisibilityHidden.extension.st | 4 +- .../BlVisibilityVisible.extension.st | 4 +- src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 265 ++++++++++++- .../PyramidNavigationDefaultColumns.class.st | 15 +- .../PyramidRemoveChildrenCommand.class.st | 2 +- .../PyramidVisibilityInputPresenter.class.st | 355 ------------------ .../PyramidVisualPystonForCly.class.st | 2 +- ...PyramidMagicButtonsInputPresenter.class.st | 12 +- src/Pyramid/PyramidMagicButtonsModel.class.st | 18 +- 10 files changed, 291 insertions(+), 390 deletions(-) delete mode 100644 src/Pyramid-Bloc/PyramidVisibilityInputPresenter.class.st diff --git a/src/Pyramid-Bloc/BlVisibilityGone.extension.st b/src/Pyramid-Bloc/BlVisibilityGone.extension.st index 11939ad9..29ae7c26 100644 --- a/src/Pyramid-Bloc/BlVisibilityGone.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityGone.extension.st @@ -3,7 +3,9 @@ Extension { #name : #BlVisibilityGone } { #category : #'*Pyramid-Bloc' } BlVisibilityGone >> asIcon [ - ^ self iconNamed: #haloDismiss + ^ PyramidBlocPlugin + iconOf: PyramidBlocPlugin blocVisibilityGone + maxHeight: 12 ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/BlVisibilityHidden.extension.st b/src/Pyramid-Bloc/BlVisibilityHidden.extension.st index 59dd82b2..7ae6f88a 100644 --- a/src/Pyramid-Bloc/BlVisibilityHidden.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityHidden.extension.st @@ -3,7 +3,9 @@ Extension { #name : #BlVisibilityHidden } { #category : #'*Pyramid-Bloc' } BlVisibilityHidden >> asIcon [ - ^ self iconNamed: #haloDrag + ^ PyramidBlocPlugin + iconOf: PyramidBlocPlugin blocVisibilityHidden + maxHeight: 12 ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/BlVisibilityVisible.extension.st b/src/Pyramid-Bloc/BlVisibilityVisible.extension.st index 65edf433..50314afd 100644 --- a/src/Pyramid-Bloc/BlVisibilityVisible.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityVisible.extension.st @@ -3,7 +3,9 @@ Extension { #name : #BlVisibilityVisible } { #category : #'*Pyramid-Bloc' } BlVisibilityVisible >> asIcon [ - ^ self iconNamed: #haloView + ^ PyramidBlocPlugin + iconOf: PyramidBlocPlugin blocVisibilityVisible + maxHeight: 12 ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 51abeb67..5b60db1a 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -11,6 +11,233 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } +{ #category : #'pyramid-serialized-bloc' } +PyramidBlocPlugin class >> blocVisibilityGone [ + "This class has been generated using Pyramid. + + By: YannLEGOFF + 2024-08-01 18:23:58" + + + ^ [ {(BlElement new + clipChildren: false; + constraintsDo: [:constraints | constraints horizontal fitContent. + constraints vertical fitContent. + constraints padding: (BlInsets top: 0.0 right: 35.0 bottom: 0.0 left: 0.0) ]; + layout: BlFrameLayout new; + addChildren: {(BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.823069403714565 g: 0.823069403714565 b: 0.823069403714565 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + dashArray: {6}; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints vertical exact: 40.0. + constraints frame horizontal alignCenter. + constraints frame vertical alignCenter ]; + id: #C; + yourself) . + (BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal fitContent. + constraints vertical fitContent. + constraints frame horizontal alignCenter. + constraints frame vertical alignCenter ]; + layout: BlLinearLayout horizontal; + addChildren: {(BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; + id: #B; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraints margin: (BlInsets top: 0.0 right: 0.0 bottom: 0.0 left: 10.0) ]; + id: #D; + yourself)}; + id: #A; + yourself)}; + id: #group; + yourself)} ] value +] + +{ #category : #'pyramid-serialized-bloc' } +PyramidBlocPlugin class >> blocVisibilityHidden [ + "This class has been generated using Pyramid. + + By: YannLEGOFF + 2024-08-01 18:17:49" + + + ^ [ | blinsets1 | +blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. +{(BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal fitContent. + constraints vertical fitContent ]; + layout: BlLinearLayout horizontal; + addChildren: {(BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraints margin: blinsets1 ]; + id: #B; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.823069403714565 g: 0.823069403714565 b: 0.823069403714565 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + dashArray: {6}; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraints margin: blinsets1 ]; + id: #C; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; + id: #D; + yourself)}; + id: #A; + yourself)} ] value +] + +{ #category : #'pyramid-serialized-bloc' } +PyramidBlocPlugin class >> blocVisibilityVisible [ + "This class has been generated using Pyramid. + + By: YannLEGOFF + 2024-08-01 18:18:10" + + + ^ [ | blinsets1 | +blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. +{(BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal fitContent. + constraints vertical fitContent ]; + layout: BlLinearLayout horizontal; + addChildren: {(BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraints margin: blinsets1 ]; + id: #B; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraints margin: blinsets1 ]; + id: #C; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + width: 3; + build); + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; + id: #D; + yourself)}; + id: #A; + yourself)} ] value +] + { #category : #accessing } PyramidBlocPlugin class >> clipChildren [ @@ -72,20 +299,22 @@ PyramidBlocPlugin class >> geometry [ ^ property ] -{ #category : #accessing } -PyramidBlocPlugin class >> visibility [ - - | property | - property := PyramidProperty new - name: 'Visibility'; - command: PyramidVisibilityCommand new; - inputPresenterClass: PyramidVisibilityInputPresenter; - yourself. - ^ property +{ #category : #'as yet unclassified' } +PyramidBlocPlugin class >> iconOf: aBlElement maxHeight: aNumber [ + + | form scale | + aBlElement isCollection ifTrue: [ + ^ self + iconOf: aBlElement first + maxHeight: aNumber ]. + form := aBlElement exportAsForm. + form height = 0 ifTrue: [ ^ form ]. + scale := aNumber / form height. + ^ form magnifyBy: scale ] { #category : #accessing } -PyramidBlocPlugin class >> visibility2 [ +PyramidBlocPlugin class >> visibility [ | property | property := PyramidProperty new @@ -94,32 +323,33 @@ PyramidBlocPlugin class >> visibility2 [ inputPresenterClass: PyramidMagicButtonsInputPresenter; yourself. property inputPresenterModel + buttonExtent: 64 @ 24; addButtonModel: (PyramidMagicButtonModel new - icon: (Smalltalk ui icons iconNamed: #windowMaximize); + icon: BlVisibility visible asIcon; helpSelected: 'The object is visible.'; helpNotSelected: 'Set the value to visible.'; label: 'Visible'; - inputValue: [ BlVisibility visible ]; + inputValue: BlVisibility visible; inputValidation: [ :value | value isVisible ]; yourself); addButtonModel: (PyramidMagicButtonModel new - icon: (Smalltalk ui icons iconNamed: #windowMaximize); + icon: BlVisibility hidden asIcon; helpSelected: 'The object is hidden. (Still computed for the layout)'; helpNotSelected: 'Set the value to hidden. (Still computed for the layout)'; label: 'Hidden'; - inputValue: [ BlVisibility hidden ]; + inputValue: BlVisibility hidden; inputValidation: [ :value | value isHidden and: [ value isGone not ] ]; yourself); addButtonModel: (PyramidMagicButtonModel new - icon: (Smalltalk ui icons iconNamed: #windowMaximize); + icon: BlVisibility gone asIcon; helpSelected: 'The object is gone. (Not computed for the layout)'; helpNotSelected: 'Set the value to gone. (Not computed for the layout)'; label: 'Gone'; - inputValue: [ BlVisibility gone ]; + inputValue: BlVisibility gone; inputValidation: [ :value | value isGone ]; yourself). ^ property @@ -240,7 +470,6 @@ PyramidBlocPlugin >> initialize [ propertiesManager addProperty: self class elementId. propertiesManager addProperty: self class visibility. - propertiesManager addProperty: self class visibility2. propertiesManager addProperty: self class zIndex. propertiesManager addProperty: self class clipChildren. propertiesManager addProperty: self class geometry. diff --git a/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st b/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st index d9b4a106..40eba641 100644 --- a/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st +++ b/src/Pyramid-Bloc/PyramidNavigationDefaultColumns.class.st @@ -67,13 +67,14 @@ PyramidNavigationDefaultColumns >> columnVisibility [ ^ SpCompositeTableColumn new title: 'Visibility'; - width: 80; - addColumn: (SpImageTableColumn evaluated: [ :aBlElement | - aBlElement - allParentsDetect: [ :parent | parent isVisible not ] - ifFound: [ :parent | - Smalltalk ui icons iconNamed: #uncommentedClass ] - ifNone: [ Smalltalk ui icons iconNamed: #blank16 ] ]); + width: 90; + addColumn: ((SpImageTableColumn evaluated: [ :aBlElement | + aBlElement + allParentsDetect: [ :parent | parent isVisible not ] + ifFound: [ :parent | + Smalltalk ui icons iconNamed: #uncommentedClass ] + ifNone: [ Smalltalk ui icons iconNamed: #blank16 ] ]) + width: 10); addColumn: (SpImageTableColumn evaluated: [ :aBlElement | aBlElement visibility asIcon ]); addColumn: (SpLinkTableColumn new diff --git a/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st b/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st index 95ed0fed..6d09bbb6 100644 --- a/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st +++ b/src/Pyramid-Bloc/PyramidRemoveChildrenCommand.class.st @@ -13,5 +13,5 @@ PyramidRemoveChildrenCommand >> commandInverse [ { #category : #'as yet unclassified' } PyramidRemoveChildrenCommand >> setValueFor: aBlElement with: aChildrenToAdd [ - aBlElement addChildren: aChildrenToAdd + aBlElement removeChildren: aChildrenToAdd ] diff --git a/src/Pyramid-Bloc/PyramidVisibilityInputPresenter.class.st b/src/Pyramid-Bloc/PyramidVisibilityInputPresenter.class.st deleted file mode 100644 index 14a2a46b..00000000 --- a/src/Pyramid-Bloc/PyramidVisibilityInputPresenter.class.st +++ /dev/null @@ -1,355 +0,0 @@ -Class { - #name : #PyramidVisibilityInputPresenter, - #superclass : #PyramidInputPresenter, - #instVars : [ - 'buttonVisible', - 'whenValueChangedDo', - 'value', - 'buttonNotVisible' - ], - #category : #'Pyramid-Bloc-plugin-bloc' -} - -{ #category : #'pyramid-serialized-bloc' } -PyramidVisibilityInputPresenter class >> blocGone [ - - ^ [ "BlStashSerializer" -{(BlElement new - id: #C; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 1.0 b: 0.3333333333333333 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 0 @ 3 ]; - yourself) . -(BlElement new - id: #E; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 0.3333333333333333 b: 1.0 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 11 @ 3 ]; - yourself)} - ] value -] - -{ #category : #'pyramid-serialized-bloc' } -PyramidVisibilityInputPresenter class >> blocHidden [ - - ^ [ "BlStashSerializer" -{(BlElement new - id: #C; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 1.0 b: 0.3333333333333333 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 0 @ 3 ]; - yourself) . -(BlElement new - id: #D; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 1.0 g: 0.3333333333333333 b: 0.3333333333333333 alpha: 0.2980392156862745); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 11 @ 3 ]; - yourself) . -(BlElement new - id: #E; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 0.3333333333333333 b: 1.0 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 22 @ 3 ]; - yourself)} - ] value -] - -{ #category : #'pyramid-serialized-bloc' } -PyramidVisibilityInputPresenter class >> blocVisibilityUnknow [ - - ^ [ "BlStashSerializer" -| blpaintbackground1 | -blpaintbackground1 := BlPaintBackground new. -{(BlElement new - id: #C; - background: (blpaintbackground1 - opacity: 1.0; - paint: (BlLinearGradientPaint new - stops: {(0 -> (Color r: 1.0 g: 0.8592375366568915 b: 0.2590420332355816 alpha: 1.0)) . - (1.0 -> (Color r: 1.0 g: 0.8592375366568915 b: 0.2590420332355816 alpha: 0.0))}; - start: 0 @ 0; - end: 8.0 @ 0; - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 0 @ 3 ]; - yourself) . -(BlElement new - id: #D; - background: blpaintbackground1; - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 11 @ 3 ]; - yourself) . -(BlElement new - id: #E; - background: blpaintbackground1; - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 22 @ 3 ]; - yourself)} - ] value -] - -{ #category : #'pyramid-serialized-bloc' } -PyramidVisibilityInputPresenter class >> blocVisible [ - - ^ [ "BlStashSerializer" -{(BlElement new - id: #C; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 1.0 b: 0.3333333333333333 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 0 @ 3 ]; - yourself) . -(BlElement new - id: #D; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 1.0 g: 0.3333333333333333 b: 0.3333333333333333 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 11 @ 3 ]; - yourself) . -(BlElement new - id: #E; - background: (BlPaintBackground new - opacity: 1.0; - paint: (BlColorPaint new - color: (Color r: 0.3333333333333333 g: 0.3333333333333333 b: 1.0 alpha: 1.0); - yourself); - yourself); - layout: BlBasicLayout uniqueInstance; - constraintsDo: [:constraints | constraints horizontal exact: 8.0. - constraints vertical exact: 8.0. - constraints position: 22 @ 3 ]; - yourself)} - ] value -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter class >> formGone [ - - ^ (BlElement new - size: 40 @ 16; - addChildren: self blocGone materializeAsBlElement) - exportAsForm -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter class >> formHidden [ - - ^ (BlElement new - size: 40 @ 16; - addChildren: self blocHidden materializeAsBlElement) - exportAsForm -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter class >> formVisibilityUnknow [ - - ^ (BlElement new - size: 40 @ 16; - addChildren: self blocVisibilityUnknow materializeAsBlElement) - exportAsForm -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter class >> formVisible [ - - ^ (BlElement new - size: 40 @ 16; - addChildren: self blocVisible materializeAsBlElement) exportAsForm -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> buttonNotVisible [ - - ^ buttonNotVisible -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> buttonVisible [ - - ^ buttonVisible -] - -{ #category : #layout } -PyramidVisibilityInputPresenter >> defaultLayout [ - - ^ SpBoxLayout newHorizontal - spacing: 4; - add: self buttonVisible expand: false; - add: self buttonNotVisible expand: true; - yourself -] - -{ #category : #initialization } -PyramidVisibilityInputPresenter >> initializePresenters [ - - whenValueChangedDo := [ :visibility | ]. - buttonVisible := SpButtonPresenter new - action: [ - self value switchVisibleOn: self. - self whenValueChangedDo value: self value ]; - enabled: false; - yourself. - buttonNotVisible := SpButtonPresenter new - label: 'No value'; - action: [ - self value switchNotVisibleOn: self. - self whenValueChangedDo value: self value ]; - enabled: false; - yourself -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> setVisibilityEmptyValue [ - - self buttonNotVisible - enabled: false; - label: 'No value'; - help: 'Nothing selected.'; - icon: self class formVisibilityUnknow. - self buttonVisible - enabled: false; - help: 'Nothing selected.'; - icon: self value asIcon -] - -{ #category : #initialization } -PyramidVisibilityInputPresenter >> setVisibilityGone [ - - self buttonNotVisible - enabled: true; - label: 'Gone'; - help: - 'The selection is "Gone". It will not display and will not affect the parent layout. Clic to set as "Hidden".'; - icon: self class formGone. - self buttonVisible - enabled: true; - help: - 'The selection is "Gone". It will not display and will not affect the parent layout. Clic to set as "Visible".'; - icon: self value asIcon -] - -{ #category : #initialization } -PyramidVisibilityInputPresenter >> setVisibilityHidden [ - - self buttonNotVisible - enabled: true; - label: 'Hidden'; - help: - 'The selection is "Hidden". It will not display and will affect the parent layout. Clic to set as "Gone".'; - icon: self class formHidden. - self buttonVisible - enabled: true; - help: - 'The selection is "Hidden". It will not display and will affect the parent layout. Clic to set as "Visible".'; - icon: self value asIcon -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> setVisibilityMixedValues [ - - self buttonNotVisible - enabled: false; - label: 'Mixed'; - help: - 'The visibility is unknow. Use the popup to edit the visibility'; - icon: self class formVisibilityUnknow. - self buttonVisible - enabled: false; - icon: self value asIcon -] - -{ #category : #initialization } -PyramidVisibilityInputPresenter >> setVisibilityVisible [ - - self buttonNotVisible - enabled: true; - label: 'Visible'; - help: - 'The selection is "Visible". It will display and will affect the parent layout. Clic on the left button to set as "Hidden".'; - icon: self class formVisible. - - self buttonVisible - enabled: true; - help: - 'The selection is "Visible". It will display and will affect the parent layout. Clic to set as "Hidden".'; - icon: self value asIcon -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter >> value [ - - ^ value -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenter >> value: aBlVisibility [ - - value := aBlVisibility. - aBlVisibility setVisibilityOn: self -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> whenValueChangedDo [ - - ^ whenValueChangedDo -] - -{ #category : #accessing } -PyramidVisibilityInputPresenter >> whenValueChangedDo: anObject [ - - whenValueChangedDo := anObject -] diff --git a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st index e8d9e815..9097fd6b 100644 --- a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st +++ b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st @@ -145,7 +145,7 @@ PyramidVisualPystonForCly >> buttonOpen [ PyramidVisualPystonForCly >> copyElement [ | element | - element := BlSerializer materialize: self getStonFromMethod. + element := self getStonFromMethod materializeAsBlElement. (Clipboard clipboardText: (BlSerializer serialize: element with: BlStashSerializer)) ] diff --git a/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st b/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st index db311cbd..2012c79a 100644 --- a/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st +++ b/src/Pyramid/PyramidMagicButtonsInputPresenter.class.st @@ -31,6 +31,12 @@ PyramidMagicButtonsInputPresenter >> applyInputModel [ self setUnknowValue ] +{ #category : #private } +PyramidMagicButtonsInputPresenter >> buttonExtent [ + + ^ self inputModel buttonExtent +] + { #category : #accessing } PyramidMagicButtonsInputPresenter >> buttonUnknow [ @@ -100,9 +106,9 @@ PyramidMagicButtonsInputPresenter >> layoutFor: aButtonsCollection withSelectedI buttonsLayout add: (aButtonsCollection at: i) withConstraints: [ :c | - c width: 24. - c height: 24 ] ] ]. - ^ buttonsLayout + c width: self buttonExtent x. + c height: self buttonExtent y ] ] ]. + ^ buttonsLayout ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid/PyramidMagicButtonsModel.class.st b/src/Pyramid/PyramidMagicButtonsModel.class.st index 212f63ff..6ae8dfc9 100644 --- a/src/Pyramid/PyramidMagicButtonsModel.class.st +++ b/src/Pyramid/PyramidMagicButtonsModel.class.st @@ -2,9 +2,10 @@ Class { #name : #PyramidMagicButtonsModel, #superclass : #Object, #instVars : [ - 'buttonsModel' + 'buttonsModel', + 'buttonExtent' ], - #category : 'Pyramid-specs-custom' + #category : #'Pyramid-specs-custom' } { #category : #adding } @@ -13,6 +14,18 @@ PyramidMagicButtonsModel >> addButtonModel: aPyramidMagicButonModel [ self buttonsModel add: aPyramidMagicButonModel ] +{ #category : #accessing } +PyramidMagicButtonsModel >> buttonExtent [ + + ^ buttonExtent +] + +{ #category : #accessing } +PyramidMagicButtonsModel >> buttonExtent: anObject [ + + buttonExtent := anObject +] + { #category : #'as yet unclassified' } PyramidMagicButtonsModel >> buttonsModel [ ^ buttonsModel @@ -21,5 +34,6 @@ PyramidMagicButtonsModel >> buttonsModel [ { #category : #initialization } PyramidMagicButtonsModel >> initialize [ + buttonExtent := 24 asPoint. buttonsModel := OrderedCollection new. ] From f8082c013e5258bc42d7217888a1e375ce3e77e0 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Fri, 2 Aug 2024 09:27:52 +0200 Subject: [PATCH 5/8] Sharper visual + fix tests --- src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 142 ++++++++---------- ...ramidVisibilityInputPresenterTest.class.st | 25 --- 2 files changed, 66 insertions(+), 101 deletions(-) delete mode 100644 src/Pyramid-Tests/PyramidVisibilityInputPresenterTest.class.st diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 5b60db1a..b5f74594 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -16,19 +16,20 @@ PyramidBlocPlugin class >> blocVisibilityGone [ "This class has been generated using Pyramid. By: YannLEGOFF - 2024-08-01 18:23:58" + 2024-08-02 09:26:40" - ^ [ {(BlElement new - clipChildren: false; - constraintsDo: [:constraints | constraints horizontal fitContent. - constraints vertical fitContent. - constraints padding: (BlInsets top: 0.0 right: 35.0 bottom: 0.0 left: 0.0) ]; - layout: BlFrameLayout new; + ^ [ | blinsets1 | +blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. +{(BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [:constraints | constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; + layout: BlLinearLayout horizontal; addChildren: {(BlElement new background: (BlPaintBackground new paint: (BlColorPaint new - color: (Color r: 0.823069403714565 g: 0.823069403714565 b: 0.823069403714565 alpha: 1.0); + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); yourself); opacity: 1.0; yourself); @@ -36,60 +37,50 @@ PyramidBlocPlugin class >> blocVisibilityGone [ paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; - dashArray: {6}; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints vertical exact: 40.0. - constraints frame horizontal alignCenter. - constraints frame vertical alignCenter ]; - id: #C; + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #B; yourself) . (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); + yourself); + build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal fitContent. - constraints vertical fitContent. - constraints frame horizontal alignCenter. - constraints frame vertical alignCenter ]; - layout: BlLinearLayout horizontal; - addChildren: {(BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #C; + yourself) . + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - width: 3; - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; - id: #B; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - width: 3; - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0. - constraints margin: (BlInsets top: 0.0 right: 0.0 bottom: 0.0 left: 10.0) ]; - id: #D; - yourself)}; - id: #A; + build); + geometry: BlRectangleGeometry new; + visibility: BlVisibility hidden; + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent ]; + id: #D; yourself)}; - id: #group; + id: #A; yourself)} ] value ] @@ -98,15 +89,15 @@ PyramidBlocPlugin class >> blocVisibilityHidden [ "This class has been generated using Pyramid. By: YannLEGOFF - 2024-08-01 18:17:49" + 2024-08-02 09:25:56" ^ [ | blinsets1 | -blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. +blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. {(BlElement new geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal fitContent. - constraints vertical fitContent ]; + constraintsDo: [:constraints | constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; layout: BlLinearLayout horizontal; addChildren: {(BlElement new background: (BlPaintBackground new @@ -119,17 +110,17 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. constraints margin: blinsets1 ]; id: #B; yourself) . (BlElement new background: (BlPaintBackground new paint: (BlColorPaint new - color: (Color r: 0.823069403714565 g: 0.823069403714565 b: 0.823069403714565 alpha: 1.0); + color: (Color r: 0.863147605083089 g: 0.863147605083089 b: 0.863147605083089 alpha: 1.0); yourself); opacity: 1.0; yourself); @@ -137,11 +128,10 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; - dashArray: {6}; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. constraints margin: blinsets1 ]; id: #C; yourself) . @@ -156,10 +146,10 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent ]; id: #D; yourself)}; id: #A; @@ -171,15 +161,15 @@ PyramidBlocPlugin class >> blocVisibilityVisible [ "This class has been generated using Pyramid. By: YannLEGOFF - 2024-08-01 18:18:10" + 2024-08-02 09:24:49" ^ [ | blinsets1 | -blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. +blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. {(BlElement new geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal fitContent. - constraints vertical fitContent ]; + constraintsDo: [:constraints | constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; layout: BlLinearLayout horizontal; addChildren: {(BlElement new background: (BlPaintBackground new @@ -192,10 +182,10 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. constraints margin: blinsets1 ]; id: #B; yourself) . @@ -210,10 +200,10 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0. + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent. constraints margin: blinsets1 ]; id: #C; yourself) . @@ -228,10 +218,10 @@ blinsets1 := BlInsets top: 0.0 right: 10.0 bottom: 0.0 left: 0.0. paint: (BlColorPaint new color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); yourself); - width: 3; build); geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 25.0 ]; + constraintsDo: [:constraints | constraints horizontal matchParent. + constraints vertical matchParent ]; id: #D; yourself)}; id: #A; diff --git a/src/Pyramid-Tests/PyramidVisibilityInputPresenterTest.class.st b/src/Pyramid-Tests/PyramidVisibilityInputPresenterTest.class.st deleted file mode 100644 index 332e72f0..00000000 --- a/src/Pyramid-Tests/PyramidVisibilityInputPresenterTest.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : #PyramidVisibilityInputPresenterTest, - #superclass : #TestCase, - #traits : 'TPyramidInputPresenterTest', - #classTraits : 'TPyramidInputPresenterTest classTrait', - #category : #'Pyramid-Tests-cases-specs-custom' -} - -{ #category : #accessing } -PyramidVisibilityInputPresenterTest >> dummyValues [ - - ^ { BlVisibility gone . BlVisibility hidden . BlVisibility visible } -] - -{ #category : #tests } -PyramidVisibilityInputPresenterTest >> makeNewInput [ - - ^ PyramidVisibilityInputPresenter new -] - -{ #category : #'as yet unclassified' } -PyramidVisibilityInputPresenterTest >> triggerValueChangedOf: anInput [ - - anInput buttonNotVisible click -] From 74da2f7319972ae261302e5c5c3a52ac69c30dd0 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Fri, 2 Aug 2024 09:33:19 +0200 Subject: [PATCH 6/8] better icon method --- src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index b5f74594..4a8c165a 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -289,6 +289,16 @@ PyramidBlocPlugin class >> geometry [ ^ property ] +{ #category : #'as yet unclassified' } +PyramidBlocPlugin class >> iconOf: anObject [ + + | target | + target := anObject isCollection ifTrue: [ + BlElement new constraintsDo: [ :c | c horizontal fitContent . c vertical fitContent ]; addChildren: anObject; yourself. + ] ifFalse: [anObject ]. + ^ target exportAsForm +] + { #category : #'as yet unclassified' } PyramidBlocPlugin class >> iconOf: aBlElement maxHeight: aNumber [ From dba6d1b6c9aa188aef0675f6d2827e3b8315b848 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Fri, 2 Aug 2024 12:20:08 +0200 Subject: [PATCH 7/8] Better inputs for visibility and geometry --- .../BlBezierCurveGeometry.extension.st | 27 ++ .../BlElementGeometry.extension.st | 41 +++ src/Pyramid-Bloc/BlLineGeometry.extension.st | 13 + .../BlPolygonGeometry.extension.st | 19 ++ .../BlPolylineGeometry.extension.st | 18 ++ .../BlRoundedRectangleGeometry.extension.st | 7 + src/Pyramid-Bloc/BlVisibility.extension.st | 22 +- .../BlVisibilityGone.extension.st | 111 +++++++- .../BlVisibilityHidden.extension.st | 110 +++++++- .../BlVisibilityVisible.extension.st | 110 +++++++- .../PyramidBlocGeometryPlugin.class.st | 75 ++++++ src/Pyramid-Bloc/PyramidBlocPlugin.class.st | 244 +----------------- 12 files changed, 534 insertions(+), 263 deletions(-) create mode 100644 src/Pyramid-Bloc/BlBezierCurveGeometry.extension.st create mode 100644 src/Pyramid-Bloc/BlElementGeometry.extension.st create mode 100644 src/Pyramid-Bloc/BlLineGeometry.extension.st create mode 100644 src/Pyramid-Bloc/BlPolygonGeometry.extension.st create mode 100644 src/Pyramid-Bloc/BlPolylineGeometry.extension.st create mode 100644 src/Pyramid-Bloc/BlRoundedRectangleGeometry.extension.st create mode 100644 src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st diff --git a/src/Pyramid-Bloc/BlBezierCurveGeometry.extension.st b/src/Pyramid-Bloc/BlBezierCurveGeometry.extension.st new file mode 100644 index 00000000..c2805142 --- /dev/null +++ b/src/Pyramid-Bloc/BlBezierCurveGeometry.extension.st @@ -0,0 +1,27 @@ +Extension { #name : #BlBezierCurveGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlBezierCurveGeometry class >> asIcon [ + + ^ super asIcon copy: (0 @ 12 extent: 16 @ 12) +] + +{ #category : #'*Pyramid-Bloc' } +BlBezierCurveGeometry class >> pyramidDefaultValue [ + + ^ self controlPoints: { + (0 @ 0). + (0 @ 75). + (50 @ -25). + (50 @ 50) } +] + +{ #category : #'*Pyramid-Bloc' } +BlBezierCurveGeometry class >> pyramidDefaultValueForIcon [ + + ^ self controlPoints: { + (0 @ 0). + (0 @ 24). + (16 @ -12). + (16 @ 12) } +] diff --git a/src/Pyramid-Bloc/BlElementGeometry.extension.st b/src/Pyramid-Bloc/BlElementGeometry.extension.st new file mode 100644 index 00000000..0fb38d9a --- /dev/null +++ b/src/Pyramid-Bloc/BlElementGeometry.extension.st @@ -0,0 +1,41 @@ +Extension { #name : #BlElementGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlElementGeometry class >> asIcon [ + + | element | + element := BlElement new + size: 16 @ 12; + background: (Color gray: 0.75); + border: (BlBorder paint: Color black width: 1); + geometry: self pyramidDefaultValueForIcon; + yourself. + ^ element exportAsForm +] + +{ #category : #'*Pyramid-Bloc' } +BlElementGeometry class >> asPyramidMagicButton [ + + ^ PyramidMagicButtonModel new + icon: self asIcon; + helpSelected: + ('The geometry is <1s>.' expandMacrosWith: self name); + helpNotSelected: + ('Set the geometry to <1s>.' expandMacrosWith: self name); + label: ''; + inputValue: self pyramidDefaultValue; + inputValidation: [ :value | value isKindOf: self ]; + yourself +] + +{ #category : #'*Pyramid-Bloc' } +BlElementGeometry class >> pyramidDefaultValue [ + + ^ self new +] + +{ #category : #'*Pyramid-Bloc' } +BlElementGeometry class >> pyramidDefaultValueForIcon [ + + ^ self pyramidDefaultValue +] diff --git a/src/Pyramid-Bloc/BlLineGeometry.extension.st b/src/Pyramid-Bloc/BlLineGeometry.extension.st new file mode 100644 index 00000000..9025ceb1 --- /dev/null +++ b/src/Pyramid-Bloc/BlLineGeometry.extension.st @@ -0,0 +1,13 @@ +Extension { #name : #BlLineGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlLineGeometry class >> pyramidDefaultValue [ + + ^ self from: 0 asPoint to: 50 asPoint +] + +{ #category : #'*Pyramid-Bloc' } +BlLineGeometry class >> pyramidDefaultValueForIcon [ + + ^ self from: 0 asPoint to: 12 asPoint +] diff --git a/src/Pyramid-Bloc/BlPolygonGeometry.extension.st b/src/Pyramid-Bloc/BlPolygonGeometry.extension.st new file mode 100644 index 00000000..a8b793c0 --- /dev/null +++ b/src/Pyramid-Bloc/BlPolygonGeometry.extension.st @@ -0,0 +1,19 @@ +Extension { #name : #BlPolygonGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlPolygonGeometry class >> pyramidDefaultValue [ + + ^ self vertices: { + (0 @ 50). + (0 @ 0). + (25 @ 25). + (50 @ 0). + (50 @ 50) } +] + +{ #category : #'*Pyramid-Bloc' } +BlPolygonGeometry class >> pyramidDefaultValueForIcon [ + + ^ self vertices: + (self pyramidDefaultValue vertices collect: [ :each | each / 4.2 ]) +] diff --git a/src/Pyramid-Bloc/BlPolylineGeometry.extension.st b/src/Pyramid-Bloc/BlPolylineGeometry.extension.st new file mode 100644 index 00000000..2e54f296 --- /dev/null +++ b/src/Pyramid-Bloc/BlPolylineGeometry.extension.st @@ -0,0 +1,18 @@ +Extension { #name : #BlPolylineGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlPolylineGeometry class >> pyramidDefaultValue [ + + ^ self vertices: { + (0 @ 50). + (0 @ 0). + (25 @ 25). + (50 @ 0). + (50 @ 50) } +] + +{ #category : #'*Pyramid-Bloc' } +BlPolylineGeometry class >> pyramidDefaultValueForIcon [ + + ^ self vertices: (self pyramidDefaultValue vertices collect: [ :each | each / 4.2 ]) +] diff --git a/src/Pyramid-Bloc/BlRoundedRectangleGeometry.extension.st b/src/Pyramid-Bloc/BlRoundedRectangleGeometry.extension.st new file mode 100644 index 00000000..0d460989 --- /dev/null +++ b/src/Pyramid-Bloc/BlRoundedRectangleGeometry.extension.st @@ -0,0 +1,7 @@ +Extension { #name : #BlRoundedRectangleGeometry } + +{ #category : #'*Pyramid-Bloc' } +BlRoundedRectangleGeometry class >> pyramidDefaultValue [ + + ^ self cornerRadius: 8 +] diff --git a/src/Pyramid-Bloc/BlVisibility.extension.st b/src/Pyramid-Bloc/BlVisibility.extension.st index ef2b9650..7739bc67 100644 --- a/src/Pyramid-Bloc/BlVisibility.extension.st +++ b/src/Pyramid-Bloc/BlVisibility.extension.st @@ -2,8 +2,20 @@ Extension { #name : #BlVisibility } { #category : #'*Pyramid-Bloc' } BlVisibility >> asIcon [ -"return a 16 by 16 `Form`" - ^ self shouldBeImplemented + + | bloc target | + bloc := self class blocIcon. + target := bloc isCollection + ifTrue: [ + BlElement new + layout: BlFrameLayout new; + constraintsDo: [ :c | + c horizontal fitContent. + c vertical fitContent ]; + addChildren: bloc; + yourself ] + ifFalse: [ bloc ]. + ^ target exportAsForm ] { #category : #'*Pyramid-Bloc' } @@ -13,6 +25,12 @@ BlVisibility >> asString [ ^ self shouldBeImplemented ] +{ #category : #'*Pyramid-Bloc' } +BlVisibility class >> blocIcon [ + + ^ self shouldBeImplemented +] + { #category : #'*Pyramid-Bloc' } BlVisibility >> nextVisibilityForTree [ "return the next visibility. diff --git a/src/Pyramid-Bloc/BlVisibilityGone.extension.st b/src/Pyramid-Bloc/BlVisibilityGone.extension.st index 29ae7c26..d9ca7127 100644 --- a/src/Pyramid-Bloc/BlVisibilityGone.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityGone.extension.st @@ -1,17 +1,116 @@ Extension { #name : #BlVisibilityGone } { #category : #'*Pyramid-Bloc' } -BlVisibilityGone >> asIcon [ +BlVisibilityGone >> asString [ - ^ PyramidBlocPlugin - iconOf: PyramidBlocPlugin blocVisibilityGone - maxHeight: 12 + ^ 'gone' ] { #category : #'*Pyramid-Bloc' } -BlVisibilityGone >> asString [ +BlVisibilityGone class >> blocIcon [ + "This class has been generated using Pyramid. - ^ 'gone' + By: YannLEGOFF + 2024-08-02 09:26:40" + + + ^ [ + | blinsets1 | + blinsets1 := BlInsets + top: 0.0 + right: 2.0 + bottom: 0.0 + left: 0.0. + { (BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; + layout: BlLinearLayout horizontal; + addChildren: { + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #B; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #C; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + visibility: BlVisibility hidden; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent ]; + id: #D; + yourself) }; + id: #A; + yourself) } ] value ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/BlVisibilityHidden.extension.st b/src/Pyramid-Bloc/BlVisibilityHidden.extension.st index 7ae6f88a..a8f7424f 100644 --- a/src/Pyramid-Bloc/BlVisibilityHidden.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityHidden.extension.st @@ -1,17 +1,115 @@ Extension { #name : #BlVisibilityHidden } { #category : #'*Pyramid-Bloc' } -BlVisibilityHidden >> asIcon [ +BlVisibilityHidden >> asString [ - ^ PyramidBlocPlugin - iconOf: PyramidBlocPlugin blocVisibilityHidden - maxHeight: 12 + ^ 'hidden' ] { #category : #'*Pyramid-Bloc' } -BlVisibilityHidden >> asString [ +BlVisibilityHidden class >> blocIcon [ + "This class has been generated using Pyramid. - ^ 'hidden' + By: YannLEGOFF + 2024-08-02 09:25:56" + + + ^ [ + | blinsets1 | + blinsets1 := BlInsets + top: 0.0 + right: 2.0 + bottom: 0.0 + left: 0.0. + { (BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; + layout: BlLinearLayout horizontal; + addChildren: { + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #B; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.863147605083089 + g: 0.863147605083089 + b: 0.863147605083089 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #C; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent ]; + id: #D; + yourself) }; + id: #A; + yourself) } ] value ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/BlVisibilityVisible.extension.st b/src/Pyramid-Bloc/BlVisibilityVisible.extension.st index 50314afd..cd340734 100644 --- a/src/Pyramid-Bloc/BlVisibilityVisible.extension.st +++ b/src/Pyramid-Bloc/BlVisibilityVisible.extension.st @@ -1,17 +1,115 @@ Extension { #name : #BlVisibilityVisible } { #category : #'*Pyramid-Bloc' } -BlVisibilityVisible >> asIcon [ +BlVisibilityVisible >> asString [ - ^ PyramidBlocPlugin - iconOf: PyramidBlocPlugin blocVisibilityVisible - maxHeight: 12 + ^ 'visible' ] { #category : #'*Pyramid-Bloc' } -BlVisibilityVisible >> asString [ +BlVisibilityVisible class >> blocIcon [ + "This class has been generated using Pyramid. - ^ 'visible' + By: YannLEGOFF + 2024-08-02 09:24:49" + + + ^ [ + | blinsets1 | + blinsets1 := BlInsets + top: 0.0 + right: 2.0 + bottom: 0.0 + left: 0.0. + { (BlElement new + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal exact: 24.0. + constraints vertical exact: 12.0 ]; + layout: BlLinearLayout horizontal; + addChildren: { + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #B; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent. + constraints margin: blinsets1 ]; + id: #C; + yourself). + (BlElement new + background: (BlPaintBackground new + paint: (BlColorPaint new + color: (Color + r: 0.5728250244379277 + g: 0.8191593352883676 + b: 1.0 + alpha: 1.0); + yourself); + opacity: 1.0; + yourself); + border: (BlBorderBuilder new + paint: (BlColorPaint new + color: (Color + r: 0.0 + g: 0.0 + b: 0.0 + alpha: 1.0); + yourself); + build); + geometry: BlRectangleGeometry new; + constraintsDo: [ :constraints | + constraints horizontal matchParent. + constraints vertical matchParent ]; + id: #D; + yourself) }; + id: #A; + yourself) } ] value ] { #category : #'*Pyramid-Bloc' } diff --git a/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st new file mode 100644 index 00000000..b4e5e210 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st @@ -0,0 +1,75 @@ +Class { + #name : #PyramidBlocGeometryPlugin, + #superclass : #Object, + #traits : 'TPyramidPlugin', + #classTraits : 'TPyramidPlugin classTrait', + #instVars : [ + 'propertiesManager' + ], + #category : #'Pyramid-Bloc-plugin-bloc-geometry' +} + +{ #category : #accessing } +PyramidBlocGeometryPlugin class >> geometry [ + + | property | + property := PyramidProperty new + name: 'Geo'; + command: PyramidGeometryCommand new; + inputPresenterClass: PyramidMagicButtonsInputPresenter; + yourself. + self geometryClasses do: [ :each | + property inputPresenterModel addButtonModel: + each asPyramidMagicButton ]. + ^ property +] + +{ #category : #'as yet unclassified' } +PyramidBlocGeometryPlugin class >> geometryClasses [ + + ^ { + BlRectangleGeometry. + BlRoundedRectangleGeometry. + BlSquareGeometry. + BlEllipseGeometry. + BlCircleGeometry. + BlAnnulusSectorGeometry. + BlTriangleGeometry. + BlPolylineGeometry. + BlBezierCurveGeometry. + BlPolygonGeometry } +] + +{ #category : #adding } +PyramidBlocGeometryPlugin >> addPanelsOn: aPyramidSimpleWindow [ + + aPyramidSimpleWindow at: #tabRight addItem: [ :builder | + builder + makeTab: self propertiesManager mainPresenter + label: 'Geo' + icon: (Smalltalk ui icons iconNamed: #box) + order: 4 ] +] + +{ #category : #connecting } +PyramidBlocGeometryPlugin >> connectOn: aPyramidEditor [ + + propertiesManager projectModel: aPyramidEditor projectModel. + propertiesManager commandExecutor: + aPyramidEditor commandExecutor +] + +{ #category : #initialization } +PyramidBlocGeometryPlugin >> initialize [ + + propertiesManager := PyramidPropertiesManagerForSelection new. + + propertiesManager addProperty: self class geometry. + +] + +{ #category : #adding } +PyramidBlocGeometryPlugin >> propertiesManager [ + + ^ propertiesManager +] diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 4a8c165a..1ab83e17 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -11,223 +11,6 @@ Class { #category : #'Pyramid-Bloc-plugin-bloc' } -{ #category : #'pyramid-serialized-bloc' } -PyramidBlocPlugin class >> blocVisibilityGone [ - "This class has been generated using Pyramid. - - By: YannLEGOFF - 2024-08-02 09:26:40" - - - ^ [ | blinsets1 | -blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. -{(BlElement new - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 24.0. - constraints vertical exact: 12.0 ]; - layout: BlLinearLayout horizontal; - addChildren: {(BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #B; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #C; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - visibility: BlVisibility hidden; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent ]; - id: #D; - yourself)}; - id: #A; - yourself)} ] value -] - -{ #category : #'pyramid-serialized-bloc' } -PyramidBlocPlugin class >> blocVisibilityHidden [ - "This class has been generated using Pyramid. - - By: YannLEGOFF - 2024-08-02 09:25:56" - - - ^ [ | blinsets1 | -blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. -{(BlElement new - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 24.0. - constraints vertical exact: 12.0 ]; - layout: BlLinearLayout horizontal; - addChildren: {(BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #B; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.863147605083089 g: 0.863147605083089 b: 0.863147605083089 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #C; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent ]; - id: #D; - yourself)}; - id: #A; - yourself)} ] value -] - -{ #category : #'pyramid-serialized-bloc' } -PyramidBlocPlugin class >> blocVisibilityVisible [ - "This class has been generated using Pyramid. - - By: YannLEGOFF - 2024-08-02 09:24:49" - - - ^ [ | blinsets1 | -blinsets1 := BlInsets top: 0.0 right: 2.0 bottom: 0.0 left: 0.0. -{(BlElement new - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal exact: 24.0. - constraints vertical exact: 12.0 ]; - layout: BlLinearLayout horizontal; - addChildren: {(BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #B; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent. - constraints margin: blinsets1 ]; - id: #C; - yourself) . - (BlElement new - background: (BlPaintBackground new - paint: (BlColorPaint new - color: (Color r: 0.5728250244379277 g: 0.8191593352883676 b: 1.0 alpha: 1.0); - yourself); - opacity: 1.0; - yourself); - border: (BlBorderBuilder new - paint: (BlColorPaint new - color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0); - yourself); - build); - geometry: BlRectangleGeometry new; - constraintsDo: [:constraints | constraints horizontal matchParent. - constraints vertical matchParent ]; - id: #D; - yourself)}; - id: #A; - yourself)} ] value -] - { #category : #accessing } PyramidBlocPlugin class >> clipChildren [ @@ -289,30 +72,6 @@ PyramidBlocPlugin class >> geometry [ ^ property ] -{ #category : #'as yet unclassified' } -PyramidBlocPlugin class >> iconOf: anObject [ - - | target | - target := anObject isCollection ifTrue: [ - BlElement new constraintsDo: [ :c | c horizontal fitContent . c vertical fitContent ]; addChildren: anObject; yourself. - ] ifFalse: [anObject ]. - ^ target exportAsForm -] - -{ #category : #'as yet unclassified' } -PyramidBlocPlugin class >> iconOf: aBlElement maxHeight: aNumber [ - - | form scale | - aBlElement isCollection ifTrue: [ - ^ self - iconOf: aBlElement first - maxHeight: aNumber ]. - form := aBlElement exportAsForm. - form height = 0 ifTrue: [ ^ form ]. - scale := aNumber / form height. - ^ form magnifyBy: scale -] - { #category : #accessing } PyramidBlocPlugin class >> visibility [ @@ -372,11 +131,10 @@ PyramidBlocPlugin class >> zIndex [ { #category : #adding } PyramidBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [ - aPyramidSimpleWindow at: #tabRight addItem: [ :builder | builder makeTab: self propertiesManager mainPresenter - label: 'Properties' + label: 'Props' icon: (Smalltalk ui icons iconNamed: #box) order: 1 ]. From 918cfd342ac3b6655711a16863d25aa12347e531 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Wed, 7 Aug 2024 09:21:37 +0200 Subject: [PATCH 8/8] Fix line geometry --- src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st | 4 ++-- src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st b/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st index bf8d85c9..d95e6834 100644 --- a/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st +++ b/src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st @@ -25,8 +25,8 @@ PyramidAbstractBorderCommand >> setValueFor: aBlElement with: anArgument [ | builder | builder := self borderBuilderOf: aBlElement. - self updateBuilder: builder with: anArgument. - aBlElement border: builder build. + self updateBuilder: builder with: anArgument value. + aBlElement border: builder build ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st index b4e5e210..f967623a 100644 --- a/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocGeometryPlugin.class.st @@ -35,6 +35,7 @@ PyramidBlocGeometryPlugin class >> geometryClasses [ BlCircleGeometry. BlAnnulusSectorGeometry. BlTriangleGeometry. + BlLineGeometry . BlPolylineGeometry. BlBezierCurveGeometry. BlPolygonGeometry }