Commit Graph

72301 Commits

Author SHA1 Message Date
Alexander Koshelev
27be2ed641 wxBitmapBundle for wxMenuItem on MSW 2022-02-04 15:45:49 +03:00
Vadim Zeitlin
dbc8506883 Merge remote-tracking branch 'github/msw-menu-bitmaps-alpha'
Fix alpha in copies of wxBitmap.

See #22085.

Closes #22059.
2022-02-04 01:35:37 +00:00
Vadim Zeitlin
bd86215843 Merge branch 'macos-dvc-isdeleting'
Fix crash in wxDataViewModel::Cleared() under Mac.

See #22025.
2022-02-04 02:28:55 +01:00
Vadim Zeitlin
c701a47176 Simplify code using wxDataViewCtrl::m_Deleting in wxOSX
Use a RAII-based helper class to reset this flag automatically on scope
exit instead of doing it manually.

This also ensures that we restore the original value rather than just
resetting it which would be more correct in the (admittedly, very
unlikely) case when any of the functions changing m_Deleting is called
recursively.
2022-02-04 02:27:27 +01:00
oneeyeman1
995c6e6df5 Add wxSpinCtrl::SetIncrement() and implement it for all ports
SetIncrement() was already available in wxSpinCtrlDouble and GTK version
of wxSpinCtrl, now implement support for it in wxMSW and wxOSX as well.

In fact, in wxMSW, implement it at wxSpinButton level, so that both this
class and wxSpinCtrl inheriting from it (in wxMSW only) support setting
custom increment now.

Also add support for it to XRC, show it in the sample and add a unit
test verifying that it works.

Closes #2597.
2022-02-04 02:16:06 +01:00
Scott Talbert
57b4a11f24 Install Python wheel module to fix Windows CI
This is needed since GitHub CI images update to windows-2022 base image,
which notably changes Python version from 3.7 to 3.9 and requires
building wheels for some of the packages not available on PyPI for this
version.

Closes #22091.
2022-02-04 02:06:11 +01:00
Vadim Zeitlin
28401d0fde Update zlib submodule to fix CMake configuration errors in it
See https://github.com/wxWidgets/zlib/pull/2
2022-02-03 23:39:55 +01:00
James Pan
866cdfe200 Complete Chinese translations
There are no more untranslated or fuzzy messages remaining.
2022-02-03 16:02:04 +01:00
Vadim Zeitlin
d4c83e1cbc Ensure that a copy of a DIB wxBitmap remains a DIB in wxMSW
Creating a DDB from DIB with alpha doesn't work correctly due to using
premultiplied alpha for the latter, but not for the former, and while we
could convert it, it seems to be even better to just preserve the type
of the original bitmap, as this would seem to be expected when making a
copy, after all.

This commit is best viewed ignoring whitespace-only changes.
2022-02-02 22:36:00 +00:00
Vadim Zeitlin
e5e9794607 Merge branch 'SplitterResizeExample' of https://github.com/skeetor/wxWidgets
Add an example how to use the new splitter resize event and other minor
updates to the splitter sample and wxSplitterWindow itself.

See #22065.
2022-02-02 23:24:07 +01:00
Gerhard Gruber
9c28cda792 Updated sample to allow switching doubleclick on sash on or off. 2022-02-02 22:32:07 +01:00
Vadim Zeitlin
2ae80673ff Avoid unnecessarily unsharing bitmaps in wxMSW
Only call AllocExclusive() if really need to modify the bitmap and avoid
doing it if the scale factor doesn't actually change, as this saves on
unnecessary expensive bitmap copy.

This also avoids the problem of getting wrong background for SVG images
since this call to AllocExclusive() was added in d943d6f6cf (Ensure
wxBitmap::SetScaleFactor() doesn't change bitmap copies, 2022-01-22)
when not using high DPI, although the problem still remains in the high
DPI case as bitmap alpha channel is still copied incorrectly when we do
have to copy it.
2022-02-02 20:54:06 +00:00
Vadim Zeitlin
82ab884046 Undo unnecessary comment reformatting
No real changes, but this just avoids a gratuitous difference with
master before merging.
2022-02-02 14:48:30 +01:00
Vadim Zeitlin
0ea99046e1 Fix vetoing of wxEVT_SPLITTER_DOUBLECLICKED after recent changes
The change of semantics of DoSendEvent() broke the logic in
OnDoubleClickSash(), fix it now and remove DoSendEvent() entirely as
it became useless now that it doesn't test whether the event was vetoed
any more and the code is simpler without it.
2022-02-02 14:45:00 +01:00
Vadim Zeitlin
23c5cd3de1 Restore removed event.Skip() in the splitter sample
There doesn't seem to be any reason for removing this one, so restore it
and add the same explanatory comment as was added to the other handlers.
2022-02-02 14:26:22 +01:00
Vadim Zeitlin
46dce3e160 Merge fix for environment variable expansion in XRC bitmap paths
This is a merge of the branches 'fix-xrc-envvar-bitmapbundle' of
https://github.com/ousnius/wxWidgets & 'ak_fix-xrc-envvar-bitmapbundle'
of https://github.com/kosh543/wxWidgets.

Fix the recently introduced bug in environment variables expansion in
the bitmap paths and add a unit test ensuring it isn't introduced again.

See #22071, #22080.
2022-02-02 14:20:51 +01:00
Alexander Koshelev
c986763a77 Test environment variables in XRC bitmap paths 2022-02-02 10:56:51 +03:00
Tobias Taschner
03efe56cf9 Allow WebView2 Edge updates without restart
The previous implementation initialized the version number only once.
This caused subsequent calls to wxWebView::GetBackendVersionInfo() to
return the same version number even if the runtime has been updated or
a fixed version runtime had been activated via
wxWebViewEdge::MSWSetBrowserExecutableDir().

This change allows to require a minimum runtime version and allow
a runtime update without requiring a restart of the application.

Closes #22076.
2022-02-01 23:15:18 +01:00
Kvaz1r
03b2ebcffb Fix setting focus on mouse button press in wxUniv
Call base version of HandleMouse to allow the base theme handle to set
the focus to the widget.

Closes #22074.
2022-02-01 23:13:47 +01:00
Vadim Zeitlin
2bbe0d7769 Merge branch 'tango_svg' of https://github.com/TcT2k/wxWidgets
Replace PNG images with SVG in Tango art provider and add a couple of
new art IDs for the use in the webview sample.

See #22067.
2022-02-01 23:12:43 +01:00
Tobias Taschner
73d37d460d Add tango art for refresh and stop
Use the added art IDs in webview sample
2022-02-01 09:50:32 +01:00
Tobias Taschner
766fefeb34 Use SVG instead of PNGs in tango art provider
Replace embedded tango PNG data with SVG data of the same icons.
2022-02-01 09:46:55 +01:00
Tobias Taschner
f256e5ae59 Add additional wxBitmapBundle::FromSVG() overload
This overload can work on non 0 terminated unsigned char arrays.
Especially useful for headers created by bin2c.py
2022-02-01 09:46:48 +01:00
Vadim Zeitlin
ae7fa19ae3 Improve fallback logic in wxArtProvider::GetBitmap{,Bundle}()
This improves the changes of f78db92462 (Avoid bitmap scaling in
wxArtProvider::GetBitmapBundle(), 2021-12-17) and still uses a custom
bundle to avoid scaling the bitmap if possible, but does it in
GetBitmapBundle() itself rather than CreateBitmapBundle().

This allows to also use CreateBitmapBundle() from GetBitmap(), as there
is no possibility of infinite recursion due to calling each of these
functions from the other one any more, and so allows defining art
providers overriding only CreateBitmapBundle() instead of having to
always override both it and CreateBitmap().

Also add a unit test, even if just a trivial one, for these functions,
to at least check that they don't crash.
2022-01-31 22:53:13 +00:00
Gerhard Gruber
bfb5d32582 Fix bug in wxSplitterWindow not handling the event state correct in case of sash pos changing or resize. 2022-01-31 18:20:28 +01:00
Gerhard Gruber
5da9d12272 Added an example how to use the new splitter resize event. 2022-01-31 18:20:28 +01:00
ousnius
eb60079085 Fix XRC environment variable expansion for bitmap bundles 2022-01-31 16:33:00 +03:00
Lauri Nurmi
1a10199575 Document installing vcpkg packages for x64, too
Vcpkg defaults to installing packages for x86-windows, and from the
perspective of x64 builds, the packages installed just cannot be
found -- and the reason is not very obvious.

Having an example with commands that will install both x86 and x64 is
probably the right thing to do in this day and age -- and if somebody
only wants one and not the other, seeing a package name with architecture
specified helps with guessing how to achieve that.

Closes #22075.
2022-01-30 23:03:17 +01:00
Blake-Madden
49c508c7a9 Fix typo in "By default" in the documentation
It was misspelt as "Bu default" in a couple of places.

Closes #22072.
2022-01-30 22:59:26 +01:00
PB
754f75c1cd Fix memory leaks in artprov sample
The list control used in the Resources Browser dialog had
dynamically allocated wxStrings assigned as item data that
were never freed.

Closes #22070.
2022-01-30 22:58:07 +01:00
Scott Talbert
085d15015a Don't install old or non-existent packages during Linux CI
libwebkitgtk-3.0-dev is long deprecated and isn't used anyway.
gstreamer-0.10* no longer exists even on Ubuntu 18.04.
gstreamermm* is not used by wxWidgets.

Closes #22069.
2022-01-30 22:56:25 +01:00
Artur Wieczorek
2ee8751c46 Use size_t type for index value 2022-01-30 19:27:38 +01:00
Artur Wieczorek
0906e820d9 Use size_t type for index value 2022-01-30 17:29:25 +01:00
Artur Wieczorek
93365e02de Use more relevant macros in wxPropertyGrid 2022-01-30 12:06:27 +01:00
Artur Wieczorek
7e4cd9f1c1 Get rid of unnecessary friend classes 2022-01-30 10:33:17 +01:00
Artur Wieczorek
a86950de7f Get rid of unused variable 2022-01-29 23:36:47 +01:00
Artur Wieczorek
bd784b3186 Refactor functions converting wxArrayString to string in wxArrayStringProperty::GenerateValueAsString()
Because ConvertArrayToString() and ArrayStringToString() produce string
values it would more intuitive to just to return this string as a function
value instead of passing it through the parameter.
2022-01-29 20:32:09 +01:00
Artur Wieczorek
6d318ad0e2 Refactor wxMultiChoiceProperty::GenerateValueAsString()
Because this function produces a string value it would more intuitive to
just to return this string as a function value instead of passing it
through the parameter.
2022-01-29 00:12:27 +01:00
Artur Wieczorek
3c87cc1e49 Get rid of unused member variable 2022-01-28 23:55:12 +01:00
ousnius
0c6dee2171 Fix XRC environment variable expansion for bitmap bundles 2022-01-28 22:59:03 +01:00
Kvaz1r
b8c457e356 Fix scrolling when m_win != m_targetWindow in wxUniv/MSW
This reverts 3b3169fa15 (Fix refresh problems when scrolling with
mousewheel in wxUniv/MSW, 2021-09-23) (see #2525) and replaces it with a
wxUniv-specific workaround in wxScrollHelperBase::HandleOnScroll().

Closes #2640.
2022-01-27 23:45:52 +01:00
Vadim Zeitlin
4cff1fce29 Merge branch 'unsigned-arith-conv'
Avoid arithmetic conversion warnings from gcc 12.

See #22063, #22057.
2022-01-27 23:40:03 +01:00
Jeinzi
d94dc0cab5 Add missing parenthesis to an example in wxTextCtrl docs
Closes #22062.
2022-01-27 17:07:15 +01:00
Vadim Zeitlin
e0323663b9 Handle font variants added in Pango 1.50
This avoids -Wswitch gcc warning and could be actually useful too if we
ever use a font in one of these variants.

Closes #22064.
2022-01-27 17:05:41 +01:00
Vadim Zeitlin
37a4bf8693 Add wxColour::Get{Red,Green,Blue,Alpha}() to avoid gcc 12 warnings
These functions return the colour components as unsigned int and so
promote to this type in arithmetic expressions, unlike unsigned char
returned by the existing accessors without the "Get" prefix, which
promotes to (signed) int and results in gcc 12 -Warith-conversion
warnings when the result is then converted to unsigned, as it happened
in our own wxColour::GetRGB() and GetRGBA() functions and would probably
happen in a lot of code outside wx, which could also be updated to use
the new functions instead of inserting casts.
2022-01-27 15:46:42 +01:00
Vadim Zeitlin
28b84a1e96 Avoid gcc 12 -Warith-conversion in wxImageHistogram::MakeKey()
Explicitly convert the operands to unsigned because we do actually want
the result to be unsigned here.

Co-Authored-By: Scott Talbert <swt@techie.net>
2022-01-27 15:30:22 +01:00
PB
5ba37d867c Support creating wxBitmapBundle from SVG in application resource
Allow creating wxBitmapBitmap from SVG image stored in an application
resource on the platforms where wxHAS_IMAGE_RESOURCES is defined.

On Windows, load the bundle from a resource with RT_RCDATA type and on
MacOS from a file with an extension "svg" placed in the "Resources"
subdirectory of the application bundle.

Closes #22061.
2022-01-27 14:39:35 +01:00
Alexander Koshelev
3f3561e2c6 Change inactive bitmap to in wxBitmapBundle wxAnimationCtrl 2022-01-27 14:29:25 +01:00
Alexander Koshelev
2b94729a33 Change wxBitmap to wxBitmapBundle in wxBannerWindow 2022-01-27 14:29:25 +01:00
Alexander Koshelev
85becc9362 Change wxBitmap to wxBitmapBundle in wxBitmapToggleButton 2022-01-27 14:29:25 +01:00