]> git.saurik.com Git - wxWidgets.git/commitdiff
don't use _T() inside wxGetTranslation() and related macros (wxTRANSLATE, _, ......
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Sep 2007 21:47:45 +0000 (21:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Sep 2007 21:47:45 +0000 (21:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48603 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/function.tex
src/common/accelcmn.cpp
src/common/appbase.cpp
src/common/appcmn.cpp
src/common/datetime.cpp
src/common/fmapbase.cpp
src/msw/dialup.cpp

index 392d75e83e4ee6eaf015ed10e5f7337a3800616b..4af8e40d944608ce9fddc62305044ea97a9ab95f 100644 (file)
@@ -5,6 +5,23 @@
 INCOMPATIBLE CHANGES SINCE 2.8.x
 ================================
 
 INCOMPATIBLE CHANGES SINCE 2.8.x
 ================================
 
+Unicode-related changes
+-----------------------
+
+The biggest changes in wxWidgets 3.0 are the changes due to the merge of the
+old ANSI and Unicode build modes in a single build. See the Unicode overview
+in the manual for more details but here are the most important incompatible
+changes:
+
+- Many wxWidgets functions taking "const wxChar *" have been changed to take
+  either "const wxString&" if they should accept both Unicode or ANSI strings
+  and the argument can't be NULL or "const char *" if the strings are always
+  ANSI but may be NULL.
+
+- Some structure fields have been changed from "wxChar *" to "char *" too:
+  e.g. wxCmdLineEntryDesc fields.
+
+
 Changes in behaviour not resulting in compilation errors, please read this!
 ---------------------------------------------------------------------------
 
 Changes in behaviour not resulting in compilation errors, please read this!
 ---------------------------------------------------------------------------
 
index 5d8a4e82b6338c8c3d979dde673abc9be776d51f..d47a983c0e45ca1a22c2dce4aa78775d0b221e9e 100644 (file)
@@ -1801,11 +1801,9 @@ build. In fact, its definition is:
 \func{const wxChar *}{wxTRANSLATE}{\param{const char *}{s}}
 
 This macro doesn't do anything in the program code -- it simply expands to the
 \func{const wxChar *}{wxTRANSLATE}{\param{const char *}{s}}
 
 This macro doesn't do anything in the program code -- it simply expands to the
-value of its argument (except in Unicode build where it is equivalent to
-\helpref{wxT}{wxt} which makes it unnecessary to use both wxTRANSLATE and wxT
-with the same string which would be really unreadable).
+value of its argument.
 
 
-However it does have a purpose and it is to mark the literal strings for the
+However it does have a purpose which is to mark the literal strings for the
 extraction into the message catalog created by {\tt xgettext} program. Usually
 this is achieved using \helpref{\_()}{underscore} but that macro not only marks
 the string for extraction but also expands into a
 extraction into the message catalog created by {\tt xgettext} program. Usually
 this is achieved using \helpref{\_()}{underscore} but that macro not only marks
 the string for extraction but also expands into a
@@ -1820,7 +1818,7 @@ translated (note that it is a bad example, really, as
 day names already). If you write
 
 \begin{verbatim}
 day names already). If you write
 
 \begin{verbatim}
-static const wxChar * const weekdays[] = { _("Mon"), ..., _("Sun") };
+static const char * const weekdays[] = { _("Mon"), ..., _("Sun") };
 ...
 // use weekdays[n] as usual
 \end{verbatim}
 ...
 // use weekdays[n] as usual
 \end{verbatim}
@@ -1829,7 +1827,7 @@ the code wouldn't compile because the function calls are forbidden in the array
 initializer. So instead you should do
 
 \begin{verbatim}
 initializer. So instead you should do
 
 \begin{verbatim}
-static const wxChar * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
+static const char * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
 ...
 // use wxGetTranslation(weekdays[n])
 \end{verbatim}
 ...
 // use wxGetTranslation(weekdays[n])
 \end{verbatim}
@@ -1841,6 +1839,7 @@ wxTRANSLATE() in the above, it wouldn't work as expected because there would be
 no translations for the weekday names in the program message catalog and
 wxGetTranslation wouldn't find them.
 
 no translations for the weekday names in the program message catalog and
 wxGetTranslation wouldn't find them.
 
+
 \membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
 \membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
index d524d15d0c3e68a879f3fc9e29665ca2fdf0c153..9d5898177b376666291cd87b85f730884856fe3c 100644 (file)
@@ -40,7 +40,7 @@
 static const struct wxKeyName
 {
     wxKeyCode code;
 static const struct wxKeyName
 {
     wxKeyCode code;
-    const wxChar *name;
+    const char *name;
 } wxKeyNames[] =
 {
     { WXK_DELETE, wxTRANSLATE("DEL") },
 } wxKeyNames[] =
 {
     { WXK_DELETE, wxTRANSLATE("DEL") },
@@ -114,7 +114,7 @@ static const struct wxKeyName
 //
 // as accels can be either translated or not, check for both possibilities and
 // also compare case-insensitively as the key names case doesn't count
 //
 // as accels can be either translated or not, check for both possibilities and
 // also compare case-insensitively as the key names case doesn't count
-static inline bool CompareAccelString(const wxString& str, const wxChar *accel)
+static inline bool CompareAccelString(const wxString& str, const char *accel)
 {
     return str.CmpNoCase(accel) == 0
 #if wxUSE_INTL
 {
     return str.CmpNoCase(accel) == 0
 #if wxUSE_INTL
@@ -128,7 +128,7 @@ static inline bool CompareAccelString(const wxString& str, const wxChar *accel)
 //
 // first and last parameter specify the valid domain for "number" part
 static int IsNumberedAccelKey(const wxString& str,
 //
 // first and last parameter specify the valid domain for "number" part
 static int IsNumberedAccelKey(const wxString& str,
-                              const wxChar *prefix,
+                              const char *prefix,
                               wxKeyCode prefixCode,
                               unsigned first,
                               unsigned last)
                               wxKeyCode prefixCode,
                               unsigned first,
                               unsigned last)
index 08b769724b6fba39bc2ef1d8b82d3f98b37d68dc..8e819f62d1ca79cdc589f758312e19647c3d8204 100644 (file)
@@ -466,7 +466,7 @@ bool wxAppConsoleBase::OnExceptionInMainLoop()
 
 #if wxUSE_CMDLINE_PARSER
 
 
 #if wxUSE_CMDLINE_PARSER
 
-#define OPTION_VERBOSE _T("verbose")
+#define OPTION_VERBOSE "verbose"
 
 void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 {
 
 void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 {
@@ -475,8 +475,8 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
     {
         {
             wxCMD_LINE_SWITCH,
     {
         {
             wxCMD_LINE_SWITCH,
-            _T("h"),
-            _T("help"),
+            "h",
+            "help",
             gettext_noop("show this help message"),
             wxCMD_LINE_VAL_NONE,
             wxCMD_LINE_OPTION_HELP
             gettext_noop("show this help message"),
             wxCMD_LINE_VAL_NONE,
             wxCMD_LINE_OPTION_HELP
@@ -485,7 +485,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 #if wxUSE_LOG
         {
             wxCMD_LINE_SWITCH,
 #if wxUSE_LOG
         {
             wxCMD_LINE_SWITCH,
-            wxEmptyString,
+            "",
             OPTION_VERBOSE,
             gettext_noop("generate verbose log messages"),
             wxCMD_LINE_VAL_NONE,
             OPTION_VERBOSE,
             gettext_noop("generate verbose log messages"),
             wxCMD_LINE_VAL_NONE,
@@ -496,9 +496,9 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
         // terminator
         {
             wxCMD_LINE_NONE,
         // terminator
         {
             wxCMD_LINE_NONE,
-            wxEmptyString,
-            wxEmptyString,
-            wxEmptyString,
+            "",
+            "",
+            "",
             wxCMD_LINE_VAL_NONE,
             0x0
         }
             wxCMD_LINE_VAL_NONE,
             0x0
         }
index e25528a638ccc786f71d14b96e4d0893604efd08..421fff4699f8cb6814eedf8f309f554bc71460ed 100644 (file)
@@ -203,7 +203,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
 #ifdef __WXUNIVERSAL__
         {
             wxCMD_LINE_OPTION,
 #ifdef __WXUNIVERSAL__
         {
             wxCMD_LINE_OPTION,
-            wxEmptyString,
+            "",
             OPTION_THEME,
             gettext_noop("specify the theme to use"),
             wxCMD_LINE_VAL_STRING,
             OPTION_THEME,
             gettext_noop("specify the theme to use"),
             wxCMD_LINE_VAL_STRING,
@@ -217,7 +217,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
         //     and not mgl/app.cpp
         {
             wxCMD_LINE_OPTION,
         //     and not mgl/app.cpp
         {
             wxCMD_LINE_OPTION,
-            wxEmptyString,
+            "",
             OPTION_MODE,
             gettext_noop("specify display mode to use (e.g. 640x480-16)"),
             wxCMD_LINE_VAL_STRING,
             OPTION_MODE,
             gettext_noop("specify display mode to use (e.g. 640x480-16)"),
             wxCMD_LINE_VAL_STRING,
@@ -228,9 +228,9 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser)
         // terminator
         {
             wxCMD_LINE_NONE,
         // terminator
         {
             wxCMD_LINE_NONE,
-            wxEmptyString,
-            wxEmptyString,
-            wxEmptyString,
+            "",
+            "",
+            "",
             wxCMD_LINE_VAL_NONE,
             0x0
         }
             wxCMD_LINE_VAL_NONE,
             0x0
         }
index 2697859c644e5bf25f8c5daf84896e421cee79e0..026bae109dfa161ea162021cf4518a8e65bd6414 100644 (file)
@@ -3835,7 +3835,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
     // some special cases
     static struct
     {
     // some special cases
     static struct
     {
-        const wxChar *str;
+        const char *str;
         int dayDiffFromToday;
     } literalDates[] =
     {
         int dayDiffFromToday;
     } literalDates[] =
     {
@@ -4010,7 +4010,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
                 else // not a valid weekday name
                 {
                     // try the ordinals
                 else // not a valid weekday name
                 {
                     // try the ordinals
-                    static const wxChar *ordinals[] =
+                    static const char *ordinals[] =
                     {
                         wxTRANSLATE("first"),
                         wxTRANSLATE("second"),
                     {
                         wxTRANSLATE("first"),
                         wxTRANSLATE("second"),
@@ -4176,7 +4176,7 @@ const wxChar *wxDateTime::ParseTime(const wxChar *time)
     // first try some extra things
     static const struct
     {
     // first try some extra things
     static const struct
     {
-        const wxChar *name;
+        const char *name;
         wxDateTime_t  hour;
     } stdTimes[] =
     {
         wxDateTime_t  hour;
     } stdTimes[] =
     {
index 20e1f3c3be854edd1e5dc1bf1f39b1a272644f6d..eb6fe9843f24f9373b919c645110bc0f0f2af149 100644 (file)
@@ -103,7 +103,7 @@ static wxFontEncoding gs_encodings[] =
 };
 
 // the descriptions for them
 };
 
 // the descriptions for them
-static const wxChar* gs_encodingDescs[] =
+static const char* gs_encodingDescs[] =
 {
     wxTRANSLATE( "Western European (ISO-8859-1)" ),
     wxTRANSLATE( "Central European (ISO-8859-2)" ),
 {
     wxTRANSLATE( "Western European (ISO-8859-1)" ),
     wxTRANSLATE( "Central European (ISO-8859-2)" ),
index 9e7eeda8cfba628e6bb38caa320823c40af07e59..cce425e0569dfdd7f05ef50ee33f931d10cd09c9 100644 (file)
@@ -452,12 +452,10 @@ wxDialUpManagerMSW::wxDialUpManagerMSW()
 exit:
         if ( funcName )
         {
 exit:
         if ( funcName )
         {
-            static const wxChar *msg = wxTRANSLATE(
-"The version of remote access service (RAS) installed on this machine is too\
-old, please upgrade (the following required function is missing: %s)."
-                                                   );
-
-            wxLogError(wxGetTranslation(msg), funcName);
+            wxLogError(_("The version of remote access service (RAS) installed "
+                          "on this machine is too old, please upgrade (the "
+                          "following required function is missing: %s)."),
+                       funcName);
             m_dllRas.Unload();
             return;
         }
             m_dllRas.Unload();
             return;
         }