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
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 previous message
mirek is currently offline  mirek
Messages: 14267
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
 
Read Message
Read Message
Read Message
Previous Topic: BUG: DocEdit: undo/redo works on ReadOnly DocEdit
Next Topic: DropList bug when compiling with SPEED option
Goto Forum:
  


Current Time: Mon Aug 25 04:35:30 CEST 2025

Total time taken to generate the page: 0.04806 seconds