PDA

View Full Version : increasing usability of drag'n'drop



georgie
23rd May 2006, 06:39
I want my user to be able to move a widget around with reasonable accuracy.

The drag and drop works fine, but in initial testing, most of my users were slightly disconcerted by the fact that the drop act does not happen under the tip of the mouse....i.e. event.pos() does not return a value under the part of the mouse which is usually the "active" pointy bit at the tip of the arrow, but insead off to the right and down, under the box bit....

now i've fixed it easily with an offset, but it just seems a wierd choice IMO......

has anybody else had experience with this? is there any way of uniformly changing the position of a mouse event? like setting the active bit of the mouse for the whole program....

(n.b. it also meant that if I selected the widget and did not move the mouse, but just dropped it in the same position it still moved about 25 right and 25 down).......

wysota
23rd May 2006, 11:20
I want my user to be able to move a widget around with reasonable accuracy.

The drag and drop works fine, but in initial testing, most of my users were slightly disconcerted by the fact that the drop act does not happen under the tip of the mouse....i.e. event.pos() does not return a value under the part of the mouse which is usually the "active" pointy bit at the tip of the arrow, but insead off to the right and down, under the box bit....

I think you are confusing two techniques. Dragging widgets is not considered a drag&drop. It's simply moving them with your mouse :)



now i've fixed it easily with an offset, but it just seems a wierd choice IMO......

has anybody else had experience with this? is there any way of uniformly changing the position of a mouse event? like setting the active bit of the mouse for the whole program....

(n.b. it also meant that if I selected the widget and did not move the mouse, but just dropped it in the same position it still moved about 25 right and 25 down).......

Can we see the code?

georgie
23rd May 2006, 14:58
sorry, i may have phrased myself inexactly - i am pretty sure I am doing drag and drop (they are moving from one window to another...or within the one window....whatever they need, it's pretty flexible - either way i have reimplemented dragMoveEvent, dragEnterEvent and dropEvent).....

but i just want them to be able to place the item in the destination window with some accuracy -- the drop should occur so that the centre of the widget's new position is where the pointy bit of the mouse is instead of the top right hand corner being under the active bit of the mouse...

actually, i think what i mean when i say centre of the widget should be made more clear....what i mean is that if we assume my widget is painted as a large-ish rectangle, this means that there is quite a large range of points where the user can click to "pick up" the widget....irrespective of this, when the user drops the widget, the drop position is always the left top corner of the widget...this can lead to some slightly unexpected behaviours....in particular if the user clicks the object and then decides not to move it, the unclick will be interpreted as a drop event and the widget will shift so that the top left corner is now where previously some arbitrary point anywhere within the widget was.....

hope that makes it more clear because i don't have any of my code with me because I am at home now....
thanks =)
have a nice day

wysota
23rd May 2006, 15:31
You can store the offset from the corner of the item when starting a drag and then use that offset to recalculate the drop position.