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 |
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 |
|
mirek
Messages: 13975 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
|
|
|
|
Goto Forum:
Current Time: Thu Mar 28 20:29:47 CET 2024
Total time taken to generate the page: 0.02244 seconds
|