Remove most occurrences of wxT() from the docs (PR #23436)

21 views
Skip to first unread message

PB

unread,
Apr 9, 2023, 2:50:34 PM4/9/23
to wx-...@googlegroups.com, Subscribed

I have removed wxT() in most cases, leaving it only in:

  1. Where a string literal is used in wxChar* arrays in wxPropertyGrid overview (e.g., here).
  2. In wxIMAGE_OPTION_* defines.

BTW, I think the current description of wxT() may be incorrect:

@code
#ifdef UNICODE
# define wxT(x) L##x
#else // !Unicode
# define wxT(x) x
#endif
@endcode

wxWidgets removed non-UNICODE build option in 3.3 and wxChar is always defined as wchar_t (i.e., regardless of the underlying wxString char type, so even in the UTF-8 build), therefore wxT() now always adds L (unlike wxS() which adds it only if wxUSE_UNICODE_WCHAR):

wxT ("wx text") macro turns a literal string constant into a wide char
constant. It is mostly unnecessary with wx 2.9 but defined for
compatibility.
*/
#ifndef wxT
/*
Notice that we use an intermediate macro to allow x to be expanded
if it's a macro itself.
*/
#define wxT(x) wxCONCAT_HELPER(L, x)
#endif /* !defined(wxT) */

BTW2, is it not high time to deprecate or even remove wxT_2() macro, its code comment says "wxT_2 exists only for compatibility with wx 2.x"?


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/23436

Commit Summary

  • d378444 Remove most occurrences of wxT() from the docs

File Changes

(12 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23436@github.com>

VZ

unread,
Apr 10, 2023, 8:28:53 AM4/10/23
to wx-...@googlegroups.com, Subscribed

Thanks, I've updated wxT() documentation and pushed it here, please let me know if you have any comments. As for wxT_2(), it seems to be used in a few projects, so we shouldn't remove it and so I've left its documentation as well, but made it even more clear that it is obsolete now.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23436/c1501761999@github.com>

VZ

unread,
Apr 10, 2023, 8:28:56 AM4/10/23
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • 41d0313 Update wxT() documentation after ASCII build removal
  • 60dacae Make it more clear that wxT_2() is obsolete


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23436/push/13245344758@github.com>

VZ

unread,
Apr 10, 2023, 10:23:38 AM4/10/23
to wx-...@googlegroups.com, Subscribed

Merged #23436 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23436/issue_event/8964204067@github.com>

PB

unread,
Apr 10, 2023, 10:23:44 AM4/10/23
to wx-...@googlegroups.com, Subscribed

Thanks, I have no comments.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/23436/c1501874842@github.com>

Reply all
Reply to author
Forward
0 new messages