Commit Graph
5112 Commits
Author SHA1 Message Date
Ulrich Telle 57e1c9e1ee Update wxWidgets language database and improve locale matching
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.
2024-11-18 16:46:25 +01:00
Vadim Zeitlin ec7cfdf2c3 Merge branch 'pg-fixes'
Miscellaneous wxPropertyGrid fixes.

See #24929.
2024-11-02 03:54:48 +01:00
Vadim Zeitlin 6277278e45 Merge branch 'aui-hint-fixes'
wxAUI notebook pages dragging-related fixes, fixing #24890 and #24892.

See #24911.
2024-11-02 03:43:38 +01:00
Vadim Zeitlin c28eb2b1c7 Also add the check to wxPropertyGrid::DrawItemAndValueRelated()
This is similar to the previous commit and adds a check for the
parameter being non-null to this function too for consistency and
extra safety.
2024-10-30 16:16:44 +01:00
Vadim Zeitlin 76cb9b6ba1 Add parameter validity check to wxPropertyGrid::RefreshProperty()
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.
2024-10-30 16:15:18 +01:00
Vadim Zeitlin 74a1997842 Merge branch 'endsession-fixes'
Miscellaneous end session-related fixes for wxMSW.

See #24906.
2024-10-28 17:38:39 +01:00
Vadim Zeitlin 0d44e61208 Default "offset" parameter of CalculateHintRect() to zero
No real changes, just get rid of dummy "zero" variables and don't pass
the offset to CalculateHintRect(), nor DrawHintRect(), at all when it's
zero.
2024-10-27 00:19:52 +02:00
Vadim Zeitlin 42f43fd6b6 Fix fading in hints shown when dragging wxAuiNotebook pages
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.
2024-10-27 00:19:52 +02:00
PB d51cd22392 Fix typos in wxWebViewConfiguration docs
Fix typos in the example code in GetNativeConfiguration() method.
2024-10-26 21:39:04 +02:00
Vadim Zeitlin 9a24f3a77a Allow setting flags of wxAuiManager used by wxAuiNotebook
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.
2024-10-26 15:53:02 +02:00
Vadim Zeitlin d8b547cd15 Document that wxEVT_END_SESSION handler shouldn't use any UI
Also advise skipping the event.
2024-10-25 01:53:16 +02:00
Vadim Zeitlin 3026cf6817 Add wxModalDialogHook::GetOpenCount()
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.
2024-10-25 01:33:11 +02:00
Vadim Zeitlin 2138c71e11 Deprecate wxPickerBase::SetTextCtrl() and SetPickerCtrl()
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.
2024-10-21 21:23:07 +02:00
Vadim Zeitlin 5d10c50361 Remove cast resulting in undefined behaviour from wxDynamicCast()
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.
2024-10-21 21:23:07 +02:00
Vadim Zeitlin 210e8a7a1c Merge branch 'drop-longlongwx'
Always use wxLongLong and always use its "native" version.

See #24891.
2024-10-19 16:27:39 +02:00
Blake-Madden 5f7d255be3 Add wxTextCtrl::SearchText() for MSW
Add new API allowing for more efficient searches in wxTextCtrl and
implement it in wxMSW only for now.

See #24756.
2024-10-18 19:32:58 +02:00
Ulrich Telle e5f95a3bb0 Document wxUILocale::UseLocaleName()
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.
2024-10-18 19:31:50 +02:00
Martin Corino f07405d9a2 Remove "const" from wxAuiManager::LoadLayout() documentation
This was just a typo.

Fixes #24888.

Closes #24889.
2024-10-18 19:26:32 +02:00
Vadim Zeitlin 7aa6da06d0 Remove wxUSE_LONGLONG and always use wxLongLong_t
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.
2024-10-18 19:26:15 +02:00
Vadim Zeitlin 8698e760da Merge branch 'aui-serialize'
Provide a way to store AUI layouts in any custom format.

Closes #24225.

See #24235.
2024-10-16 21:14:25 +02:00
Vadim Zeitlin 819b205b8c Merge branch 'webresponse-getheaders' of https://github.com/dinkelacker/wxWidgets
Support multiple HTTP headers with same name.

Closes #24878.

See #24881.
2024-10-16 20:51:57 +02:00
Vadim Zeitlin 51c5df6aa0 Always use DIPs when saving/restoring AUI layouts
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).
2024-10-15 23:34:43 +02:00
Vadim Zeitlin 9849124fae Provide a way to store AUI layouts in any custom format
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.
2024-10-15 23:34:43 +02:00
Stefan Dinkelacker 1000d67c13 Add fallback to URLSession webrequest backend
Multiple HTTP headers with the same name are not supported by the
URLsession API. As a fallback, the last header is used instead.
2024-10-15 18:37:54 +02:00
Vadim Zeitlin 3557edb36d Merge branch 'deprecate-screendc'
Deprecate wxScreenDC even more, without formally deprecating it.

See #24864.
2024-10-15 15:06:25 +02:00
Vadim Zeitlin 9c4a376367 Document that wxScreenDC doesn't work in more places
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).
2024-10-15 15:05:52 +02:00
Stefan Dinkelacker 8395e5733d Add support for multiple headers with same name to wxWebRequest
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.
2024-10-15 09:15:07 +02:00
Stefan Dinkelacker ae6dc7b469 Add GetAllHeaderValues() to wxWebResponse
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.
2024-10-14 21:36:48 +02:00
Miguel Gimenez 4ae25fd9ce Document wxStdDialogButtonSizer::GetXXXButton()
Closes #24863.

Closes #24866.
2024-10-10 02:43:40 +02:00
Vadim Zeitlin c9af454ccd Merge branch 'qt-fixes' of https://github.com/AliKet/wxWidgets
Multiple wxQt fixes, notably to allow running wxQt tests in AppVeyor.

See #24837.
2024-10-10 02:34:54 +02:00
Lauri Nurmi a2e2bc57c9 Add macro wxWARN_UNUSED to stand for the attribute 'warn_unused'
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.)
2024-10-10 02:31:51 +02:00
Vadim Zeitlin 3caa17e4fa Merge branch 'aui-pmdpi' of https://github.com/MaartenBent/wxWidgets
Make sizes in wxAuiDockArt metrics DPI independent and fix their
appearance when the DPI changes.

See #24844.
2024-09-29 17:40:10 +02:00
Maarten Bent 6f463d1376 Make sizes in wxAuiDockArt metrics DPI independent
When using the wxAuiDockArt sizes, convert them to the DPI of the current window/pane.

Fixes #23420
2024-09-28 19:36:14 +02:00
ali kettab 5bb4c6bbc5 wxQt: Fix wxTextCtrl::SetMaxLength() when length is 0 as documented 2024-09-25 15:24:12 +01:00
archivesilverandVadim Zeitlin 63536d32ff Fix using wxAuiTabArt fonts in wxAuiNotebook
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.
2024-09-24 18:31:52 +02:00
Miguel Gimenez 4782a8469f Remind to call FitInside() after adding or removing elements
Mention in wxScrolled documentation that this function must be called if
the window contents is modified.

Closes #24824.

Closes #24825.
2024-09-21 18:01:23 +02:00
Vadim Zeitlin db8383a3af Don't mention non-existent SetVirtualSizeHints() in the docs
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).
2024-09-21 17:58:30 +02:00
Vadim Zeitlin 06ec856bf3 Merge branch 'webview' of https://github.com/PBfordev/wxWidgets
wxWebView improvements.

See #24820.
2024-09-20 17:53:47 +02:00
Scott Talbert 2d79dfc7a2 Fix docs generation for datetime with doxygen 1.11.0
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/f18767307be20ca8d2ca81f74cc1f3446205282b

Closes #24814.
2024-09-20 17:46:18 +02:00
PB ce8bc7c1fc Improve wxWebView docs
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.
2024-09-18 20:58:13 +02:00
Vadim Zeitlin 089dc4e200 Merge branch 'updateui-checkboxstate' of https://github.com/wsu-cb/wxWidgets
Allow using wxCHK_UNDETERMINED with wxUpdateUIEvent.

See #24764.
2024-09-15 19:00:45 +02:00
Vadim Zeitlin fa23c93832 Merge branch 'webview-cef-devtools'
Implement dev tools support for wxWebViewChromium.

See #24799.
2024-09-15 18:59:30 +02:00
Vadim Zeitlin 9cc48d7ec1 Merge branch 'webview-version'
Add possibility to retrieve both build- and run-time wxWebView version

See #24778.
2024-09-15 18:58:57 +02:00
Bill Su 9e87a726c5 documentation for wxUpdateUIEvent wxCHK_UNDETERMINED support 2024-09-05 21:05:00 -04:00
Vadim Zeitlin 2e6d79acf2 Add wxWebView::ShowDevTools()
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.
2024-09-05 22:09:57 +02:00
Vadim Zeitlin 44068b5550 Document that CEF 128 doesn't currently work with wxGTK
Life-time callback handling has changed and OnBeforeClose() now is not
called as expected, so we hang forever waiting for it to be called.
2024-09-05 18:53:18 +02:00
Vadim Zeitlin 54ba1404e1 Merge branch 'app-exit-code'
Allow customizing exit code in case of OnInit() and other failures.

See #24770.
2024-08-25 17:32:12 +02:00
Vadim Zeitlin c4e12210eb Merge branch 'doc-fixes' of https://github.com/PBfordev/wxWidgets
Improve documentation for convenience input functions and wxDirDialog.

See #24775.
2024-08-25 17:31:35 +02:00
PB a2ffd37c48 Improve wxDirDialog documentation
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.
2024-08-24 20:20:31 +02:00
PB a216408bf0 Improve documentation for convenience input functions
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.
2024-08-24 20:19:10 +02:00