[ENH] BrowserWithDragAndDrop

Stephan Rudlof sr at evolgo.de
Fri Apr 21 10:23:33 UTC 2000


Dear Squeakers,

here is version 0.4:

- supplies drag&drop *inside* browser windows now!

There was one nasty update problem, just look after the preamble
below...


Bug reports and feedbacks are appreciated!

Note: The amount of new code isn't so much like this changeset suggests;
I have kept it separated from the 'official' classes: so I had to have
to double some methods and to minimally change some other methods. But
this leads to code bloat!


Greetings,

Stephan


"Change Set:		BrowserWithDragAndDrop
Date:			21 April 2000
Author:			Stephan Rudlof
Release:			0.4

Drag&drop for standard browsers!

Precondition: Morphic, Squeak 2.7

Just press red button and drag inside a browser window or from one
browser window to another (you *don't* need two windows!):
- a method in another message category,
- a class in another class category.

BrowserWithDragAndDrop openBrowser.

There is a 'browsing' preference 'browseWithDragAndDrop'; default after
filingIn is 'on'.

Note: Not all locations, where a Browser will be started, are changed to
start the drag&drop one; if this stuff should be included into the
standard classes, these changes aren't necessary anymore...

Implementation: Class hierarchy is extended, because this stuff has to
be bulletproofed in praxis first.

Have fun!


History:

0.4		Drag&drop inside browsers, better logic, better visualization.
0.3		Drag&drop triggered by pressing red mouse button and just moving
mouse;
		PluggableListMorphWithDragAndDrop:
			event handling improved
			-> mouseUp deselects now (better for drag&drop).
0.2.1	PluggableListMorphWithDragAndDrop: superfluous inst var removed
0.2		Drag&drop triggered by pressing red mouse button longer than
DoubleClickTime.
0.1		Drag&drop triggered by pressing shift-key and then red mouse
button.
"

The nasty update problem:

- If you change in
-----------
PluggableListMorphWithDragAndDrop>>
showDropSuccess: success forItemWithContents: aSelector 
	scroller submorphsDo: [:morphItem | morphItem color: ((success and:
[morphItem contents == aSelector])
				ifTrue: [self dropSuccessColor]
				ifFalse: [morphItem ~~ selectedMorph
						ifTrue: [Color black]
						ifFalse: [Color red]])]
----------
the line
						ifFalse: [Color red]])]
to
						ifFalse: [Color black]])]
,
- drag (inside one browser window) a message from an already selected
category/protocol into itself (e.g. drag one class item into its own
class category item),
- click at another item in this list then; then

-> the updating of the category/protocol list doesn't work as it should.
I don't know the reason, but I think it has to do with some optimization
dependent of the font color: If it is black, Squeak seems to think that
there isn't a selection (normally it is red)... With other colors it
seems to work, only black is a problem!

Any ideas?

The current solution is OK for this work, but I'd like to know *why*
there is such a curious behavior!

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BrowserWithDragAndDrop.12.cs
Type: application/octet-stream
Size: 41689 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20000421/5b2c27b5/BrowserWithDragAndDrop.12.obj


More information about the Squeak-dev mailing list