dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]RE: Patch for Review: Fix Some TextBox Issues for Single-Lin


From: Rhys Weatherley
Subject: Re: [DotGNU]RE: Patch for Review: Fix Some TextBox Issues for Single-Linefeed Lines
Date: Mon, 28 Jul 2003 15:09:22 +1000
User-agent: KMail/1.4.3

On Monday 28 July 2003 02:45 pm, Neil Cawse wrote:
> we need to be able to take an app that runs on windows and without even
> recompiling, run it on linux. We can do that today but without any gui. ms
> compatibility is useful. I do understand what you are saying - and i agree
> with the goal. The issue is when a user hits enter and we insert it into
> the text, what do we insert it as? crlf, cr, lfcr? we could end up with a
> mixture thats a mess. i think we should stick to ms standard in the textbox
> - if we are to meet our goals. It would be simple to customise textreader
> or something to make it easier to be compatible later. Rhys?

I think the best course of action is to allow CR, LF, or CRLF to be used as a 
line marker when the value is set with the Text property, but normalize 
everything to CRLF when the Text property is read.

Internally, you can represent the line marker however you like: CRLF, LF, or 
break the text into an array of strings, one per line.  As long as the 
external interface uses CRLF, the internals don't matter.  Use whatever is 
most convenient.

The rest of pnet/pnetlib is already smart enough to handle CR, LF, or CRLF 
when processing text streams, and will normalize to either CRLF or 
Environment.NewLine, depending upon the API requirements.  In this case, I 
think CRLF is probably what most users of TextBox will expect externally.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]