-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grab only on borders. More tests. All the things
- Loading branch information
Julian Berger
committed
May 9, 2019
1 parent
b8f1ea2
commit 052e9ba
Showing
15 changed files
with
56 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSContentContainer.class/instance/grabOnBorder..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
event handling | ||
grabOnBorder: anEvent | ||
|
||
(self onBorder: anEvent position) ifTrue:[anEvent hand grabMorph: self content]. |
4 changes: 0 additions & 4 deletions
4
packages/Presenter-Core.package/PSContentContainer.class/instance/hasHandles..st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/Presenter-Core.package/PSContentContainer.class/instance/hasHandles.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
hasHandles | ||
|
||
^ hasHandles | ||
^ self resizeHandles notEmpty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSContentContainer.class/instance/onBorder..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
event handling | ||
onBorder: aPosition | ||
|
||
^ ((Rectangle center: self center extent: self extent - (10@10)) containsPoint: aPosition) not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ removeResizeHandles | |
|
||
self resizeHandles | ||
do: [:each | each abandon]; | ||
removeAll. | ||
self hasHandles: false | ||
removeAll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/Presenter-Tests.package/PSSlideSubmorphTest.class/instance/testBorderDragging.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
as yet unclassified | ||
testBorderDragging | ||
|
||
| destination | | ||
destination := self morph center + self defaultDragOffset. | ||
self dragndrop: MouseEvent redButton from: self container leftCenter + (1@0) to: self container leftCenter + self defaultDragOffset + (1@0). | ||
self slide fullBounds. | ||
|
||
self assert: self morph center equals: destination |
9 changes: 9 additions & 0 deletions
9
...es/Presenter-Tests.package/PSSlideSubmorphTest.class/instance/testNoDraggingFromCenter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
as yet unclassified | ||
testNoDraggingFromCenter | ||
|
||
| previousCenter | | ||
previousCenter := self container center. | ||
self dragndrop: MouseEvent redButton from: self container center to: self container center + self defaultDragOffset. | ||
self slide fullBounds. | ||
|
||
self assert: self container center equals: previousCenter |
13 changes: 13 additions & 0 deletions
13
...senter-Tests.package/PSSlideSubmorphTest.class/instance/testOnlyOneContainerHasHandles.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
running | ||
testOnlyOneContainerHasHandles | ||
|
||
| newContainer newMorph | | ||
newMorph := Morph new. | ||
self slide addContent: newMorph. | ||
newContainer := newMorph owner. | ||
|
||
self assert: ({self container . newContainer} select: [:aContainer | aContainer hasHandles]) size equals: 1. | ||
|
||
self click: MouseEvent redButton at: self morph center. | ||
|
||
self assert: ({self container . newContainer} select: [:aContainer | aContainer hasHandles]) size equals: 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters