[squeak-dev] The Inbox: Morphic-bp.1317.mcz

Bernhard Pieber bernhard at pieber.com
Thu Dec 8 20:35:09 UTC 2016


Dear Squeakers,

In addition to my changes from a year ago which I implemented the Drag To Edges feature also for slow window dragging. I would be grateful if someone with more Morphic experience did a review of my implementation. I am not sure if this is the correct way to do this.

Cheers,
Bernhard 

> Am 08.12.2016 um 21:07 schrieb commits at source.squeak.org:
> 
> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-bp.1317.mcz
> 
> ==================== Summary ====================
> 
> Name: Morphic-bp.1317
> Author: bp
> Time: 8 December 2016, 9:07:14.528425 pm
> UUID: 6ed0a859-f5e2-423a-b600-fd5a45aa0736
> Ancestors: Morphic-bp.1316
> 
> Make Drag To Edges also work if fastDragWindowForMorphic is turned off
> 
> =============== Diff against Morphic-bp.1316 ===============
> 
> Item was changed:
>  MorphicModel subclass: #SystemWindow
> + 	instanceVariableNames: 'labelString stripes label closeBox collapseBox paneMorphs paneRects collapsedFrame fullFrame isCollapsed isActive isLookingFocused menuBox mustNotClose labelWidgetAllowance updatablePanes allowReframeHandles labelArea expandBox savedBounds'
> - 	instanceVariableNames: 'labelString stripes label closeBox collapseBox paneMorphs paneRects collapsedFrame fullFrame isCollapsed isActive isLookingFocused menuBox mustNotClose labelWidgetAllowance updatablePanes allowReframeHandles labelArea expandBox'
>  	classVariableNames: 'ClickOnLabelToEdit CloseBoxFrame CloseBoxImageFlat CloseBoxImageGradient CollapseBoxImageFlat CollapseBoxImageGradient DoubleClickOnLabelToExpand DragToEdges ExpandBoxFrame ExpandBoxImageFlat ExpandBoxImageGradient FocusFollowsMouse GradientWindow HideExpandButton MenuBoxFrame MenuBoxImageFlat MenuBoxImageGradient ResizeAlongEdges ReuseWindows RoundedWindowCorners TopWindow WindowTitleActiveOnFirstClick WindowsRaiseOnClick'
>  	poolDictionaries: ''
>  	category: 'Morphic-Windows'!
> 
>  !SystemWindow commentStamp: '<historical>' prior: 0!
>  SystemWindow is the Morphic equivalent of StandardSystemView -- a labelled container for rectangular views, with iconic facilities for close, collapse/expand, and resizing.
> 
>  The attribute onlyActiveOnTop, if set to true (and any call to activate will set this), determines that only the top member of a collection of such windows on the screen shall be active.  To be not active means that a mouse click in any region will only result in bringing the window to the top and then making it active.!
> 
> Item was changed:
>  ----- Method: SystemWindow>>handleListenEvent: (in category 'events') -----
>  handleListenEvent: aUserInputEvent 
>  	"See #mouseEnterDragging:. Watch for finished drag-and-drop action and lock contents accordingly."
> - 
>  	(aUserInputEvent isMouse and: [ aUserInputEvent hand hasSubmorphs not ]) ifTrue: 
>  		[ self isKeyWindow ifFalse: [ self passivateIfNeeded ].
> + 		aUserInputEvent hand removeMouseListener: self ].
> + 
> + 	(aUserInputEvent hand submorphs includes: self) ifTrue: [
> + 		| clearArea selector |
> + 		clearArea := ActiveWorld clearArea.
> + 		(self class dragToEdges and: [(selector := self dragToEdgesSelectorFor: aUserInputEvent cursorPoint in: clearArea) notNil])
> + 			ifTrue: [
> + 				savedBounds ifNil: [savedBounds := self bounds].
> + 				self newBounds: (clearArea perform: selector)]
> + 			ifFalse: [
> + 				savedBounds ifNotNil: [
> + 					self newBounds: savedBounds.
> + 					savedBounds := nil]]]!
> - 		aUserInputEvent hand removeMouseListener: self ].!
> 
> Item was changed:
>  ----- Method: SystemWindow>>justDroppedInto:event: (in category 'geometry') -----
>  justDroppedInto: aMorph event: anEvent
> + 	savedBounds := nil.
> - 
>  	isCollapsed
>  		ifTrue: [self position: ((self position max: 0 at 0) grid: 8 at 8).
>  				collapsedFrame := self bounds]
>  		ifFalse: [fullFrame := self bounds].
> 
>  	self beKeyWindow.
>  	self hasDropShadow: Preferences menuAppearance3d. "See #startDragFromLabel:."
>  			
>  	aMorph == self world ifTrue: [self assureLabelAreaVisible].
> 
>  	(Project uiManager openToolsAttachedToMouseCursor and: (self hasProperty: #initialDrop))
>  		ifTrue: [
>  			self removeProperty: #initialDrop.
>  			(self submorphs detect: [:m | m isKindOf: BottomRightGripMorph] ifNone: [])
>  				ifNotNil: [:grip | 
>  					grip
>  						referencePoint: anEvent position;
>  						setProperty: #targetHadDropShadow toValue: true "See MorphicToolBuilder >> #open:".
>  					self hasDropShadow: false.
>  					anEvent hand newMouseFocus: grip]].
>  			
>  	^super justDroppedInto: aMorph event: anEvent!
> 
> Item was changed:
>  ----- Method: SystemWindow>>startDragFromLabel: (in category 'events') -----
>  startDragFromLabel: evt
>  	"When label events are active, we need to pass dragging to the window explicitely
>  	 The window only recognizes a drag with an offset of more than 3 pixels"
>  	
>  	self isSticky ifTrue: [^ self].
>  	self fastFramingOn 
>  		ifTrue: [self doFastFrameDrag: evt cursorPoint]
>  		ifFalse: [
>  			self hasDropShadow: false.
> + 			evt hand grabMorph: self topRendererOrSelf.
> + 			evt hand addMouseListener: self]
> - 			evt hand grabMorph: self topRendererOrSelf]
>  !
> 
> 



More information about the Squeak-dev mailing list