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: Other Features Wishlist and/or Bugs » Cursor select behaviour; feature request  () 1 Vote
Re: Cursor select behaviour; feature request [message #22168 is a reply to message #22065] Sun, 21 June 2009 20:17 Go to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
skyhawk wrote on Tue, 16 June 2009 06:34

I did some debugging of theide in theide using the code-hits you gave me, Mirek:
void LineEdit::LeftDown(Point p, dword flags) {
	mpos = GetMousePos(p);
	int l, h;
	if(GetSelection(l, h) && mpos >= l && mpos < h) {
		selclick = true;
		return;
	}
	PlaceCaret(mpos, flags & K_SHIFT);
	SetWantFocus();
	SetCapture();
}


here GetSelection return false for me, in GetSelection() anchor == -1.

(for the shift-left-click behind the selection)



Yep, that is correct. The 'if' branch detects click on selection, which is handled differently (can initiate drag&drop).

It is true that there should perhaps be another K_SHIFT check (with SHIFT, D&D should not start).

Quote:


void LineEdit::LeftDown(Point p, dword flags) {
	mpos = GetMousePos(p);
	int l, h;
	GetSelection(l, h);
	if (mpos >= l) { // && mpos < h) {
		selclick = true;
		return;
	}

	PlaceCaret(mpos, flags & K_SHIFT);
	SetWantFocus();
	SetCapture();
}


because GetSelection() returns false sometimes and l = h = cursor happens then. I also had to chuck out the mpos < h check which would otherwise fail ofcourse Smile

I don't know what other things this will break Smile



D&D Smile

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I make a package a library?
Next Topic: Suggestion: cross-platform "U++ package" file type.
Goto Forum:
  


Current Time: Fri Aug 15 12:17:33 CEST 2025

Total time taken to generate the page: 0.13457 seconds