Correct the changes of 212d59cd80 (Fix determining the size of
wxBitmapComboBox bitmaps, 2022-05-25) and avoid changing m_usedImgSize
if we have no bitmaps at all, as it happens when adding the very first
bitmap: in this case, we set m_usedImgSize in our OnAddBitmap() before
actually adding the bitmap to m_bitmapbundles in DoInsertItems() called
from the base class Append() or Insert(), and wxMSW implementation calls
RecreateControl() from its overridden OnAddBitmap() which results in a
call to UpdateInternals() in between them.
All this is rather confusing and it would arguably be better to avoid
setting m_usedImgSize until the bitmap is actually added to
m_bitmapbundles, but this would require further changes, so for now just
avoid setting m_usedImgSize to (0, 0).
Ensure that wxBitmapBundleImpl full declaration is available when it is
compiled, at least OpenVMS compiler has trouble with compiling the call
to reset(), which involves using wxBitmapBundleImpl dtor, if it comes
before this class declaration.
Fix a problem introduced in 429b5561ff (Use wxBitmapBundle in wxWizard,
2022-02-10), see #22124, by adding a check for the current page being
non-null before using it.
Closes#22471.
Create the wxBitmap in the expected physical size to fix rendering artifacts.
CreateWithDIPSize cannot be used because when it scales the DIP size, it could
be off-by-one.
Remove obsolete mdc->GetImpl()->SetWindow(), this is not needed anymore because
the DPI is now determined from the associated bitmap content scale factor, and
not from the wxWindow.
See #22450
Ensure that the owner idea of the floating frame position always matches
reality -- which could be not the case before if we returned before
updating it.
This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-space options.
Closes#22458.
Correct the wrong wxVariant type check in 8d3e7fd346 (Accept
wxBitmapBundle in wxDataViewBitmapRenderer too, 2022-05-08) and actually
verify that we have a wxBitmapBundle, not a wxBitmap, before accessing
it.
See #22411, #22460.
Use DoInitImpl() which, somehow, was never used before, meaning that,
apparently, wxIPV6address never worked at all, as objects of this type
were still initialized to use FAMILY_INET (i.e. IPv4 address family).
Closes#22463.
Instead of using the size of the first item bitmap, use the size best
suited for all the bitmaps, which may result in better appearance if the
different bitmaps are not all available in the same sizes.
This also fixes the unit test after 80a736250e (Fix margin between
wxBitmapComboBox images and text in high DPI, 2022-05-25) and should
have been part of it.
Add support for the missing wxBU_NOTEXT style, bitmaps for the other
than default states (pressed, focus, disabled and current) and margins
to wxBitmapXmlHandler.
Note that the images for the other states were previously already
supported by wxBitmapButton XRC handler, but not by the wxBitmap one,
even though both bitmap classes support them.
Closes#22451.
Using GetContentScaleFactor() worked just fine for wxOSX and wxGTK,
where it's the same as GetDPIScaleFactor() anyhow, and, until recently,
didn't matter for wxMSW where the scale factor was just ignored.
However since 9e5c8a8027 (Respect bitmap content scale factor in wxMSW
wxMemoryDC, 2022-03-26) it is important to specify the actually correct
scale factor when creating the backing bitmap in wxSTC code, as
otherwise wxMemoryDC would try to compensate for it by rescaling the
font, which should be unnecessary and resulted in a very noticeable
performance regression.
Simply using GetDPIScaleFactor() fixes the problem for wxMSW without
affecting the other platforms.
Closes#22450.
Don't use FromDIP() with m_usedImgSize which is expressed in logical,
and not DPI-independent, pixels already and also update the image size
when the DPI changes.
Closes#22436.
This function didn't work at all in this case because the drag context
wasn't set in target_drag_data_received(), unlike in all the other
callbacks.
Do set it here too to fix it, this notably makes dropping data on
generic wxDataViewCtrl work correctly in wxGTK.
Closes#22453.
Recent changes to wxGrid (see #22292) resulted in an assertion being
triggered when dragging row or column to the corner window. Fix this by
adding a check for the new position validity.
Closes#22432.
Closes#22443.
This was broken by 6feeed9fe9 (Handle transparency to the best of our
ability in wxImageList, 2022-05-05) as using alpha, rather than mask,
for these images resulted in alpha channel being just ignored.
Work around this by making at least one pixel not quite transparent in
this case.
This also makes things work for images using alpha channel with only 0
values, rather than mask covering the entire bitmap.
See #22400.
Closes#22437.
Even though it's better to not specify the preview frame size at all,
the size should still be used if it was explicitly specified, but this
didn't happen any more after the addition of the call to Fit().
Fix this now by only doing the equivalent of Fit() if no size was
explicitly given.
Also add advice about not setting the size explicitly to the
documentation.