KeyWorksRW / wxUiEditor

RAD tool used to create and maintain wxWidgets UI elements.
Apache License 2.0
63 stars 7 forks source link

Replace calls to tt_string.Format(), remove Format() from the tt_string class #1349

Closed Randalphwa closed 8 months ago

Randalphwa commented 8 months ago

This PR removes the tt_string::Format() method. Now that we're building wxWidgets as a UTF8 library, the wxString class is fine for formatting strings. If __cpp_lib_format is defined, we can use std::format() instead which has the advantage of working with std::string_view, as well as providing locale-dependent number separators (e.g., 10,000 instead of 10000).

Note that while we generally require a C++20 compiler, that means gcc 12, clang 13, or MSVC version 16.10 to get std::format(). For now, it's conditionalized whenever it's used.