Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » Please bring back drag'n'drop copy
Re: Please bring back drag'n'drop copy [message #21238 is a reply to message #21237] Sun, 10 May 2009 17:48 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Mirek, there are no visual artifacts, this is a capture program bug. It minimizes complex cursor and it looks bad on video, but on screen it is displayed correctly.
Re: Please bring back drag'n'drop copy [message #21239 is a reply to message #21238] Sun, 10 May 2009 18:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 10 May 2009 11:48

Mirek, there are no visual artifacts, this is a capture program bug. It minimizes complex cursor and it looks bad on video, but on screen it is displayed correctly.


So what is that garbage instead of text moved?

Mirek
Re: Please bring back drag'n'drop copy [message #21240 is a reply to message #21236] Sun, 10 May 2009 18:26 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

luzr wrote on Sun, 10 May 2009 19:41

1. Well, if you do this in this sequence, releasing Ctrl before left mouse button, it would not (and should not) work in any "conforming" Win32 app: operation is finished by releasing mouse button and actual Ctrl status at this point is what is relevant.

Actually I tried both ways (release Ctrl -> release mouse, release mouse -> release Ctrl) and the result was the same. Actually problems begin before this: as I`ve written above, pushing Ctrl then dragging text, doesn`t always lead to start of cloning process (you could see this on video).
Re: Please bring back drag'n'drop copy [message #21241 is a reply to message #21240] Sun, 10 May 2009 18:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, first of all, I am missing correct visual feedback. That makes it a bit confusing Smile

Therefore I wanted to resolve that first, if only to see when you press Ctrl (then I should see [+]). There is no sign of [+] never, so I suspect something is wrong with Icon....

Mirek
Re: Please bring back drag'n'drop copy [message #21242 is a reply to message #21241] Sun, 10 May 2009 19:04 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

http://www.youtube.com/watch?v=nY82enBpAnA
each time I press Ctrl before start dragging. And releasing Ctrl sometimes after / sometimes befor mouse button released - to test both cases.
Re: Please bring back drag'n'drop copy [message #21244 is a reply to message #21242] Sun, 10 May 2009 19:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, I almost apologize to ask... Smile

If you press Ctrl after you start the drag, everything is OK?

If you press Ctrl before you start the drag, the result is move or copy or nothing?

If you do not press Ctrl, move is performed?

Mirek
Re: Please bring back drag'n'drop copy [message #21249 is a reply to message #21244] Sun, 10 May 2009 21:21 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

1. Yes.
2. Yes (it looks like the result is somehow connected with lag, because sometimes it passes lag before anything changed - you`ve seen that on video).
3. Yes.
Re: Please bring back drag'n'drop copy [message #21253 is a reply to message #21249] Sun, 10 May 2009 22:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 10 May 2009 15:21

1. Yes.
2. Yes (it looks like the result is somehow connected with lag, because sometimes it passes lag before anything changed - you`ve seen that on video).
3. Yes.


Does repley 2. mean that the result is random ?

Mirek
Re: Please bring back drag'n'drop copy [message #21257 is a reply to message #21253] Sun, 10 May 2009 23:21 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Definitely, yes.
Re: Please bring back drag'n'drop copy [message #21265 is a reply to message #21257] Mon, 11 May 2009 11:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am sorry, I have to ask again:)

Without Ctrl, result is 100% predictable and it is move.

With Ctrl, result is random.

(I just cannot believe that... Smile

Anyway, some DUMPs:

void UDropTarget::DnD(POINTL pl, bool drop, DWORD *effect, DWORD keys)
{
	dword e = *effect;
        LOG("DnD " << e == DROPEFFECT_COPY);
	*effect = DROPEFFECT_NONE;
	if(!ctrl)
		return;
	PasteClip d;
	d.dt = this;
	d.paste = drop;
	d.accepted = false;
	d.allowed = 0;
	d.action = 0;
	if(e & DROPEFFECT_COPY) {
		d.allowed = DND_COPY;
		d.action = DND_COPY;
	}
	if(e & DROPEFFECT_MOVE) {
		d.allowed |= DND_MOVE;
		if(Ctrl::GetDragAndDropSource())
			d.action = DND_MOVE;
	}
	if((keys & MK_CONTROL) && (d.allowed & DND_COPY))
		d.action = DND_COPY;
	if((keys & (MK_ALT|MK_SHIFT)) && (d.allowed & DND_MOVE))
		d.action = DND_MOVE;
	ctrl->DnD(Point(pl.x, pl.y), d);
        DDUMP(d.action);
	if(d.IsAccepted()) {
		if(d.action == DND_MOVE)
			*effect = DROPEFFECT_MOVE;
		if(d.action == DND_COPY)
			*effect = DROPEFFECT_COPY;
	}
}

STDMETHODIMP UDropSource::GiveFeedback(DWORD dwEffect)
{
LOG("GiveFeedback " << (dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY);
	Image m = IsNull(move) ? copy : move;
	if((dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY) {
		if(!IsNull(copy)) m = copy;
	}
	else
	if((dwEffect & DROPEFFECT_MOVE) == DROPEFFECT_MOVE) {
		if(!IsNull(move)) m = move;
	}
	else
		m = no;
	Ctrl::OverrideCursor(m);
	Ctrl::SetMouseCursor(m);
	return S_OK;
}


Try with Ctrl pushed....

Mirek
Re: Please bring back drag'n'drop copy [message #21266 is a reply to message #21265] Mon, 11 May 2009 12:41 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

And again Very Happy
> Without Ctrl, result is 100% predictable and it is move
YES!

>With Ctrl, result is random
Ctrl->drag = YES! (You`ve seen that on video, what a shame it doesn`t indicate pressed keys)
drag->Ctrl = WORKS 100%
So the problem is with initial period when Ctrl is ALREADY pressed before dragging start.

Your patch doesn`t compile (I patched Win32DnD.cpp):

> LOG("DnD " << e == DROPEFFECT_COPY);
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Upp::Stream' (or there is
no acceptable conversion)


> STDMETHODIMP UDropSource::GiveFeedback(DWORD dwEffect)
error C2027: use of undefined type 'Upp::UDropSource'

> LOG("GiveFeedback " << (dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY);
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Upp::Stream' (or there is
no acceptable conversion)

... (about 5 more errors, please try to compile it)

[Updated on: Mon, 11 May 2009 12:43]

Report message to a moderator

Re: Please bring back drag'n'drop copy [message #21268 is a reply to message #21266] Mon, 11 May 2009 12:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Mon, 11 May 2009 06:41

And again Very Happy
> Without Ctrl, result is 100% predictable and it is move
YES!

>With Ctrl, result is random
Ctrl->drag = YES! (You`ve seen that on video, what a shame it doesn`t indicate pressed keys)
drag->Ctrl = WORKS 100%
So the problem is with initial period when Ctrl is ALREADY pressed before dragging start.

Your patch doesn`t compile (I patched Win32DnD.cpp):

> LOG("DnD " << e == DROPEFFECT_COPY);
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Upp::Stream' (or there is
no acceptable conversion)


> STDMETHODIMP UDropSource::GiveFeedback(DWORD dwEffect)
error C2027: use of undefined type 'Upp::UDropSource'

> LOG("GiveFeedback " << (dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY);
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'Upp::Stream' (or there is
no acceptable conversion)

... (about 5 more errors, please try to compile it)


Ah, sorry, put parenthesis around == operators please...

void UDropTarget::DnD(POINTL pl, bool drop, DWORD *effect, DWORD keys)
{
	dword e = *effect;
        LOG("DnD " << (e == DROPEFFECT_COPY));
	*effect = DROPEFFECT_NONE;
	if(!ctrl)
		return;
	PasteClip d;
	d.dt = this;
	d.paste = drop;
	d.accepted = false;
	d.allowed = 0;
	d.action = 0;
	if(e & DROPEFFECT_COPY) {
		d.allowed = DND_COPY;
		d.action = DND_COPY;
	}
	if(e & DROPEFFECT_MOVE) {
		d.allowed |= DND_MOVE;
		if(Ctrl::GetDragAndDropSource())
			d.action = DND_MOVE;
	}
        DDUMP(keys & MK_CONTROL);
	if((keys & MK_CONTROL) && (d.allowed & DND_COPY))
		d.action = DND_COPY;
	if((keys & (MK_ALT|MK_SHIFT)) && (d.allowed & DND_MOVE))
		d.action = DND_MOVE;
	ctrl->DnD(Point(pl.x, pl.y), d);
        DDUMP(d.action);
	if(d.IsAccepted()) {
		if(d.action == DND_MOVE)
			*effect = DROPEFFECT_MOVE;
		if(d.action == DND_COPY)
			*effect = DROPEFFECT_COPY;
	}
}

STDMETHODIMP UDropSource::GiveFeedback(DWORD dwEffect)
{
LOG("GiveFeedback " << ((dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY));
	Image m = IsNull(move) ? copy : move;
	if((dwEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY) {
		if(!IsNull(copy)) m = copy;
	}
	else
	if((dwEffect & DROPEFFECT_MOVE) == DROPEFFECT_MOVE) {
		if(!IsNull(move)) m = move;
	}
	else
		m = no;
	Ctrl::OverrideCursor(m);
	Ctrl::SetMouseCursor(m);
	return S_OK;
}
Re: Please bring back drag'n'drop copy [message #21285 is a reply to message #21268] Mon, 11 May 2009 18:24 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Sorry. I forgot to comment. Patch still doesn`t compile. Does it on your system?
Re: Please bring back drag'n'drop copy [message #21300 is a reply to message #21285] Tue, 12 May 2009 10:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Mon, 11 May 2009 12:24

Sorry. I forgot to comment. Patch still doesn`t compile. Does it on your system?


I have incorporated all logs into svn as optional. All you now need to do is to uncomment:

#define LLOG(x) LOG(x)

at the beginning of file.

I am interested in LOG of single DnD action that goes wrong.

(Of course, as soon as you have time, I understand your current constraints).

Mirek
Re: Please bring back drag'n'drop copy [message #21306 is a reply to message #21300] Tue, 12 May 2009 15:07 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Latest SVN build fixed that too.
Thank you!
Re: Please bring back drag'n'drop copy [message #21308 is a reply to message #21306] Tue, 12 May 2009 15:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Tue, 12 May 2009 09:07

Latest SVN build fixed that too.
Thank you!


Ehm you mean DnD now works as expected?

That would be weird... I have not done anything with it.

The only explanation is that it is somehow time-dependent, some weird sort of race condition is going on...

Mirek
Re: Please bring back drag'n'drop copy [message #21309 is a reply to message #21308] Tue, 12 May 2009 15:52 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Yes, the problem disappeared. IMO it was somehow connected with lag. So, no lag = no problem.
Re: Please bring back drag'n'drop copy [message #21313 is a reply to message #21309] Tue, 12 May 2009 16:59 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Tue, 12 May 2009 09:52

Yes, the problem disappeared. IMO it was somehow connected with lag. So, no lag = no problem.


I guess I will try to add some BIG artificial lag where it was, maybe it will reveal something interesting about DnD..

Mirek
Previous Topic: TheIDE help keyword search calls Firefox
Next Topic: Naviagot bar: 1 issue, 1 suggestion
Goto Forum:
  


Current Time: Thu Mar 28 22:27:37 CET 2024

Total time taken to generate the page: 0.01424 seconds