The Artima Developer Community
Sponsored Link

Agile Buzz Forum
DragDrop Drag State Redux

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
DragDrop Drag State Redux Posted: Nov 12, 2003 10:13 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: DragDrop Drag State Redux
Feed Title: Pollock
Feed URL: http://www.cincomsmalltalk.com/rssBlog/pollock-rss.xml
Feed Description: Pollock - the next VW GUI
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Pollock

Advertisement

Vassili Bykov writes:

Hi Sames, I haven't digested the bulk of drag-and-drop posts yet, but this one thing made me stumble--selection/drag initiation behavior you describe. Please, let's not go this way! Things like widget behavior is not the area to be creative in. Fire up Explorer on Windows or Finder on a Mac, and do what they do on each of those platforms. Here are the issues I can see with the scheme you describe: Items are not selected on a down click. This is bad, because everyone else, including ourselves at the moment, selects on a down click. Selection is feedback, so our lists will feel seriously wrong if they don't work that way. The scheme is not consistent between single- and multi-selection lists. Consider this scenario: I have a list of something, initially without a selection. I want to drag an item. For a single-selection list, the scheme you describe will indeed drag an item (though the item will appear selected only after I've started dragging, rather than on clicking, which as I already said will feel strange). For a multi-selection list, your scheme will do a range selection instead. To drag, I would have to first click/release an item to select, and then click/drag to actually drag. Given that there is no visible difference between single and multi-selection lists, we are going to have a widget that appears to behave unpredictably. And again, the most important issue is that lists in other applications don't follow this scheme. I think our menus (how they don't do the right thing when you click an item with a submenu, and how they close submenus without a delay that would allow one to move the mouse straight to a submenu item, rather than first horizontally and then down) is a good lesson that this kind of things aren't a field for innovation. Not for our innovation anyway.

I've been caught!

I quoted something I wrote about a year and a half ago, and didn't realize how stupid it was when I wrote it, much less quoted it!

Vassili's right you know.

Yesterday, I printed out my DragDrop articles because I was about to start coding. I wanted to make sure that either I stuck to my stories or I came back here and reported my change of mind. Looking over the state machine rules I wrote all that long time ago, it is quite apparent that I didn't even pay attention to them when I was writing the basic non drag drop related selection rules for widgets in Pollock already done.

Besides the issues Vassili pointed out above, there is one more, and that is related to Multi-Selection lists. There are two ways that Multi-Select lists can work for initial click and drag. The ground rules are that no selection is made as yet, and for the sake of simplicity, we'll just talk about a ListBox. The activity is: You click on an item and drag the mouse around the ListBox, without lifting the mouse button. First, on the initial click, as Vassili said before, the item clicked should be selected. Next is a bifurcation of possibilities. Either 1) movement around the list adds more selected items (Sweep Select) or 2) the initial item selected is dragged around.

The problem is, both are valid behavior, and both exhibit themselves in different multi-selection lists in platforms. For instance, in Explorer, you can't Sweep Select, every click drag is a drag initiation. On the other hand, if you create a table object in Word, you can Sweep Select the cells, rows or columns. You have to click again on them to start a drag.

So, this brings up a complication that I didn't want to address, but it seems I have to. The Sweep Select mode, instead of being automatic as it is currently, needs to be weighted. In other words, for Multi Select widgets, we have to have a "Favor Sweep Select Over Drag" option. This will tell us what to do when a Multi Select widget is attempting to start a drag. With that, and all of the rest, here are the rules

For Single Select mode widgets with standard selection, and other widgets that have no multiple select capabilities, the following are the rule states:

  1. If you click on an unselected item the item is selected and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down nothing further happens.
  2. If you click on an unselected item the item is selected and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, you will be put into Drag for the selected item.
  3. If you click on an unselected item the item is selected and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, no changes in selection occur.
  4. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, nothing further happens.
  5. If you click on a selected item and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, you will be put into Drag for the selected item.
  6. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, no changes in selection occur.

For Single Select mode widgets with Toggle Select selection, the following are the rule states:

  1. If you click on an unselected item the item is selected and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down nothing further happens.
  2. If you click on an unselected item the item is selected and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, you will be put into Drag for the selected item.
  3. If you click on an unselected item the item is selected and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, no changes in selection occur.
  4. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, the item is unselected when the mouse is released.
  5. If you click on a selected item and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, you will be put into Drag for the selected item.
  6. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if the mouse is released on the same item that it started on, the item is unselected when the mouse is released.
  7. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if the mouse is released on a different item than it started on, no changes in selection occur.

For Multi Select mode widgets that have "Favor Sweep Select Over Drag" mode ENABLED, the following are the rule states:

  1. If you click on an unselected item the item is selected and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down nothing further happens.
  2. If you click on an unselected item the item is selected and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, additional items get added to the current selection.
  3. If you click on an unselected item the item is selected and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, additional items get added to the current selection.
  4. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were selected, then the selection is changed to ONLY be the newly selected item when the mouse is pressed.
  5. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were NOT selected, no changes in selection occur.
  6. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were selected, then the selection is changed to be the newly selected item when the mouse is pressed and additional items get added to that selection.
  7. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were NOT selected, additional items get added to that selection.
  8. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag IS enabled for this widget, if other additional items were selected, then you are put into Drag for the selected items.
  9. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag IS enabled for this widget, if other additional items were NOT selected, then you are put into Drag for that selected item.

For Multi Select mode widgets that have "Favor Sweep Select Over Drag" mode DISABLED (this will be the default), the following are the rule states (This is in effect the "Explorer" way):

  1. If you click on an unselected item the item is selected and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down nothing further happens.
  2. If you click on an unselected item the item is selected and if you DO move the mouse more that 2 @ 2 while you have the mouse down, and Drag is enabled for this widget, then you are put into Drag for that selected item.
  3. If you click on an unselected item the item is selected and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, additional items get added to the current selection.
  4. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were selected, then the selection is changed to ONLY be the newly selected item when the mouse is pressed.
  5. If you click on a selected item and if you do NOT move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were NOT selected, no changes in selection occur.
  6. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were selected, then the selection is changed to be the newly selected item when the mouse is pressed and additional items get added to that selection.
  7. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag is NOT enabled for this widget, if other additional items were NOT selected, additional items get added to that selection.
  8. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag IS enabled for this widget, if other additional items were selected, then you are put into Drag for the selected items.
  9. If you click on a selected item and if you DO move the mouse more than 2 @ 2 while you have the mouse down, and Drag IS enabled for this widget, if other additional items were NOT selected, then you are put into Drag for that selected item.

What a mess! I really didn't want to have to do that. I guess I was just foolish. Wouldn't be the first time.

I'm not done though. There are more things that need fixing. I'll cover them next.

And So It Goes
Sames

Read: DragDrop Drag State Redux

Topic: Creative Commons Previous Topic   Next Topic Topic: DragDrop Part 1 (At Last)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use