Disabled cursor appearing on drag [message #181134] |
Thu, 12 May 2005 20:43 |
Eclipse User |
|
|
|
Originally posted by: ndrew.thoughtworks.com
Hi - I'm trying to work out the best way of allowing small moves of a child
edit part with the mouse.
When I drag an edit part, and the mouse is still within the bounds of the
editpart figure, the DragEditPartsTracker is providing a disabled cursor. I
think this is due to the editpart figure being part of the exclusion list
for the trackers.
What's the best way of allowing the move?
Cheers
|
|
|
|
Re: Disabled cursor appearing on drag [message #181251 is a reply to message #181169] |
Fri, 13 May 2005 09:25 |
Eclipse User |
|
|
|
Originally posted by: ndrew.thoughtworks.com
Thanks Pratik
I don't think thats what is causing it, however.
I should have explained what I mean by small move...
If I click and drag, as soon as the cursor leaves the bounds of the original
edit part, the cursor changes from disabled (SharedCursors.NO) to a normal
drag move cursor. Upon moving the cursor back into the original editpart,
it switches back to the SharedCursors.NO.
So I can move my edit part a small way if I click, say, near the left
border of the part and drag left, but that isn't very intuitive.
I've understood only little bits of the big picture. As it turns out I've
just got it work by creating a subclass of DragEditPartsTracker for my child
editpart. This overrides the isMove operation. By default
DragEditPartsTracker.isMove() doesn't include the sourceEditPart as a move
target (it starts at the sourceEditPart's parent). In my impl it does
include the sourceedit part.
As I said, this gets the move to work, but it seems a little clunky.
"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d613v9$qbo$1@news.eclipse.org...
> That's the drag threshold. To prevent mistaken dragging from affecting
> anything, drag is only enabled once it goes past a certain threshold (five
> pixels, I think). Look at AbstractTool#movedPastThreshold(). You can
> override that method to change the threshold or ignore it completely.
>
> "Nick Drew" <ndrew@thoughtworks.com> wrote in message
> news:d60fmo$793$1@news.eclipse.org...
>> Hi - I'm trying to work out the best way of allowing small moves of a
> child
>> edit part with the mouse.
>>
>> When I drag an edit part, and the mouse is still within the bounds of the
>> editpart figure, the DragEditPartsTracker is providing a disabled cursor.
> I
>> think this is due to the editpart figure being part of the exclusion list
>> for the trackers.
>>
>> What's the best way of allowing the move?
>>
>> Cheers
>>
>>
>
>
|
|
|
Re: Disabled cursor appearing on drag [message #181607 is a reply to message #181251] |
Wed, 18 May 2005 02:34 |
Pratik Shah Messages: 1077 Registered: July 2009 |
Senior Member |
|
|
That's weird. You shouldn't have to do that. In fact, doing what you
describe could cause the exact problem that you're trying to fix. That's
why it's surprising that it fixes that case for you. When dragging a part,
the source editpart cannot be the target because it doesn't contain itself
and can't be added to itself. As a result, the tool would then target any
other part that also contains that location (namely the source editpart's
parent part). Look at the Shapes example to see how this works.
"Nick Drew" <ndrew@thoughtworks.com> wrote in message
news:d61sa8$hc3$1@news.eclipse.org...
> Thanks Pratik
>
> I don't think thats what is causing it, however.
>
> I should have explained what I mean by small move...
>
> If I click and drag, as soon as the cursor leaves the bounds of the
> original edit part, the cursor changes from disabled (SharedCursors.NO) to
> a normal drag move cursor. Upon moving the cursor back into the original
> editpart, it switches back to the SharedCursors.NO.
>
> So I can move my edit part a small way if I click, say, near the left
> border of the part and drag left, but that isn't very intuitive.
>
> I've understood only little bits of the big picture. As it turns out I've
> just got it work by creating a subclass of DragEditPartsTracker for my
> child editpart. This overrides the isMove operation. By default
> DragEditPartsTracker.isMove() doesn't include the sourceEditPart as a move
> target (it starts at the sourceEditPart's parent). In my impl it does
> include the sourceedit part.
>
> As I said, this gets the move to work, but it seems a little clunky.
>
>
> "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> news:d613v9$qbo$1@news.eclipse.org...
>> That's the drag threshold. To prevent mistaken dragging from affecting
>> anything, drag is only enabled once it goes past a certain threshold
>> (five
>> pixels, I think). Look at AbstractTool#movedPastThreshold(). You can
>> override that method to change the threshold or ignore it completely.
>>
>> "Nick Drew" <ndrew@thoughtworks.com> wrote in message
>> news:d60fmo$793$1@news.eclipse.org...
>>> Hi - I'm trying to work out the best way of allowing small moves of a
>> child
>>> edit part with the mouse.
>>>
>>> When I drag an edit part, and the mouse is still within the bounds of
>>> the
>>> editpart figure, the DragEditPartsTracker is providing a disabled
>>> cursor.
>> I
>>> think this is due to the editpart figure being part of the exclusion
>>> list
>>> for the trackers.
>>>
>>> What's the best way of allowing the move?
>>>
>>> Cheers
>>>
>>>
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04308 seconds