Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 0110 #124

Merged
merged 6 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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