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 #22065 is a reply to message #22064] Tue, 16 June 2009 12:34 Go to previous messageGo to previous message
janwilmans is currently offline  janwilmans
Messages: 51
Registered: January 2007
Member

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)


This seems to fix my problem:

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

Greetings,

Jan





Jan (skyhawk)

[Updated on: Tue, 16 June 2009 14:51]

Report message to a moderator

 
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:16:19 CEST 2025

Total time taken to generate the page: 0.16268 seconds