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++ 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 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1405
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 Go to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 05 July 2017 11:53
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!


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
Previous Topic: how to catch CodeEditor keys?
Next Topic: X11 middle mouse copy paste in own widget [SOLVED]
Goto Forum:
  


Current Time: Sat Jun 15 04:12:45 CEST 2024

Total time taken to generate the page: 0.01359 seconds