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().
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.
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.
/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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.