On non-Linux-like systems the `_NL_*` symbols for retrieving localized
strings from a locale are typically not available, causing compile-time
errors.
We now check for Linux-like systems, and resort to accessing our own
language database otherwise.
Closes#22558.
CMake: Create a config file for use with find_package and use it for
building our own sample, as the config file has the advantage of working
with wx 3.2.0 too, unlike the existing FindwxWidgets.cmake.
See #22536.
This worked until 7e9afad53a (Add real support for monochrome bitmaps to
wxMSW, 2020-10-19) because we always created the DIB of the depth
matching the alpha presence, i.e. 32bpp only if alpha was used and 24bpp
otherwise, but since this change we can use different depths, and hence
different number of bytes per pixel, for the source and destination
pixel data and so need to account for it.
An alternative fix could be to still create 24bpp DIBs even when depth
of 32 is explicitly requested, as it was done before, but it's probably
better to respect the explicitly specified depth, even if, admittedly,
it's not really clear what, if any, effect does this have in practice.
See #22552.
Closes#22548.
These functions returned strings of wrong size, with some junk after the
end of the actual string, due to a confusion between the size of the
buffer in bytes used by the WinHTTP functions and the length of the
buffer in (wide) characters used by wxWCharBuffer.
Fix this and add a unit test checking that the expected header is
returned.
See #22549.
Closes#22181.
Make wxINVERT logical function work in at least some circumstances with
wxGTK3/X11 and use this to make wxSplitterWindow and wxSashWindow
separator visible during resizing.
See #22546.
Closes#16890.
HasAlpha() was already available in most of them, now ensure that it's
present in all of them, especially as it has a reasonable default
implementation.
UseAlpha() was only present in wxMSW and wxOSX and still remains only
implemented there, but provide at least a stub for it elsewhere as well
to avoid problems such as that of #17393.
See #22545.
Closes#17397.
If _NL_LOCALE_NAME is unavailable, set the locale name to some non-empty
string to make it at least somewhat useful -- and to avoid calling
InitLocaleNameAndCodeset() again and again.
Create a reusable function that can be used not only in
GetPreferredUILanguages() itself.
No real changes yet.
This commit is best viewed with Git --color-moved option.
We don't need to store this string, we don't need it after the ctor.
Also change the default value of an argument of wxString reference type
to be a wxString, not a const char*.
Don't attempt to optimize handling of the default and "C" locales as
this just results in bugs when using them and always use a valid
m_locale when extended locale support is available at all.
This symbol is not portable, so check for its availability before using
it.
Also avoid using wxLocaleIdent::GetName() uselessly if we're going to
overwrite it anyhow.
Use TempDefautLocaleSetter helper to change the locale if necessary and
just use our own m_locale if extended locale support is available. This
allows to reuse the existing GetLangInfo() function instead of
duplicating it here.
No real changes.
It doesn't seem necessary to always initialize them when the locale is
created, especially considering that this may have side effects if we
have to change the global locale to do it.
No real changes yet.
This commit is best viewed with Git --color-moved option.
For all use cases the locale name and the codeset are now determined in the `wxUILocaleImplUnix` ctor.
If `locale_t` support is not available, the use of explicit locales with `wxUILocale` will be problematic.
While there is no real harm in keeping them, it still seems better to
tell people that they're not needed.
Don't put them inside WXWIN_COMPATIBILITY_3_0 for now, however:
considering how late in 3.2 development this deprecation comes, it seems
better to wait until after it and then use WXWIN_COMPATIBILITY_3_2
instead.
Neither of these methods was actually ever used after the changes of the
last two commits (and they hadn't been used when not using wxGTK even
before), so don't force the user-defined model classes to override them.
Also stop using them, as the stub versions don't return correct values
any longer.
Still keep the virtual functions in the base class for compatibility
however as it doesn't cost us much and avoids breaking the existing code
using "override".
We must use wxDataViewCtrl::GetColumnCount() instead, as using the model
column count was just wrong if the control didn't use all of the model
columns.
We don't seem to really need it as we can just convert everything to
strings and this will allow to remove the requirement to override it in
the derived model classes.
This commit is best viewed ignoring whitespace-only changes.
This provider is supposed to have all the icons that the Tango provider
has because this is the justification for turning off support for the
latter when using wxGTK, see logic for setting wxUSE_ARTPROVIDER_TANGO
in configure.in, but it didn't provide two of the recently added ones.
Do add them and also add a reminder to Tango provider code to ensure
this doesn't happen again.
Closes#22550.
For example vc_lib, vc_x64_lib, vc_dll, vc_x64_dll, gcc_lib and gcc_dll all in
the same installation location. Disable the architecture (32 vs 64 bit)
compatibility check in the version file.
CONFIG mode uses the <packageName>_DIR variable.
CMake has an error when generating the solution because the
lib/vc_x64_dll/mswud directory does not exist; it is not built and installed.
So only add the used configuration.
The config file uses the wxWidgetsTargets file to find all the libraries that
can be linked to.
It supports checking for components (e.g. base, core, aui, gl) and fails if a
requested component is not found.
Set the version compatibility to SameMinorVersion (when CMake supports this),
because different minor wxWidgets versions (3.0 and 3.1/3.2) are expected to
break API.
Because the default libraries are named like wx::wxname, create an alias that
is just called wx::name. CMake older than 3.18 does not support creating an
alias to non-global imported targets, so manually create a library with the
same properties.
The wxWidgets CMake build only builds the Release and Debug configurations, but
when creating a (MSVC) CMake project it also contains MinSizeRel and
RelWithDebInfo configurations. By default these seems to use the Debug
libraries, causing build errors. Map them to the Release libraries instead.
Also create a wxWidgets_LIBRARIES variable that can be used to link with, so
users can keep using the same variables from FindwxWidgets.