-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pluggable-list' of https://github.com/hpi-swa-teaching/…
- Loading branch information
Showing
40 changed files
with
200 additions
and
62 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
packages/Material-Core.package/MDList.class/instance/drawFilterFor.on..st
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
packages/Material-Core.package/MDList.class/instance/drawFilterFor.on.at..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,14 @@ | ||
drawing | ||
drawFilterFor: aMDMenuItem on: aCanvas at: aRow | ||
|
||
| offsets | | ||
offsets := self filterOffsets: aMDMenuItem. | ||
offsets isEmpty ifTrue: [^ self]. | ||
|
||
offsets do: [ :offset | | ||
aCanvas | ||
frameAndFillRoundRect: (self filterBoundsForItem: aMDMenuItem with: offset at: aRow) | ||
radius: 3 | ||
fillStyle: (SolidFillStyle color: self filterColor) | ||
borderWidth: 0 | ||
borderColor: Color black] |
5 changes: 3 additions & 2 deletions
5
packages/Material-Core.package/MDList.class/instance/drawItem.on..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,15 +1,16 @@ | ||
drawing | ||
drawItem: anIndex on: aCanvas | ||
|
||
| row pos | | ||
| row pos item | | ||
row := (anIndex - self firstVisibleItem) + 1. | ||
pos := self globalPositionOfItemAt: row. | ||
aCanvas clipBy: self bounds during: [:clippedCanvas | | ||
clippedCanvas | ||
drawImage: (self filteredListItems at: anIndex) formCache | ||
at: pos]. | ||
|
||
self drawFilterFor: anIndex on: aCanvas. | ||
item := self filteredListItems at: anIndex. | ||
self drawFilterFor: item on: aCanvas at: row. | ||
(self showDividers and: (self dividersDrawable: row)) | ||
ifTrue: [ self drawDividersAt: pos on: aCanvas]. | ||
|
8 changes: 0 additions & 8 deletions
8
packages/Material-Core.package/MDList.class/instance/filterBoundsForItem.with..st
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/Material-Core.package/MDList.class/instance/filterBoundsForItem.with.at..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,8 @@ | ||
filtering | ||
filterBoundsForItem: aMDMenuItem with: offset at: aRow | ||
|
||
| absBounds | | ||
absBounds := self globalBoundsOfLabelOfItem: aMDMenuItem at: aRow. | ||
|
||
^ absBounds origin + (offset first first @ 0) corner: | ||
(absBounds origin x + offset first last) @ (absBounds corner y) |
4 changes: 2 additions & 2 deletions
4
packages/Material-Core.package/MDList.class/instance/filterOffsets..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
8 changes: 8 additions & 0 deletions
8
packages/Material-Core.package/MDList.class/instance/globalBoundsOfLabelOfItem.at..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,8 @@ | ||
drawing | ||
globalBoundsOfLabelOfItem: aMDMenuItem at: aRow | ||
|
||
| absPositionItem labelBounds | | ||
labelBounds := aMDMenuItem labelBounds. | ||
absPositionItem := self globalPositionOfItemAt: aRow. | ||
^ (labelBounds origin + absPositionItem corner: | ||
labelBounds corner + absPositionItem) |
8 changes: 0 additions & 8 deletions
8
packages/Material-Core.package/MDList.class/instance/globalBoundsOfLabelOfItemAt..st
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
packages/Material-Core.package/MDList.class/instance/globalPositionOfItemAt..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 @@ | ||
drawing | ||
globalPositionOfItemAt: aNum | ||
globalPositionOfItemAt: aRow | ||
|
||
^ self globalPositionOfFirstVisibleItem + (self relativePositionOfItemAt: aNum) | ||
^ self globalPositionOfFirstVisibleItem + (self relativePositionOfItemAt: aRow) |
5 changes: 3 additions & 2 deletions
5
packages/Material-Core.package/MDList.class/instance/mouseMove..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
4 changes: 2 additions & 2 deletions
4
packages/Material-Core.package/MDList.class/instance/relativePositionOfItemAt..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 @@ | ||
drawing | ||
relativePositionOfItemAt: aNum | ||
relativePositionOfItemAt: aRow | ||
|
||
^ (0 @ (self listItemHeight + self listItemPadding) * (aNum - 1)) | ||
^ (0 @ (self listItemHeight + self listItemPadding) * (aRow - 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
3 changes: 0 additions & 3 deletions
3
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/dropItemSelector..st
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/mouseEnterDragging..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 @@ | ||
event handling | ||
mouseEnterDragging: evt | ||
|
||
(evt hand hasSubmorphs and:[self dropEnabled]) ifFalse: ["no d&d" | ||
^super mouseEnterDragging: evt]. | ||
|
||
(self wantsDroppedMorph: evt hand firstSubmorph event: evt ) | ||
ifTrue:[ | ||
potentialDropRow := self rowAtLocation: evt position. | ||
evt hand newMouseFocus: self. | ||
self changed. | ||
"above is ugly but necessary for now" | ||
]. |
7 changes: 7 additions & 0 deletions
7
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/mouseLeaveDragging..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,7 @@ | ||
event handling | ||
mouseLeaveDragging: anEvent | ||
|
||
(self dropEnabled and:[anEvent hand hasSubmorphs]) ifFalse: ["no d&d" | ||
^ super mouseLeaveDragging: anEvent]. | ||
self resetPotentialDropRow. | ||
anEvent hand releaseMouseFocus: self. |
7 changes: 7 additions & 0 deletions
7
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/mouseMove..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,7 @@ | ||
event handling | ||
mouseMove: evt | ||
|
||
super mouseMove: evt. | ||
|
||
self mouseLeaveDragging: evt. | ||
self mouseEnterDragging: evt. |
4 changes: 4 additions & 0 deletions
4
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/potentialDropRow.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 @@ | ||
accessing | ||
potentialDropRow | ||
"return the row of the item that the most recent drop hovered over, or 0 if there is no potential drop target" | ||
^ potentialDropRow ifNil: [ 0 ]. |
6 changes: 6 additions & 0 deletions
6
...ages/Material-ToolBuilder.package/MDPluggableList.class/instance/resetPotentialDropRow.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,6 @@ | ||
as yet unclassified | ||
resetPotentialDropRow | ||
potentialDropRow ifNotNil: [ | ||
potentialDropRow ~= 0 ifTrue: [ | ||
potentialDropRow := 0. | ||
self changed. ] ] |
4 changes: 4 additions & 0 deletions
4
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/rowAtLocation..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 | ||
rowAtLocation: aPoint | ||
|
||
^ self globalPositionToIndex: aPoint |
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
Empty file.
18 changes: 18 additions & 0 deletions
18
...rial-ToolBuilder.package/MDPluggableListPlus.class/instance/acceptDroppingMorph.event..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,18 @@ | ||
drag and drop | ||
acceptDroppingMorph: aTransferMorph event: evt | ||
|
||
dropItemSelector ifNil: [^ self]. | ||
Transcript show: potentialDropRow. | ||
potentialDropRow ifNil: [^ self]. | ||
model | ||
perform: dropItemSelector | ||
withEnoughArguments: { | ||
aTransferMorph passenger. | ||
"self modelIndexFor: self potentialDropRow." | ||
self potentialDropRow. | ||
aTransferMorph shouldCopy. | ||
aTransferMorph}. | ||
|
||
self resetPotentialDropRow. | ||
evt hand releaseMouseFocus: self. | ||
Cursor normal show. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...ages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragTypeSelector..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,3 @@ | ||
accessing | ||
dragTypeSelector: anObject | ||
dragTypeSelector := anObject |
3 changes: 3 additions & 0 deletions
3
packages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragTypeSelector.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,3 @@ | ||
accessing | ||
dragTypeSelector | ||
^ dragTypeSelector |
4 changes: 4 additions & 0 deletions
4
...ages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dropItemSelector..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 @@ | ||
accessing | ||
dropItemSelector: aSymbol | ||
dropItemSelector := aSymbol. | ||
aSymbol ifNotNil:[self dropEnabled: true]. |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
packages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/startDrag..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,26 @@ | ||
drag and drop | ||
startDrag: evt | ||
|
||
| item itemMorph modelIndex | | ||
dragItemSelector ifNil:[^self]. | ||
evt hand hasSubmorphs ifTrue: [^ self]. | ||
self model okToChange ifFalse: [^ self]. | ||
|
||
"Ensure selection to save additional click." | ||
(self modelIndexFor: (self rowAtLocation: evt position)) in: [:evtIndex | | ||
self selectionIndex = evtIndex ifFalse: [self changeModelSelection: evtIndex]]. | ||
|
||
item := self selection ifNil: [^ self]. | ||
itemMorph := StringMorph contents: item asStringOrText. | ||
modelIndex := self modelIndexFor: self selectionIndex. | ||
|
||
[ "Initiate drag." | ||
(self model perform: dragItemSelector with: modelIndex) ifNotNil: [:passenger | | ddm | | ||
ddm := (self valueOfProperty: #dragTransferClass ifAbsent: [TransferMorph]) withPassenger: passenger from: self. | ||
ddm dragTransferType: (self dragTypeSelector ifNotNil: [:s | self model perform: s with: modelIndex]). | ||
ddm updateFromUserInputEvent: evt. | ||
self dragStartedSelector ifNotNil: [:s | self model perform: s with: itemMorph with: ddm]. | ||
evt hand grabMorph: ddm]. | ||
] ensure: [ | ||
Cursor normal show. | ||
evt hand releaseMouseFocus: self] |
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
...terial-ToolBuilder.package/MDPluggableListPlus.class/instance/wantsDroppedMorph.event..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 @@ | ||
drag and drop | ||
wantsDroppedMorph: aTransferMorph event: anEvent | ||
|
||
dropItemSelector ifNil: [^ false]. | ||
wantsDropSelector ifNil: [^ true]. | ||
|
||
(aTransferMorph isKindOf: TransferMorph) ifFalse: [^ false]. | ||
|
||
^ model perform: wantsDropSelector withEnoughArguments: { | ||
aTransferMorph passenger. | ||
aTransferMorph dragTransferType. | ||
aTransferMorph source. | ||
aTransferMorph} |
17 changes: 17 additions & 0 deletions
17
packages/Material-ToolBuilder.package/MDPluggableListPlus.class/methodProperties.json
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,17 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"acceptDroppingMorph:event:" : "JW 7/6/2018 16:40", | ||
"dragItemSelector" : "JW 7/6/2018 15:14", | ||
"dragItemSelector:" : "JW 7/6/2018 15:14", | ||
"dragStartedSelector" : "JW 7/6/2018 15:15", | ||
"dragStartedSelector:" : "JW 7/6/2018 15:15", | ||
"dragTypeSelector" : "JW 7/6/2018 15:15", | ||
"dragTypeSelector:" : "JW 7/6/2018 15:15", | ||
"dropItemSelector" : "JW 7/6/2018 15:14", | ||
"dropItemSelector:" : "JW 7/6/2018 16:50", | ||
"startDrag:" : "JW 7/6/2018 16:32", | ||
"wantsDropSelector" : "JW 7/6/2018 15:14", | ||
"wantsDropSelector:" : "JW 7/6/2018 15:14", | ||
"wantsDroppedMorph:event:" : "JW 7/6/2018 15:44" } } |
18 changes: 18 additions & 0 deletions
18
packages/Material-ToolBuilder.package/MDPluggableListPlus.class/properties.json
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,18 @@ | ||
{ | ||
"category" : "Material-ToolBuilder", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"dragItemSelector", | ||
"dropItemSelector", | ||
"wantsDropSelector", | ||
"dragTypeSelector", | ||
"dragStartedSelector" ], | ||
"name" : "MDPluggableListPlus", | ||
"pools" : [ | ||
], | ||
"super" : "MDPluggableList", | ||
"type" : "normal" } |
Oops, something went wrong.