Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to handle copy & paste with focus changing
How to handle copy & paste with focus changing [message #48457] |
Wed, 05 July 2017 11:53  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Hi all!
I have an interesting problem: I'm implementing an IDE and it is similar to TheIDE: it has CodeEditors above and error messages bellow. The error messages are displayed in a read-only LineEdit. When the user does a mouse up on the LineEdit, the error around the cursor is parsed and the CodeEditor get's placed on the right line and column and receives focus so that the blinking cursor will give the sue feedback on where the error is.
Pretty standard stuff. Unfortunately, after the set focus, when selecting an error, you can no longer copy & paste from the LineEdit, since it is no longer focused.
So far the only partial solution I found is to exist the error message parse when there is a selection active in the linedit:
if (console.GetSelection().GetLength() != 0)
return;
Is there a more elegant solution to redirect the focus for copy & paste?
Thanks!
|
|
|
Re: How to handle copy & paste with focus changing [message #48461 is a reply to message #48457] |
Wed, 05 July 2017 14:13  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Wed, 05 July 2017 11:53Hi all!
I have an interesting problem: I'm implementing an IDE and it is similar to TheIDE: it has CodeEditors above and error messages bellow. The error messages are displayed in a read-only LineEdit. When the user does a mouse up on the LineEdit, the error around the cursor is parsed and the CodeEditor get's placed on the right line and column and receives focus so that the blinking cursor will give the sue feedback on where the error is.
Pretty standard stuff. Unfortunately, after the set focus, when selecting an error, you can no longer copy & paste from the LineEdit, since it is no longer focused.
So far the only partial solution I found is to exist the error message parse when there is a selection active in the linedit:
if (console.GetSelection().GetLength() != 0)
return;
Is there a more elegant solution to redirect the focus for copy & paste?
Thanks!
E.g.: You can do it from TopWindow...
I mean, e.g. you use top-level Ctrl Key (or menu), copy data LineEdit::Get, the put to clipboard in your code...
Mirek
|
|
|
Goto Forum:
Current Time: Thu Apr 24 18:34:30 CEST 2025
Total time taken to generate the page: 0.02079 seconds
|