Commit Graph

72213 Commits

Author SHA1 Message Date
Vadim Zeitlin
bd0db4a5f9 Still resize (16, 15) bitmaps to (16, 16) ones in wxArtProvider
Don't rescale these bitmaps because, as the pre-existing comment said,
this would be too ugly, but still ensure that the returned bitmap has
the correct size to satisfy the post-condition of GetBitmap().
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
52bff00b19 Add accelerators to artprov sample menu entries
Allow testing various things more quickly.
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
2b72d94af0 Fix using dangling pointer in artprov sample
Don't cast wxString pointer to const char*, this could never work and
didn't crash only by some miracle.
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
3871824da6 Reuse wxBitmap::Rescale() in wxArtProvider::RescaleOrResize()
No real changes, just use the common function instead of reimplementing
it here.
2022-02-05 17:53:20 +00:00
Vadim Zeitlin
5aa53a0336 Use RescaleOrResize() in wxArtProvider::GetBitmap()
This ensures that we don't rescale 16x15 bitmaps to 16x16 ones, which is
very noticeable and very ugly.

This was previously done in wxDefaultArtProvider, but not here and
didn't seem to be necessary, but since wxBitmapBundle-related changes it
has become possible for bitmaps to be rescaled here too, so use the same
logic for them.

See #22094.
2022-02-05 17:52:59 +00:00
Vadim Zeitlin
2b7e668221 Move bitmap resizing from wxDefaultArtProvider to base class
No real changes, this is just a refactoring in preparation for the next
commit.

This commit is best viewed with --color-moved git option.
2022-02-05 17:52:47 +00:00
Vadim Zeitlin
6e7fe0de35 Fix using bitmaps with mask in wxMSW wxStaticBitmap
This was broken by c1abbe6473 (Refactor wxMSW wxStaticBitmap to separate
bitmaps and icons, 2021-10-21), where the code for creating an icon for
a bitmap with mask was simply lost.

Note that an alternative fix could be to convert mask to alpha and use
this instead of switching to using an icon in this case, but for now
keep doing what we did before, even if it's not really clear which
approach is better.

See #22094.
2022-02-05 15:32:47 +00:00
Scott Talbert
f172f53ac4 Create our own socket file for socket file test
/dev/log doesn't exist in certain types of containers (e.g., Fedora's
build system).  Additionally, this enables us to run this test on
platforms other than Linux.

Closes #22090.
2022-02-05 16:18:22 +01:00
Alexander Koshelev
80bb72468c Use wxBitmapBundle in wxComboCtrl instead of wxBitmap
Replace wxBitmap with wxBitmapBundle in wxComboCtrl to make it show the
bitmap appropriate to the current DPI scaling.

Also add an event handler updating bitmaps on DPI change.

Closes #22032.
2022-02-05 16:11:14 +01:00
Vadim Zeitlin
ff8e60caea Fix regression in selection change in wxOSX wxDataViewCtrl
The change of 8aae7ad937 (Fatal exception fixed in DVC on macOS while
wxDataViewModel::Cleared call + editing item., 2022-01-17) broke change
of selection when deleting an item from wxDataViewCtrl and the unit test
checking for this but, somehow, only when it was merged into the latest
master and not when it was originally done.

It's not really clear how did it work before, but fix this now by
distinguishing between just deleting some items and clearing everything
and only returning nil from -[wxCocoaOutlineDataSource
outlineView🧒ofItem:] in the latter case, but not the former one.

Also replace wxDataViewCtrl::m_Deleting boolean with an (opaque)
pointer, so that we could improve this further in the future without
breaking the ABI.

See #22025.
2022-02-04 17:12:40 +01:00
Alexander Koshelev
28d8ed37d6 wxBitmapBundle for wxMenuItem on GTK 2022-02-04 15:45:49 +03:00
Alexander Koshelev
337940f009 wxBitmapBundle for wxMenuItem on Mac 2022-02-04 15:45:49 +03:00
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