Wings 3D Development Forum
Does Wings or WxWidgets filter out \r and \n from PASTE? - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=9)
+--- Thread: Does Wings or WxWidgets filter out \r and \n from PASTE? (/showthread.php?tid=2412)



Does Wings or WxWidgets filter out \r and \n from PASTE? - ggaliens - 02-20-2017

Does Wings or WxWidgets filter out \r and \n from PASTE?

I'm trying to paste into a wide text control in WINGS ...
pasting from a spread-sheet column of numbers using CUT/PASTE.


I only get the first CELL of data . I could like to get all the cells.

Maybe there is a place in the code I can look that would control this behavior.


RE: Does Wings or WxWidgets filter out \r and \n from PASTE? - micheus - 02-20-2017

(02-20-2017, 02:02 PM)ggaliens Wrote: I'm trying to paste into a wide text control in WINGS ...
pasting from a spread-sheet column of numbers using CUT/PASTE.

I only get the first CELL of data . I could like to get all the cells.
As know, that is the usual behaviour in Windows.
In a single line control, if we try to past multiple lines then only the first one is "accepted". That you want just works only for multiple line controls.

At the Windows' API documentation for Edit Controls Style we see that ENTER isn't managed by single-line controls:
Quote:ES_WANTRETURN
Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control;
...
ES_MULTILINE
Designates a multiline edit control. The default is single-line edit control.

When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the ES_WANTRETURN style;

and specifically for wxWidgets - wxTextCtrl:
Quote:wxTE_PROCESS_ENTER:
The control will generate the event wxEVT_TEXT_ENTER (otherwise pressing Enter key is either processed internally by the control or used to activate the default button of the dialog, if any);
...
wxTE_MULTILINE:
The text control allows multiple lines. If this style is not specified, line break characters should not be used in the controls value.
Basically the same thing.

As Wings3D doesn't have any need for multiple line controls they doesn't exists in wings_dialog.erl module (1386 and 1464).
So, probably you will need to manage the clipboard by your self. Maybe adding a button to do that using the wxClipboard class. Just an idea.


Maybe dgud could bring more details.


RE: Does Wings or WxWidgets filter out \r and \n from PASTE? - nemyax - 02-22-2017

(02-20-2017, 04:35 PM)micheus Wrote: As Wings3D doesn't have any need for multiple line controls they doesn't exists in wings_dialog.erl module (1386 and 1464).
I'd sure find a use for multi-line text boxes in my RenderMan exporter =)
Could you add support for them?


RE: Does Wings or WxWidgets filter out \r and \n from PASTE? - ggaliens - 02-22-2017

"As know, that is the usual behaviour in Windows."

Not from having checked a few applications on my desktop. They seemed to replace
\r \n with spaces ... or just pasted them into the field and let chips fall where they may.

These app did not just accept only the first item and then bail remove the remainder.


RE: Does Wings or WxWidgets filter out \r and \n from PASTE? - micheus - 02-22-2017

(02-22-2017, 05:13 PM)ggaliens Wrote: "As know, that is the usual behaviour in Windows."

Not from having checked a few applications on my desktop.
Just to best explain my words: dialogs that uses single line controls tend to ignore extra lines. For example, in some MS apps a text control used for search content do that. check MS Word, Wordpad, Notepad and Start menu->Search Bar. Also, the Calc will past the last row value only.

I think that if the app doesn't intend to manage/accept multiple content in a single line control, it will work that way - and it's the logical way for me. You probably was testing apps in which that is expected/accepted.


RE: Does Wings or WxWidgets filter out \r and \n from PASTE? - ggaliens - 02-23-2017

OK ... maybe microsoft text control is conspiring against me.

It is true. I tried several other "controls" ... that appears as single line ...
like search bars and such. They all worked the way I wanted ... but they might not be MFC
or microsoft plain-old control.