I must admit I'm a bit confused by this... is \n really 13 in one build
style and 10 in the other? I thought \n was the same everywhere and it was
always 10? (and \r was 13)
Regards,
Kevin
----- Original Message -----
From: <anon...@sunsite.dk>
To: <wx-cvs...@lists.wxwidgets.org>
Sent: Saturday, September 25, 2004 3:47 PM
Subject: CVS: [SC] wxWindows/src/mac/carbon textctrl.cpp,1.114,1.115
> Update of /pack/cvsroots/wxwindows/wxWindows/src/mac/carbon
> In directory sunsite.dk:/tmp/cvs-serv16989/src/mac/carbon
>
> Modified Files:
> textctrl.cpp
> Log Message:
> making returns in a line to always be \n (13 in CFM (mpwnewline) and 10 in
Mach)
>
> Index: textctrl.cpp
> ===================================================================
> RCS file: /pack/cvsroots/wxwindows/wxWindows/src/mac/carbon/textctrl.cpp,v
> retrieving revision 1.114
> retrieving revision 1.115
> diff -u -b -r1.114 -r1.115
> --- textctrl.cpp 2004/09/25 05:58:56 1.114
> +++ textctrl.cpp 2004/09/25 19:47:15 1.115
> @@ -389,7 +389,10 @@
> {
> // this control draws the border itself
> if ( !HasFlag(wxNO_BORDER) )
> + {
> m_windowStyle &= ~wxSUNKEN_BORDER ;
> + bounds = wxMacGetBoundsForControl( this , pos , size ) ;
> + }
> m_peer = new wxMacMLTEClassicControl( this , str , pos , size ,
style ) ;
> }
>
> @@ -764,6 +767,7 @@
> [...90 lines suppressed...]
> @@ -2343,9 +2356,7 @@
> m_windowStyle = style ;
> Rect bounds = wxMacGetBoundsForControl( wxPeer , pos , size ) ;
> wxString st = str ;
> - wxMacConvertNewlines13To10( &st ) ;
> -
> - wxMacConvertNewlines13To10( &st ) ;
> + wxMacConvertNewlines10To13( &st ) ;
>
> short featurSet;
>
> @@ -2478,7 +2489,7 @@
> m_windowStyle = style ;
> Rect bounds = wxMacGetBoundsForControl( wxPeer , pos , size ) ;
> wxString st = str ;
> - wxMacConvertNewlines13To10( &st ) ;
> + wxMacConvertNewlines10To13( &st ) ;
>
> HIRect hr = { bounds.left , bounds.top , bounds.right - bounds.left ,
bounds.bottom- bounds.top } ;
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-cvs-diffs...@lists.wxwidgets.org
> For additional commands, e-mail: wx-cvs-d...@lists.wxwidgets.org
>
It IS confusing ;-)
The character to arrive at a new line on classic Mac was always 13, not 10,
(don't ask me why), and also in a textctrl, if you hit the return key, you
insert a 13
in the old days in order to avoid having to recode applications from other
platforms that had strings containing \n there was always the option to have
the compiler (MPW C) translate
\n -> 13
\r -> 10
This option is also available in CW (Language settings <Map newlines to CR>
in earlier version, #pragma mpwc_newline on in CW 9) Now when using gcc \n
is 10 of course.
I've now changed the precompile switch from TARGET_API_OSX to take into
account the current \n encoding to make sure that a 'newline' character in a
textctrl is always mapped to a '\n' whatever it is.
Now we have two options to avoid further problems by inconsistency between
buildstyle of the lib and the app : either make sure the lib and the app are
using the same \n encoding or just force to have \n always 10 throughout wx,
ie making sure that the pragma is always off.
Any preferences ?
Best,
Stefan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-dev-un...@lists.wxwidgets.org
> For additional commands, e-mail: wx-de...@lists.wxwidgets.org