-
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.
* Allow items from the regular browser to be dragged and dropped into the material browser. * Temporary working version of drag and drop * nearly finished version of draggable lists
- Loading branch information
1 parent
dd55b49
commit 24a5712
Showing
26 changed files
with
89 additions
and
60 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/Material-Core.package/MDList.class/instance/forVisibleItemIndicesDo..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,5 @@ | ||
event handling | ||
forVisibleItemIndicesDo: aBlock | ||
|
||
self lastVisibleItem = 0 ifTrue: [^ self]. | ||
self firstVisibleItem to: self lastVisibleItem do: aBlock |
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
2 changes: 1 addition & 1 deletion
2
packages/Material-Core.package/MDList.class/instance/ifInBounds.do..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,5 +1,5 @@ | ||
event handling | ||
ifInBounds: anIndex do: aBlock | ||
|
||
self filteredListItems size >= anIndex | ||
(self filteredListItems size >= anIndex and: anIndex > 0) | ||
ifTrue: [aBlock value: (self filteredListItems at: anIndex)] |
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
7 changes: 7 additions & 0 deletions
7
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/doubleClick..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 @@ | ||
as yet unclassified | ||
doubleClick: event | ||
| index | | ||
doubleClickSelector ifNil: [^super doubleClick: event]. | ||
index := self rowAtLocation: event position. | ||
index = 0 ifTrue: [^super doubleClick: event]. | ||
^ self model perform: doubleClickSelector |
9 changes: 9 additions & 0 deletions
9
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/modelSelect..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 @@ | ||
event handling | ||
modelSelect: anIndex | ||
|
||
(self model perform: self selected) = 0 | ||
ifFalse: [(self listItems at: (self model perform: self selected)) deselect]. | ||
|
||
self ifInBounds: anIndex do: [:listitem | | ||
self model perform: self changeSelected with: anIndex. | ||
listitem select] |
12 changes: 10 additions & 2 deletions
12
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/mouseDown..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,7 +1,15 @@ | ||
event handling | ||
mouseDown: evt | ||
|
||
super mouseDown: evt. | ||
| selectors | | ||
self selectListItem: evt. | ||
|
||
evt yellowButtonPressed "First check for option (menu) click" | ||
ifTrue: [^ self yellowButtonActivity: evt shiftPressed] | ||
ifTrue: [^ self yellowButtonActivity: evt shiftPressed]. | ||
|
||
selectors := Array | ||
with: #click: | ||
with: (doubleClickSelector ifNotNil:[#doubleClick:]) | ||
with: nil | ||
with: (self dragEnabled ifTrue:[#startDrag:] ifFalse:[nil]). | ||
evt hand waitForClicksOrDrag: self event: evt selectors: selectors threshold: HandMorph dragThreshold "pixels". |
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
2 changes: 1 addition & 1 deletion
2
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
event handling | ||
mouseLeaveDragging: anEvent | ||
|
||
(self dropEnabled and:[anEvent hand hasSubmorphs]) ifFalse: ["no d&d" | ||
(self dropEnabled and: [anEvent hand hasSubmorphs]) ifFalse: ["no d&d" | ||
^ super mouseLeaveDragging: anEvent]. | ||
self resetPotentialDropRow. | ||
anEvent hand releaseMouseFocus: self |
15 changes: 15 additions & 0 deletions
15
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/selectListItem..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,15 @@ | ||
event handling | ||
selectListItem: evt | ||
|
||
| index mouseEvent mouseEvtPos | | ||
self filteredListItems ifEmpty: [^ self]. | ||
|
||
index := self globalPositionToIndex: evt position. | ||
self modelSelect: index. | ||
mouseEvtPos := self globalPositionToPositionInListItem: evt position. | ||
mouseEvent := evt copy position: mouseEvtPos. | ||
|
||
self ifInBounds: index do: [:listItem | | ||
listItem mouseDown: mouseEvent. | ||
listItem select. | ||
self newSelectedItem: listItem]. |
4 changes: 4 additions & 0 deletions
4
packages/Material-ToolBuilder.package/MDPluggableList.class/instance/selection.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 | ||
selection | ||
|
||
^ self selectedItem |
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
6 changes: 3 additions & 3 deletions
6
...ages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragItemSelector..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 | ||
dragItemSelector: anObject | ||
|
||
dragItemSelector := anObject | ||
dragItemSelector: aSymbol | ||
dragItemSelector := aSymbol. | ||
aSymbol ifNotNil:[self dragEnabled: true]. |
1 change: 0 additions & 1 deletion
1
packages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragItemSelector.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,3 @@ | ||
accessing | ||
dragItemSelector | ||
|
||
^ dragItemSelector |
1 change: 0 additions & 1 deletion
1
...s/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragStartedSelector..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,3 @@ | ||
accessing | ||
dragStartedSelector: anObject | ||
|
||
dragStartedSelector := anObject |
1 change: 0 additions & 1 deletion
1
...es/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/dragStartedSelector.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,3 @@ | ||
accessing | ||
dragStartedSelector | ||
|
||
^ dragStartedSelector |
1 change: 0 additions & 1 deletion
1
...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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
accessing | ||
dragTypeSelector: anObject | ||
|
||
dragTypeSelector := anObject |
1 change: 0 additions & 1 deletion
1
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
accessing | ||
dragTypeSelector | ||
|
||
^ dragTypeSelector |
3 changes: 1 addition & 2 deletions
3
...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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
accessing | ||
dropItemSelector: aSymbol | ||
|
||
dropItemSelector := aSymbol. | ||
aSymbol ifNotNil:[self dropEnabled: true] | ||
aSymbol ifNotNil:[self dropEnabled: true]. |
1 change: 0 additions & 1 deletion
1
packages/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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
accessing | ||
dropItemSelector | ||
|
||
^ dropItemSelector |
12 changes: 4 additions & 8 deletions
12
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
1 change: 0 additions & 1 deletion
1
...ges/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/wantsDropSelector..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,3 @@ | ||
accessing | ||
wantsDropSelector: anObject | ||
|
||
wantsDropSelector := anObject |
1 change: 0 additions & 1 deletion
1
...ages/Material-ToolBuilder.package/MDPluggableListPlus.class/instance/wantsDropSelector.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,3 @@ | ||
accessing | ||
wantsDropSelector | ||
|
||
^ wantsDropSelector |
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