[ENH] alternativeDrop-ls (was: Re: [Annoyance] Script editors accept drop on playfields)

Sean McGrath sean at manybits.net
Fri Jan 26 20:15:13 UTC 2001


I agree that people don't look at the mouse position. They look at
what they pick up and what they drop it on. The following change
makes dropping much more intuitive in my experience (that means
extensive user testing using FreeCell :).

This ignores mouse position;  instead it uses the center of the dropped
morph to determine the drop target.

--
Sean McGrath
sean at manybits.net

--

'From Squeak2.9alpha of 13 June 2000 [latest update: #3193] on 26 January
2001 at 11:57:16 am'!

!HandMorph methodsFor: 'grabbing/dropping' stamp: 'sm 12/25/2000 09:16'!
dropMorph: aMorph event: anEvent
	"Drop the given morph which was carried by the hand"
	"Use dropped center instead of hand position for event position.
	 This means the dropped morph is accepted if its center,
      not the hand position, is over the target. sm - 12/25/2000"
	| event dropped |
	dropped _ aMorph.
	(dropped hasProperty: #addedFlexAtGrab)
		ifTrue:[dropped _ aMorph removeFlexShell].
	event _ DropEvent new setPosition: dropped center contents:
dropped hand: self.
	owner processEvent: event.
	event wasHandled ifFalse:[aMorph rejectDropMorphEvent: event].
	aMorph owner == self ifTrue:[aMorph delete].
	self mouseOverHandler processMouseOver: anEvent.
! !

-- 

On Fri, 26 Jan 2001, Lex Spoon wrote:

>
> Karl Ramberg <karl.ramberg at chello.se> wrote:
> > Script editors could follow
> > the same rules as system windows and have embedding turned off by default.
> >
>
> Definitely annoying.  Note, though, the system windows solution has its
> own annoyances.  System windows and tile scripts are still morphs, and
> sometimes you want to treat them as so, yet this preference puts up a
> wall.  The most frequent time I get bit by this preference, is when I
> try to drop a window into a flap -- it doesn't work if the preference is
> turned on.  If nothing else, the unnecessary discrimination makes it
> hard to demonstrate flaps to people.  I've ended up a couple of times
> saying "Check it out!  Flaps let you drop morphs into them -- oh, well,
> not any of *these* morphs, they're special morphs called
> 'SystemWindows'".
>
> But then again, it still sucks when a browser falls into a BookMorph.
> Philosophize all one wants, it seems we have all bumped into this.
>
>
> So what to do?  Thinking this through again, here's a solution that
> seems to work.  It has two parts.
>
> First, don't look at the mouse position.  *People* often don't look at
> the mouse position, and even programmers get confused by too much
> reliance on the mouse.  More than once I've seen someone accidentally
> drop something into a playfield, and then go to extreme measures trying
> to avoid it happening it again.  The worst is the cringe they make as
> they try the next drop -- they really don't know whether the system is
> going to eat their window again.  They don't realize that the system is
> simply looking at where the mouse is.
>
> Second, don't accept a drop unless the dropped morph will visibly fit in
> the underlying morph.  At the very least, don't allow three pixels of
> overlap to be enough reason to accept a drop -- the visual effect is
> that the window disappears.  But why stop there?  Let's only allow drops
> if the *entire* morph will fit intothe playfield.  One might call this a
> "pegs and holes" approach: don't accept a peg, unless the hole can
> visibly accomodate it.  Even adults understand pegs and holes.
>
> The main argument against this approach is that, occasionaly, you *do*
> want to drop a large morph into a small playfield.  However, these cases
> seem to be rare.  Furthermore, the functionality is still available,
> albeit more difficult: you can either increase the size of the playfield
> temporarily, or you can forcibly use the "embed" menu.
>
>
> Cheers,
>
> -Lex
>
>
>
> =====
> 'From Squeak2.9alpha of 13 June 2000 [latest update: #3193] on 26
> January 2001 at 11:42:10 am'!
> "Change Set:		alternativeDrop-ls
> Date:			26 January 2001
> Author:			Lex Spoon
>
> Change the algorithm playfields and books use for deciding whether to
> accept a dropped morph: ignore the mouse position, and drop iff the
> morph's bounds fit entirely inside the playfield or book.
>
> "!
>
>
> !BookMorph methodsFor: 'dropping/grabbing' stamp: 'ls 1/26/2001 11:39'!
> wantsDroppedMorph: aMorph event: evt
> 	(currentPage bounds containsRect: aMorph bounds) ifFalse: [^ false].
> 	^ super wantsDroppedMorph: aMorph event: evt! !
>
>
> !PasteUpMorph methodsFor: 'dropping/grabbing' stamp: 'ls 1/26/2001
> 11:37'!
> wantsDroppedMorph: aMorph event: evt
> 	self isWorldMorph ifTrue:[^true]. "always"
> 	self visible ifFalse: [^ false].  "will be a call to #hidden again very
> soon"
> 	self dropEnabled ifFalse: [^ false].
> 	^self bounds containsRect: aMorph bounds
>
> ! !
>
>





More information about the Squeak-dev mailing list