This commit improves the best locale match algorithm by prioritizing
closer matches and add many new tests verifying that this works as
expected.
In order to do this, new information had to be added to the language
database, which was extended with it and updated to use the latest
Unicode CLDR data and latest Windows 11 locale list.
Further, add a set of scripts for maintaining the language database up
to date and a GitHub workflow `genlangdb.yml` which can be run manually
to regenerate the wxWidgets language-related source and header files
from the underlying Windows and Unicode data. It produces 2 artifacts:
- wxLanguageDatabaseDist.zip allows to easily update the
language-related files in the wxWidgets repository by simply copying
all files.
- the normal workflow log and wxLanguageDatabaseLog.zip allow to check
all temporary files of the regeneration process and to detect
potential issues, before the language-related files are actually
replaced by the new ones.
Finally, fix wxUILocaleImplName::GetPreferredUILanguages: Under Windows
10 and above the Windows API function ::GetUserPreferredUILanguages()
returns only the primary UI language plus US English. Additional
preferred UI languages installed by the user are ignored, so instead of
using this function read the list of user preferred languages from the
Windows registry.
Closes#24855.
Don't crash in this function if it ever happens to be passed a null
pointer again (see the fix in the parent commit) and document that it
takes a non-null pointer.
ShowHint() shouldn't be called directly, as it doesn't set m_hintFadeAmt
correctly and so the hint window is always shown directly, even when
wxAUI_MGR_HINT_FADE flag is set (which is the default).
Fix this by adding wxAuiManager::UpdateHint() which does update
m_hintFadeAmt and use it in wxAuiNotebook.
Also document that ShowHint() shouldn't be called directly.
Add wxAuiNotebook::SetManagerFlags() and use it in the sample to allow
testing how the different flags, such as wxAUI_MGR_HINT_FADE, affect
wxAuiNotebook behaviour.
It doesn't cost almost anything to provide this function, as we already
track showing and dismissing all modal dialogs in this class, and it can
(will) be useful, so add it.
These functions can't be really used, the controls are managed by the
picker itself and using SetTextCtrl(), in particular, has no chance of
working correctly because the picker wouldn't be connected to
wxEVT_TEXT and wxEVT_KILL_FOCUS events on it, as it should be.
Using static_cast<className*>(obj) when the object is not actually of
the given type is UB, so avoid it even if should be harmless in
practice, by simply omitting it: we only need "obj" to be a wxObject
here.
Note that this means that using wxCheckCast() or wxStaticCast() with a
type not deriving from wxObject is always UB, but there is not much that
we can do about it, so just document this explicitly.
Under certain circumstances it can make sense to use a locale other than
the default user locale.
One example would be, if an application wants to use a UI translation
with an RTL language (like Arabic) on a non-RTL system. This wouldn't
work with the default locale, because the layout direction would be
wrong.
Currently setting a non-default locale can already be achieved via
wxLocale anyway. Therefore wxUILocale::UseLocaleName() should be made
public, to allow for less side effects than using wxLocale.
Closes#23972.
All supported platforms provide 64-bit integer types since many years,
so remove the legacy wxLongLongWx implementation and rename
wxLongLongNative to just wxLongLong and always compile it in.
Note that wxLongLong itself must still be kept for compatibility as it
has member functions, such as GetValue() or ToString(), that can be used
in the existing code.
Although this is unusual in wxWidgets API, it really makes sense to let
wxAuiManager perform the scaling, if necessary, instead of asking every
implementation of wxAuiSerializer and wxAuiDeserializer to do it on
their own, so pass the values as DIPs to the former and assume the
values returned by the latter are in DIPs too to make things just work
even on the platforms where DIPs are not natively used (i.e. wxMSW).
Add wxAuiSerializer and wxAuiDeserializer classes and SaveLayout() and
LoadLayout() functions in wxAuiManager using them.
Show how these classes can be used to use XML for storing AUI layout in
the sample.
See #24225.
Try to make it as clear as possible that this class shouldn't be used
any longer without formally deprecating it (as it does still work in
wxMSW and, also, is still used in some of our own code).
wxWebRequest::AddHeader() was added to accompany the existing
SetHeader() method. In wxWebSession, AddCommonHeader() did exist
already but behaved like setting a header. Its behavior was adapted
to its name and SetCommonHeader() was added with the old behavior
to accompany AddCommonHeader().
The WinHTTP and CURL implementations of wxWebRequest do now append
multiple headers of the same name. The URLSession implementation
follows in the next commits.
HTTP headers like Set-Cookie can be present multiple times in a
web response by definition. The existing GetHeader() method is
not sufficient to cope with this situation.
This commit already adds an implementation for Windows.
Linux and macOS follow in the next commits.
Also known as [[gnu::warn_unused]].
Use __has_attribute to check availability of the attribute. (Is available
on recent GCC and Clang versions, not available on MSVC.)
Use the fonts set at wxAuiTabArt provider level in wxAuiNotebook, to
ensure that wxAuiNotebook::SetNormalFont() and SetSelectedFont()
actually work.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
Closes#24783.
This function doesn't exist any more since 5e2da5a106 (Get rid of v2.8
code, 2022-08-01) and was deprecated back in f944aec0cf (removed
SetVirtualSizeHints() and related code, 2007-12-15).
It seems that as of the below commit, doxygen changed its handling of
parsing backticks in comments such that it now fails to properly
generate documentation for the entire datetime.h file. Fix this by
closing the open backtick.
Also update the actual, non-documentation, header to match for
consistency, even if non-matching backticks are not a problem there.
See: https://github.com/doxygen/doxygen/commit/f18767307be20ca8d2ca81f74cc1f3446205282bCloses#24814.
Make a number of factual and formal changes. The most important
ones are noting that wxWebViewChromium does not support script
message handlers and accounting for the fact that there can be
multiple backends on each platform.
Implement it for Edge, WebKit2GTK and Chrome backends.
It doesn't seem possible to implement this for WebKit macOS backend and
IE backend doesn't support dev tools at all.
Also note that Edge backend doesn't seem to support closing the dev
tools window, so don't provide this functionality for now, even if it
could be implemented for WebKit2 and Chrome backends.
Remove outdated information about special meaning of wxRESIZE_BORDER
style flag on Windows.
Add a reference to ::wxDirSelector() and wxDirPickerCtrl.
Improve formatting by using @c where appropriate and fix few typos.
In the common dialogs overview, add that wxDirDialog can be used to
select also mutiple directories.
In wxDirSelector, provide the correct default argument for
the wxDirDialog style parameter, change the path parameter
name to match the implementation, and fix the example code.
Provide information about wxFD_ flags used by wxLoadFileSelector()
and wxSaveFileSelector().
Add missing default arguments for wxGetColourFromUser() and wxGetFontFromUser() parameters.
Improve formatting by using @c where appropriate.