Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Cursor select behaviour; feature request 
 ( ) 1 Vote
	
		
		
			| Cursor select behaviour; feature request [message #21858] | 
			Mon, 08 June 2009 14:29   | 
		 
		
			| 
				
	 | 
 
	
		When I put the cursor at, for example, the start of a word, hold shift and left-click on a new location, I would expect to select the text in between? 
 
Apparently this is not TheIde's behaviour;  
 
Feature require: add this behaviour  
 
(to test, try gedit on linux or notepad on windows, or even any text field in any browser) 
 
Greetings, 
 
Jan
		
		
  Jan (skyhawk)
		[Updated on: Mon, 08 June 2009 14:45] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: Cursor select behaviour; feature request [message #22057 is a reply to message #22051] | 
			Mon, 15 June 2009 23:44    | 
		 
		
			
				
				
				
					
						  
						andrei_natanael
						 Messages: 262 Registered: January 2009 
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi, i have also a nvidia card on my laptop (not on AGP   ) but i'm not having any problem with text selection. Maybe an upgrade will solve your problem    
 
| info |   01:00.0 VGA compatible controller: nVidia Corporation GeForce 9300M GS (rev a1) 
        Subsystem: Acer Incorporated [ALI] Device 015e 
        Flags: bus master, fast devsel, latency 0, IRQ 16 
        Memory at ce000000 (32-bit, non-prefetchable) [size=16M] 
        Memory at d0000000 (64-bit, prefetchable) [size=256M] 
        Memory at cc000000 (64-bit, non-prefetchable) [size=32M] 
        I/O ports at 2000 [size=128] 
        Capabilities: [60] Power Management version 3 
        Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable- 
        Capabilities: [78] Express Endpoint, MSI 00 
        Capabilities: [100] Virtual Channel <?> 
        Capabilities: [128] Power Budgeting <?> 
        Capabilities: [600] Vendor Specific Information <?> 
        Kernel driver in use: nvidia 
        Kernel modules: nvidia, nvidiafb
  |   
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: Cursor select behaviour; feature request [message #22058 is a reply to message #22057] | 
			Tue, 16 June 2009 09:17    | 
		 
		
			| 
				
	 | 
 
	
		An upgrade would probably mask the problem alright, but since it is not just a visual effect and it does not happen in other programs except TheIde, it still looks like a genuine bug to me. How to catch it, I don't know   
 
lspci -v reports: (this is an AGP card though) 
 
02:00.0 VGA compatible controller: nVidia Corporation G70 [GeForce 7300 GT] (rev a1) (prog-if 00 [VGA controller]) 
	Subsystem: Foxconn International, Inc. Unknown device 0f0c 
	Flags: bus master, fast devsel, latency 0, IRQ 23 
	Memory at f6000000 (32-bit, non-prefetchable) [size=16M] 
	Memory at c0000000 (64-bit, prefetchable) [size=256M] 
	Memory at f5000000 (64-bit, non-prefetchable) [size=16M] 
	I/O ports at cc00 [size=128] 
	[virtual] Expansion ROM at f7de0000 [disabled] [size=128K] 
	Capabilities: [60] Power Management version 2 
	Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable- 
	Capabilities: [78] Express Endpoint IRQ 0 
 
Here I have performed the same 'place cursor', 'move mouse', 'shift+left-click' action on TheIde and gedit. 
 
(jan: [edit]: it said 'shift+right-click here, but that was wrong, left-click gets this effect for me) 
 
  
 
Gr, 
 
Jan 
		
		
  Jan (skyhawk)
		[Updated on: Tue, 16 June 2009 11:58] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: Cursor select behaviour; feature request [message #22063 is a reply to message #22058] | 
			Tue, 16 June 2009 11:25    | 
		 
		
			
				
				
				
					
						  
						Sender Ghost
						 Messages: 301 Registered: November 2008 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		| skyhawk wrote on Tue, 16 June 2009 09:17 |  
  
Here I have performed the same 'place cursor', 'move mouse', 'shift+right-click' action on TheIde and gedit. 
 
  
 
Gr, 
 
Jan 
  |  
  
Hello, Jan. 
 
In the first post on this topic you said about left mouse click instead of right mouse click. I guess, you think of EditField behaviour (CtrlLib/EditField.cpp): 
void EditField::RightDown(Point p, dword keyflags)
{
	keep_selection = true;
	MenuBar::Execute(THISBACK(MenuBar));
	SetFocus();
	keep_selection = false;
}
 
The AssistEditor have LineEdit behaviour (CtrlLib/LineEdit.cpp): 
void LineEdit::RightDown(Point p, dword flags)
{
	mpos = GetMousePos(p);
	SetWantFocus();
	int l, h;
	if(!GetSelection(l, h) || mpos < l || mpos >= h)
		PlaceCaret(mpos, false);
	MenuBar::Execute(WhenBar);
}
 
The fix maybe as follows (also for DocEdit): 
void LineEdit::RightDown(Point p, dword flags)
{
	mpos = GetMousePos(p);
	MenuBar::Execute(WhenBar);
	SetWantFocus();
	int l, h;
	if(!GetSelection(l, h) || mpos < l || mpos >= h)
		PlaceCaret(mpos, false);
}
 
		
		
		[Updated on: Tue, 16 June 2009 11:28] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	
		
		
			| 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  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	
		
		
			| Re: Cursor select behaviour; feature request [message #22168 is a reply to message #22065] | 
			Sun, 21 June 2009 20:17   | 
		 
		
			
				
				
				  | 
					
						  
						mirek
						 Messages: 14271 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   
 
I don't know what other things this will break   
  |  
  
 
D&D   
 
Mirek
		
		
		
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 11:46:49 CET 2025 
 Total time taken to generate the page: 0.09319 seconds 
 |