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.
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.
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.
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.
Close the path corresponding to the polygon to ensure that the starting
and finishing edges are joined correctly, which wasn't the case before
as could be easily seen when using thicker pens.
Closes#22440.
Having borders around the controls toolbar and preview canvas not only
wasted space, but also let the frame background show through, which
looked just ugly under MSW, where it is dark grey and so clashes with
the control bar background.
Simply remove them to save space and improve appearance too.
Give a reasonable default size to wxPreviewCanvas and fit wxPreviewFrame
to its contents.
Remove the useless call to Fit() from SizerWithButtons: the size set
inside it was just ignored anyhow.
This also allows to stop hardcoding the size in the sample, so don't do
this any more.
See #22439.
No real changes, just remove the useless call which was left over the
very first version of this code added in 7bcb11d307 (Many changes to the
printing classes., 1999-03-25).
Don't hardcode 70px size for the combobox, but let it determine its own
size instead, as 70 may well not be enough, depending on the theme and
the font size.
Closes#22439.
Fix a layout issue when wxFlexGridSizer contains items that return true
from InformFirstDirection(), such as wxWrapSizer.
If didAdjustMinSize == true, the minimum width has probably changed, and
we should recalculate it. Otherwise we end up using incorrect delta in
DoAdjustForGrowables, which might push items too far to the right.
Closes#22421.
This was broken by the changes of 6383bc39ff (Add convenient
wxDCImpl::CalcBoundingBox() overloads and use them, 2022-04-30), fix it
by calling the overloaded wxDCImpl::CalcBoundingBox() instead of the
wxDC version for which the overloads were not added.
Closes#22418.
This is slightly more efficient and simpler than using a separate
critical section and can easily be done now that wxAtomicInc() returns
the new value.
No real changes.
Use gs_initData.csInit only to ensure that we call wxEntryStart() once
even if there are multiple calls to wxInitialize() from multiple
threads, but don't keep it locked for the duration of that function as
this is unnecessary and results in -- probably benign in practice, but
still annoying -- warnings from the thread sanitizer about lock order
inversions due to locking csInit first before locking gs_mutexGui in
wxThreadModule::OnInit() and then acquiring csInit again while
gs_mutexGui is still locked in wxUninitialize().
This shouldn't result in any observable changes in behaviour.
Define wxBitmapBundleVariantData without using the standard macros that
only work for wxObject-derived classes, but using more or less what they
expand into.
This will allow using wxBitmapBundle with wxDataViewCustomRenderer
subclasses in the upcoming commit.
Instead of checking for the exact variant type match, call the new
IsCompatibleVariantType() virtual function, which still does the same
check by default, but can be overridden to allow other types as well if
they're accepted by the renderer.
This will be soon used to allow accepting both wxBitmap (which must
still be accepted for compatibility) and wxBitmapBundle (which is the
simplest way to support high DPI) in wxDataViewBitmapRenderer at once.
Use 1992 as the initial date for all non-Mac files, instead of using
slightly later years for some of them without any good reason (or at
least without any good reason still remembered by anybody).
This also allows to simplify the script for updating the year.
On macOS everything is based on 72DPI, while the SVG is based on 96DPI.
As a result, fonts in point-size are too big and squeezed together (due too
textLength).
Fix this by taking the standard screen DPI into account in FromDIP and ToDIP,
so all coordinates and sizes will be in SVG DPI.
wxSVGFileDC should be created with a DIP size, so use FromDIP to get the
correct viewBox size and clear-rectangle size.
Some cleanup in wxDC code: remove unnecessary casts, use RAII helpers
instead of manual memory and other resources management.
No real changes.
See #22378.
Make wxDC and wxGraphicsContext DPI aware, i.e. add {From,To}DIP() to
them too and make the values returned from Get{DPI,PPI}() consistent
with wxWindow.
Also improve CMake build: add support for finding Cairo when not using
GTK, fix a warning when creating the inplace-config, and mark some
variables as advanced.
See #22346.
Update similar code in all ports to use wxScopedArray for arrays of
points, dashes etc in various wxDC implementations instead of using
new[] and delete[] manually.
No real changes, just make the code safer and shorter.
No real changes, just make the code updating the bounding box slightly
shorter by providing convenient and slightly higher-level overloads.
For now these functions are only in wxDCImpl, it's not clear if we
really need them in wxDC, so don't add them to the public API.
This is slightly more economical, both at run-time and, maybe more
importantly, at compile-time than using wxSharedPtr that we don't really
need here, simple intrusive ref counting smart pointer is enough.
This is not really necessary and breaks encapsulation of this private
method. It is enough to provide just a way to copy the data from another
object as this is all that the derived classes really need.
Add wxSharedClientDataContainer class storing ref-counted client data
and use it instead of plain wxClientDataContainer in wxGridCellAttr,
wxGridCellEditor and wxGridCellRenderer classes.
This allows to keep the same client data associated with many grid cells
without having to make many copies of it.
Use wxCHECK, not wxASSERT, for checking a critical precondition to
ensure that we don't crash if it's violated.
This fixes crashes in various wxDataViewListCtrl methods if they're
passed an invalid index different from wxNOT_FOUND.
Closes#22358.
Many key names are short and commonly used words; e.g. "Delete", "Left",
"Right", "Pause", "Menu", "End".
It is not at all unlikely that such words could be used in a completely
different meaning elsewhere in the code. That is why this list of
keys should be assigned a context.
The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.