Commit graph

74106 commits

Author SHA1 Message Date
Vadim Zeitlin
f0b54bef2f Handle wxLANGUAGE_DEFAULT specially in wxLocale::IsAvailable()
Check if using Init(wxLANGUAGE_DEFAULT) is going to succeed by actually
calling wxSetLocale(LC_ALL, "") in this special case, as we can't if
it's going to work otherwise if we don't recognize the language.
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
ce04dbc024 Recommend using wxUILocale::GetSystemLanguage() in wxLocale docs
The wxUILocale function really returns the default language unlike the
one in wxLocale which must kepe using the default locale for
compatibility, making its name confusing.
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
4c23721743 Add a pseudo test to show system locale and language
This can be useful to compare the results of calling
wxUILocale::GetSystemLanguage() and the function with the same name in
wxLocale (which actually corresponds to wxUILocale::GetSystemLocale()).
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
8b696319e7 Make comment in wxLocale::GetLanguageInfo() even more detailed
Explain that we need to call our (i.e. wxLocale) GetSystemLanguage()
here instead of letting wxUILocale::GetLanguageInfo() call its own (i.e.
wxUILocale) GetSystemLanguage() which does _not_ do the same thing.

No real changes, just try to explain this confusing code better.
2023-02-04 13:36:53 +01:00
Vadim Zeitlin
109e8e0f83 Merge branch 'rvalue_string' of https://github.com/pavel-t/wxWidgets
Add move operations and rvalue support to wxString.

See #23215.
2023-02-04 13:19:35 +01:00
Pavel Tyunin
099c5f1cac
Quick fix to avoid regression in assign() with length 2023-02-03 22:09:52 +02:00
Pavel Tyunin
62f83858a0
Add tests for wxString assignment operator 2023-02-03 22:09:52 +02:00
Pavel Tyunin
974feb4c39
Add tests for wxString move constructors 2023-02-03 22:09:52 +02:00
Pavel Tyunin
31ca15fa47
Add noexcept to wxString::swap() 2023-02-03 22:09:52 +02:00
Pavel Tyunin
e438079485
Add non-member swap to wxString 2023-02-03 22:09:52 +02:00
Pavel Tyunin
bcda42a082
Add rvalue versions of wxString assignment and construction functions 2023-02-03 22:09:52 +02:00
Pavel Tyunin
d00a072dc5
Add move operations to wxString 2023-02-03 22:09:51 +02:00
Pavel Tyunin
5b951caa79
Add string arrays benchmarks 2023-02-03 22:09:51 +02:00
Vadim Zeitlin
e3e7130d4a Merge branch 'new-redef-fix'
Fix errors due to "new" redefintion.

See #23201.
2023-02-03 15:13:04 +01:00
Vadim Zeitlin
0a1b0fbe01 Merge branch 'msw-about'
Improve generic and MSW "About" dialog appearance.

See #23196.
2023-02-03 15:11:48 +01:00
Vadim Zeitlin
255876075a Merge branch 'xrc-feature'
Add XRC "feature" attribute.

See #23184.
2023-02-03 15:09:55 +01:00
Scott Talbert
3cc00091e2 Document wxBookCtrlBase::GetControlSizer
The documentation for wxChoiceBook discusses using this method, but it
was not previously documented.

See #23211.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2023-02-03 15:08:55 +01:00
Lauri Nurmi
f7d0742715 Use translation context for more standard OSX menu items
Similar items were added context in d85f0e311d (Use translation context
for standard OSX menu items, 2022-05-02) but some were missed back then.

The context primarily serves as a translator comment, informing that these
are indeed OSX menu item names, and not something else.

Also to match the established translations of OSX itself, for some
languages these may need to be translated using particular terminology
different than on other platforms.

See #23213.
2023-02-03 15:03:04 +01:00
Vadim Zeitlin
102f5fdea0 Merge branch 'fi-keyname-fix' of https://github.com/lanurmi/wxWidgets
Fix non-fuzzy keyboard key names that are clearly wrong for Finnish.

See #23212.
2023-02-03 15:00:33 +01:00
Vadim Zeitlin
9d18ae98b3 Make the error message about missing nanosvg more clear
When wxWidgets itself is embedded into another repository as a
submodule, it may not be obvious that the given command must be run from
wxWidgets subdirectory and not the top-level repository itself, so make
it more explicit.
2023-02-03 14:32:29 +01:00
Lauri Nurmi
cbee89b3d2 Fix and/or complete OSX menu item translations for Finnish 2023-02-02 22:27:59 +02:00
Lauri Nurmi
d8114d2176 Fix double-UTF8 comment line in fi.po 2023-02-02 21:54:59 +02:00
Lauri Nurmi
0316ead300 Fix non-fuzzy keyboard key names that are clearly wrong for Finnish
The translations make sense in another context, but not as key names. Also
one typo.
2023-02-02 21:54:58 +02:00
Artur Wieczorek
6674ce7fe6 Apply workaround to fix drawing glitches caused by
wxGraphicsContext::ResetClip (wxOSX)

Using native CGContextResetClip() to reset the clip causes some
drawing glitches - especially with drawing text with CT - see
https://github.com/wxWidgets/wxWidgets/issues/22629#issuecomment-1399554002
For the time being we have to revert to the previous code
with emulated resetting based on restoring the graphics context state.
We also have to disable a unit tests that fails with emulated
resetting the clip.

See #22629.
2023-01-31 22:32:41 +01:00
Vadim Zeitlin
ef3c8dd408 Explain why including wx/msw/msvcrt.h is a bad idea
This breaks any use of placement new and so the best solution is to
avoid including this header.
2023-01-31 14:48:45 +00:00
Vadim Zeitlin
6e4d0202ad Work around placement new breakage by wx/msw/msvcrt.h
Including that header breaks any use of placement new, such as the one
in wx/any.h, so we need to explicitly undefine (and then redefine it
back) "new" to make it compile in case wx/msw/msvcrt.h is included
first.
2023-01-31 14:45:04 +00:00
elfmz
228bae0d91 Support Caps/Num/Scroll Lock in wxGetKeyState() in wxGTK
Add support for more keys to this function, which previously only
supported the modifiers.

See #23198.
2023-01-31 01:29:31 +01:00
Vadim Zeitlin
4918df7261 Fix core files creation
Ubuntu configured to use apport by default, which intercepts core files
creation and creates them in a different directory.

Force creating core files in the current directory by overwriting the
corresponding kernel option. Note that this requires using --privileged
docker option as otherwise /proc/sys is mounted read-only inside the
contains and cannot be modified.

See #23189.
2023-01-31 01:27:48 +01:00
Vadim Zeitlin
0130282987 Create wxPGGlobalVars on demand and not on startup
This is slightly more efficient as it avoids allocating an object which
is possibly not ever going to be used on startup of any application
linking with the propgrid library (at the price of slower access to this
object, but this should never be done in performance-critical parts of
the code, hopefully) and avoids a problem with losing the previously
registered editors when re-initializing wx modules, as wxPython does.

Closes #23165.

See #23187.
2023-01-31 01:26:54 +01:00
Vadim Zeitlin
cd0c527889 Merge branch 'composite-bookctrl-base'
Fix link when using wxSimplebook both directly and indirectly.

See #23185.
2023-01-31 01:25:38 +01:00
Vadim Zeitlin
05e49f7989 Add "About" dialog screenshots under different platforms
Show both "simple" and "fancy" (which just means with the web site
link specified here) forms from the dialogs sample.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
17827947ec Don't show "developer" in the simple "About" dialog
This doesn't look well in the native Mac or MSW versions, so leave it
out to make the dialog nicer by default.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
9fbc7abea1 Update copyright year in the dialogs sample "About"
This is not critical, so might not be worth updating it every year, but
using 2006 there is still a bit too vintage.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
08affd7e11 Make simple MSW About dialog more consistent with the generic one
Show short version on the same line as the program name and put the
copyright at the bottom, as in the other versions.

This makes the simple message box more similar to the fuller dialog
shown by wxAboutBox() if the web site or any other "non simple" field is
specified.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
2969453637 Move copyright to the bottom of the generic About dialog
This is consistent with the native GTK and macOS dialogs and it makes
sense to try be more consistent with them, as the generic version is
used as a fallback under Mac.

Also use a smaller font for the copyright as is customary.
2023-01-30 21:11:42 +01:00
Stefan Csomor
6eb6c52bee
rerouting ordinary selectors to webview (#23197)
see #23151
2023-01-30 20:42:01 +01:00
Vadim Zeitlin
f2d58e5bf8 Center all texts in the generic About dialog
This looks better in combination with the centered top line.
2023-01-30 16:54:07 +00:00
Vadim Zeitlin
9ce5cc25bf Don't hard code 5px border size in the generic About dialog
Use wxSizerFlags::GetDefaultBorder() instead.
2023-01-30 16:51:38 +00:00
Artur Wieczorek
ec25a5c83c Execute automated tests for wxPropertyGrid
Move existing manually executed tests in propgrid sample to the test
suite executed automatically.
2023-01-30 17:28:17 +01:00
Vadim Zeitlin
93c6551364 Fix signature of dark-mode related uxtheme.dll functions
They were wrongly declared as taking (which is not very important) and
returning (which was very bad as it resulted to interpreting the return
values incorrectly in optimized builds) Win32 4-byte BOOL instead of the
C++ 1-byte bool that they actually use.

Closes #23169.

See #23186.
2023-01-29 20:35:30 +01:00
Tobias Taschner
12e65399e4 macOS: Fix wxWebViewHandlerRequest::GetDataString
An additional call to wxWebViewHandlerRequest::GetDataString() would
return an empty string because the underlying memory stream wasn't
reset.

Closes #23181.
2023-01-29 20:34:24 +01:00
Vadim Zeitlin
dbbf509e18 Fix link when using wxSimplebook both directly and indirectly
This resulted in its base class wxNavigationEnabled<wxBookCtrlBase>
being instantiated both in the application itself (when using it
directly) and inside the wx DLLs (when using another class using the
same base class, but defined in the DLL, such as wxAuiNotebook) and gave
linking errors.

Work around this by explicitly defining wxCompositeBookCtrlBase,
corresponding to this base class, ourselves and export it from the DLL
so that it's the single instance which is always used.

Closes #22805.
2023-01-29 16:26:09 +01:00
Vadim Zeitlin
3fdebc96cd Add support for XRC "feature" attribute
This is a generalization of the existing "platform" attribute and allows
to only include some XRC elements if and only if an arbitrary "feature"
is enabled by the application before loading the XRC document.
2023-01-29 00:54:42 +00:00
Vadim Zeitlin
8139d8d3b7 Factor out HasAnyMatchingTokens() helper
No real changes, just make the function checking if any of the tokens in
the given string matches some predicate reusable.
2023-01-29 00:54:42 +00:00
Vadim Zeitlin
d1580660e5 Use a constant for the "platform" attribute
This avoids recreating the same string many, many times (as it's done
for every node of every XRC document loaded by the program).
2023-01-29 00:54:42 +00:00
Vadim Zeitlin
bc0d4f4832 Another small refactoring of FilterOurInactiveNodes()
No real changes, just make it more clear that by default all nodes are
"ok", i.e. are not removed.
2023-01-29 00:54:42 +00:00
Vadim Zeitlin
9118ecf5b6 Rename ProcessPlatformProperty() to FilterOurInactiveNodes()
No real changes, just rename the function to use a more generic name
before actually making it more generic.
2023-01-29 00:54:42 +00:00
Maarten Bent
e51bc73659 Work around MSVS 2022 optimizer bug in wxImage::ShrinkBy()
Move "alpha" initialization inside the conditional to ensure that it's
calculated correctly, as it was apparently hoisted out of the loop due
to an optimizer bug otherwise.

This commit is best viewed with Git --color-moved option.

Closes #23164.
2023-01-29 01:50:44 +01:00
Vadim Zeitlin
b91be88c0b Merge branch 'xrc-cleanup'
Modernize and clean up XRC code.

See #23180.
2023-01-29 01:44:45 +01:00
Vadim Zeitlin
429a56cbbc Merge branch 'remove-unused-setup-h-defs'
Remove unused definitions from setup headers.

See #23178.
2023-01-29 01:44:13 +01:00