X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b21126db7a8232fa9e64b29f916d73d6b0153bef..d676fb218d4c043fd852842dbaf620c7b9ebcf08:/interface/wx/chartype.h diff --git a/interface/wx/chartype.h b/interface/wx/chartype.h index d9c3e9c895..5f380cba21 100644 --- a/interface/wx/chartype.h +++ b/interface/wx/chartype.h @@ -3,7 +3,7 @@ // Purpose: interface of global functions // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @addtogroup group_funcmacro_string */ @@ -15,16 +15,16 @@ builds of wxWidgets. This macro simply returns the value passed to it without changes in ASCII build. In fact, its definition is: -@code -#ifdef UNICODE -# define wxT(x) L##x -#else // !Unicode -# define wxT(x) x -#endif -@endcode + @code + #ifdef UNICODE + # define wxT(x) L##x + #else // !Unicode + # define wxT(x) x + #endif + @endcode Note that since wxWidgets 2.9.0 you shouldn't use wxT() anymore in your - program sources if you want to support Unicode. + program sources (it was previously required if you wanted to support Unicode). @see @ref overview_unicode, wxS() @@ -32,6 +32,32 @@ */ #define wxT(string) +/** + Compatibility macro which expands to wxT() in wxWidgets 2 only. + + This macro can be used in the code which needs to compile with both + wxWidgets 2 and 3 versions in places where v2 API requires a Unicode string + (in Unicode build) and v3 API only accepts a standard narrow + string as in e.g. wxCmdLineEntryDesc structure objects initializers. + + Example of use: + @code + const wxCmdLineEntryDesc cmdLineDesc[] = + { + { wxCMD_LINE_SWITCH, wxT_2("q"), wxT_2("quiet"), + wxT_2("Don't output verbose messages") }, + wxCMD_LINE_DESC_END + }; + @endcode + + Without @c wxT_2 the code above wouldn't compile with wxWidgets 2, with @c + wxT instead of it, it wouldn't compile with wxWidgets 3. + + @see wxT() + + @header{wx/chartype.h} + */ + /** wxS is macro which can be used with character and string literals (in other words, @c 'x' or @c "foo") to either convert them to wide characters or wide strings @@ -60,6 +86,11 @@ Don't confuse this macro with _()! + Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like + for wxT() and also that this macro may conflict with identifiers defined in + standard headers of some compilers (such as Sun CC) so its use should + really be avoided. + @header{wx/chartype.h} */ #define _T(string)