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 » LineEdit, EditFields, DocEdit » Copy from a readonly EditField
Copy from a readonly EditField [message #26334] Mon, 26 April 2010 00:20 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
Hi,
I would like to copy the selected text from a read-only EditField to the clipboard. The current keyboard handling routine only allows copy from an editable EditField.

Please add the below lines to EditField::Key(dword key, int rep), before the points where it returns if the field is non-editable (line 828 in my version):
	case K_CTRL_C:
	case K_CTRL_INSERT:
		Copy();
		return true;


Thanks,
Sandor
Re: Copy from a readonly EditField [message #26593 is a reply to message #26334] Thu, 13 May 2010 22:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
hojtsy wrote on Sun, 25 April 2010 18:20

Hi,
I would like to copy the selected text from a read-only EditField to the clipboard. The current keyboard handling routine only allows copy from an editable EditField.

Please add the below lines to EditField::Key(dword key, int rep), before the points where it returns if the field is non-editable (line 828 in my version):
	case K_CTRL_C:
	case K_CTRL_INSERT:
		Copy();
		return true;


Thanks,
Sandor


Weird, I have just tested and it works without this patch.

See the line 830:

	if(!IsEditable())
		return MenuBar::Scan(WhenBar, key);


-> this reroutes the key of ReadOnly editfield to the menubar processing, where it gets recognized by line 777:

	menu.Add(IsSelection(), t_("Copy"), CtrlImg::copy(), THISBACK(Copy))
		.Key(K_CTRL_INSERT)
		.Key(K_CTRL_C);


The only possibility how this does not work is when you have replaced the toolbar by setting EditField::WhenBar (you might want to call StdBar in your bar routine in that case to fix it).

Mirek
Re: Copy from a readonly EditField [message #26594 is a reply to message #26334] Fri, 14 May 2010 00:15 Go to previous message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I have checked again, and you are right. Sorry, I don't know what have I overlooked earlier. Thanks for the attention.
- Sandor
Previous Topic: BUG: DocEdit: undo/redo works on ReadOnly DocEdit
Next Topic: DropList bug when compiling with SPEED option
Goto Forum:
  


Current Time: Fri Oct 22 20:34:20 CEST 2021

Total time taken to generate the page: 0.01206 seconds