Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does Wings or WxWidgets filter out \r and \n from PASTE?
02-21-2017, 12:02 AM
Post: #1
Does Wings or WxWidgets filter out \r and \n from PASTE?
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.
Reply
02-21-2017, 02:35 AM
Post: #2
RE: Does Wings or WxWidgets filter out \r and \n from PASTE?
(02-21-2017 12:02 AM)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.

My Wings3D Collection at G+
Reply
02-22-2017, 08:48 PM
Post: #3
RE: Does Wings or WxWidgets filter out \r and \n from PASTE?
(02-21-2017 02:35 AM)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?
Reply
02-23-2017, 03:13 AM
Post: #4
RE: Does Wings or WxWidgets filter out \r and \n from PASTE?
"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.
Reply
02-23-2017, 07:48 AM
Post: #5
RE: Does Wings or WxWidgets filter out \r and \n from PASTE?
(02-23-2017 03:13 AM)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.

My Wings3D Collection at G+
Reply
02-23-2017, 10:49 AM
Post: #6
RE: Does Wings or WxWidgets filter out \r and \n from PASTE?
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.
Reply


Forum Jump:


User(s) browsing this thread: 1 Guest(s)