Skip to content

Commit

Permalink
Merge pull request #124 from OpenSmock/Issue_0110
Browse files Browse the repository at this point in the history
  • Loading branch information
labordep authored Dec 17, 2023
2 parents 7385939 + 1b0d0e1 commit fa6c4f9
Show file tree
Hide file tree
Showing 28 changed files with 1,381 additions and 695 deletions.
24 changes: 24 additions & 0 deletions src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Class {
#name : #PyramidAbstractChangeDrawOrderCommand,
#superclass : #PyramidAbstractBlocCommand,
#category : #'Pyramid-Bloc-plugin-bloc-order'
}

{ #category : #testing }
PyramidAbstractChangeDrawOrderCommand class >> isAbstract [

^ self == PyramidAbstractChangeDrawOrderCommand
]

{ #category : #testing }
PyramidAbstractChangeDrawOrderCommand >> canBeUsedFor: anObject [

^ (super canBeUsedFor: anObject) and: [ anObject hasParent]
]

{ #category : #'as yet unclassified' }
PyramidAbstractChangeDrawOrderCommand >> getValueFor: aBlElement [
"return current index for testing."

^ aBlElement parent childIndexOf: aBlElement
]

This file was deleted.

30 changes: 17 additions & 13 deletions src/Pyramid-Bloc/PyramidBlocPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -402,33 +402,37 @@ PyramidBlocPlugin >> menuChangeOrderOn: aBuilder [
group
addItem: [ :item |
item
icon: (self iconNamed: #top);
name: 'Put in front';
icon: PyramidDrawOrderIcons formOnForeground;
name: 'On foreground';
enabled: true;
action: [ self send: PyramidSendTopCommand new on: { single } ];
action: [
self send: PyramidOnForegroundOrderCommand new on: { single } ];
yourself ];
addItem: [ :item |
item
icon: (self iconNamed: #up);
name: 'Send up';
icon: PyramidDrawOrderIcons formOnBackground;
name: 'On background';
enabled: true;
action: [ self send: PyramidSendUpCommand new on: { single } ];
action: [
self send: PyramidOnBackgroundOrderCommand new on: { single } ];
yourself ];
addItem: [ :item |
item
icon: (self iconNamed: #down);
name: 'Send down';
icon: PyramidDrawOrderIcons formMoveForward;
name: 'Move forward';
enabled: true;
action: [ self send: PyramidSendDownCommand new on: { single } ];
action: [
self send: PyramidMoveForwardOrderCommand new on: { single } ];
yourself ];
addItem: [ :item |
item
icon: (self iconNamed: #bottom);
name: 'Put in back';
icon: PyramidDrawOrderIcons formMoveBackward;
name: 'Move backward';
enabled: true;
action: [
self send: PyramidSendBottomCommand new on: { single } ];
yourself ] ]
self send: PyramidMoveBackwardOrderCommand new on: { single } ];
yourself ];
yourself ]
order: 20
]

Expand Down
17 changes: 17 additions & 0 deletions src/Pyramid-Bloc/PyramidChangeOrderWithIndexCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Class {
#name : #PyramidChangeOrderWithIndexCommand,
#superclass : #PyramidAbstractChangeDrawOrderCommand,
#category : #'Pyramid-Bloc-plugin-bloc-order'
}

{ #category : #'as yet unclassified' }
PyramidChangeOrderWithIndexCommand >> setValueFor: aBlElement with: anArgument [

| currentIndex parent |
currentIndex := self getValueFor: aBlElement.
parent := aBlElement parent.
(anArgument between: 1 and: parent childrenCount) ifFalse: [ ^ self ].

parent removeChild: aBlElement.
parent addChild: aBlElement at: anArgument
]
41 changes: 0 additions & 41 deletions src/Pyramid-Bloc/PyramidChangePositionWithSiblingsModel.class.st

This file was deleted.

Loading

0 comments on commit fa6c4f9

Please sign in to comment.