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   |
|
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 
I don't know what other things this will break 
Greetings,
Jan
Jan (skyhawk)
[Updated on: Tue, 16 June 2009 14:51] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Aug 15 12:16:19 CEST 2025
Total time taken to generate the page: 0.16268 seconds
|