Skip to content

Commit

Permalink
Adds "inspect" and "collect" as possible drop modifiers. "inspect" al…
Browse files Browse the repository at this point in the history
…ways shows the object explorer and "collect" always opens the artifact list to collect, e.g., objects with they single-object editors, which is the class definition for classes.
  • Loading branch information
marceltaeumel committed Mar 3, 2020
1 parent 5eceae1 commit 5a995f8
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 27 deletions.
Expand Up @@ -3,27 +3,30 @@ showWindowForTransferMorph: aTransferMorph

VivideLight active ifNil: [^ self].

aTransferMorph dragTransferType in: [:type |
(#(pane panes) includes: type)
ifTrue: [^ aTransferMorph passenger asList collect: [:ea |
ViSinglePaneEditor new
pane: ea;
openInWindow;
fullBounds; "Needed for correct geometry."
window]].


(aTransferMorph hasFlag: #script)
ifTrue: [^ VivideLight active scriptArtifacts: aTransferMorph passenger].

(#(objects) includes: type)
ifTrue: [^ {VivideLight active openArtifacts: aTransferMorph passenger}].

(#(artifact) includes: type)
ifTrue: [^ {VivideLight active openEditorForArtifact: aTransferMorph passenger}].
(aTransferMorph hasFlag: #inspect)
ifTrue: [^ {VivideLight active openExplorer: aTransferMorph passenger}].

aTransferMorph dragTransferType in: [:type |

(#(pane panes) includes: type)
ifTrue: [^ aTransferMorph passenger asList collect: [:ea |
ViSinglePaneEditor new
pane: ea;
openInWindow;
fullBounds; "Needed for correct geometry."
window]].

(#(objects) includes: type)
ifTrue: [^ {VivideLight active openArtifacts: aTransferMorph passenger}].

(#(artifact) includes: type)
ifTrue: [^ {VivideLight active openEditorForArtifact: aTransferMorph passenger}].

(#(editorStates) includes: type)
ifTrue: [^ {VivideLight active openEditor: aTransferMorph passenger first}].
(#(editorStates) includes: type)
ifTrue: [^ {VivideLight active openEditor: aTransferMorph passenger first}].
].

^ {VivideLight active openArtifact: aTransferMorph passenger}
Expand Up @@ -3,4 +3,4 @@
},
"instance" : {
"openArtifactsForTransferMorph:" : "mt 12/18/2014 12:29:06.465",
"showWindowForTransferMorph:" : "mt 10/13/2017 17:17" } }
"showWindowForTransferMorph:" : "mt 3/3/2020 09:20" } }
Expand Up @@ -7,7 +7,10 @@ forScript: symbolOrBlockOrScript withObjects: objects
objects: objects;
yourself.

"Allow domain objects to override #artifacts script."
pane chooseVivideTool.
"Allow domain objects to override #artifacts script if not requested otherwise by the user."
self flag: #evaluate; flag: #collect.
self currentEvent in: [:evt |
(evt isDropEvent and: [evt contents hasFlag: #collect])
ifFalse: [pane chooseVivideTool]].

^ pane
@@ -1,7 +1,7 @@
{
"class" : {
"chooseAndOpenScriptWith:" : "mt 7/19/2019 14:25",
"forScript:withObjects:" : "mt 7/25/2019 15:39",
"forScript:withObjects:" : "mt 3/3/2020 09:31",
"openScript:withObjects:" : "mt 7/25/2019 15:39" },
"instance" : {
"acceptChanges" : "mt 5/7/2014 08:14:08.201",
Expand Down
Expand Up @@ -5,6 +5,8 @@ flagSpecs

^ flagSpecs ifNil: [#(
($e 'Evaluate' #evaluate)
($i 'Inspect' #inspect)
($c 'Collect' #collect)
($s 'Script' #script)
($u 'Use' #use)
)]
Expand Up @@ -8,8 +8,10 @@ showHelp
('<font size="22" family="Bitmap Segoe UI Light" color="#AAAAAA">{1}</font>' format: {
self flagSpecs
inject: ''
into: [:label :spec | label, String cr, String tab, spec first asString, ' ... ', spec second]
})) asHtmlText asMorph.
into: [:label :spec | label, '<br> ', spec first asString, ' ... ', spec second]
})) asTextFromHtml.
text addAttribute: (TextFontReference toFont: TextStyle defaultFixedFont).
text := text asMorph.

helpBox := Morph new color: (Color gray:0.3); bounds: (text fullBounds outsetBy: 15); addDropShadow; yourself.
text center: helpBox center.
Expand Down
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"flagSpecs" : "mt 10/26/2015 14:14:51.516",
"flagSpecs" : "mt 3/3/2020 09:07",
"flagSpecs:" : "mt 12/16/2014 15:11:47.574",
"iconFor:" : "mt 1/29/2018 13:40",
"initDraggedMorph" : "mt 5/2/2014 11:48:06.99",
Expand All @@ -12,7 +12,7 @@
"passenger:" : "mt 11/16/2015 11:33:26.64",
"setDefaultParameters" : "mt 7/7/2019 11:02",
"setFlags:" : "mt 12/16/2014 15:36:18.069",
"showHelp" : "mt 2/21/2018 17:23",
"showHelp" : "mt 3/3/2020 09:26",
"step" : "mt 12/16/2014 16:54:24.912",
"updateGradient" : "mt 7/7/2019 11:02",
"updateKeyStroke:" : "mt 12/16/2014 15:16:45.266",
Expand Down
Expand Up @@ -5,4 +5,4 @@ transferItemFor: someDictionaries
withPassenger: (self passengerFor: someDictionaries)
from: self source)
dragTransferType: self dragTransferType;
flagSpecs: #(($e 'Evaluate' #evaluate)($s 'Script' #script)($u 'Use' #use))
flagSpecs: nil "#(($e 'Evaluate' #evaluate)($s 'Script' #script)($u 'Use' #use))"
Expand Up @@ -6,4 +6,4 @@
"key:" : "mt 7/25/2012 14:56:49.597",
"passengerFor:" : "mt 2/4/2015 10:40",
"textFor:" : "mt 8/13/2012 10:38:59.8",
"transferItemFor:" : "mt 10/26/2015 14:15:42.998" } }
"transferItemFor:" : "mt 3/3/2020 09:09" } }

0 comments on commit 5a995f8

Please sign in to comment.