This makes the list of the fonts much more readable, compared to listing
them in essentially random order.
Incidentally stop using manual memory allocation to avoid giving a bad
example.
Compare the row position with the number of rows, not columns, fixing a
regression introduced in 3719ab3725 (Add support for rearranging wxGrid
rows order interactively, 2022-04-02) (see #22260).
Closes#22420.
Closes#22423.
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.
This is easy to do and can be useful when using an atomic initialization
counter.
The only platform where not returning the new value might be more
efficient than returning it is Solaris which is not really relevant any
more and on all the other platforms the functions we were already using
provided this value already (or almost, in case of using gcc builtins,
when we just have to use a different one).
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.
HasValue() is already called by PrepareForItem(), so there is no need to
call it explicitly from wxGTK code, just rely on PrepareForItem()
returning false if there is no value to show -- we can skip the call to
GtkSetCurrentItem() in this case, this function is cheap, and we lose
more by calling HasValue() twice in the common case than we save on not
calling it.
No real changes.
This is intentional and won't be changed, although we could, perhaps,
add a wxGetDST() function or similar to make it easier to take DST into
account as well.
Closes#22399.
No real changes, just get rid of a trivial helper function which is only
used once since the changes of the previous commit and copy its code
directly into the caller.
For some reason, calls to wxGtkTreeSetVisibleProp() were skipped when
using virtual list model in wxGTK implementation, resulting in showing
the value of the previous (i.e. upper) cell for the rows of this model
for which no value was available.
Simply remove IsVirtualListModel() checks and always set the cell
visibility to fix this.
This commit is best viewed ignoring whitespace-only changes.
Don't offset the DC in the unwanted direction as this resulted in not
drawing anything at all when the grid was scrolled.
Also fix off by one error in the marker line length.
Closes#22403.
Keys such as Ctrl-C etc could be unexpectedly intercepted by
accelerators defined for the menu items when wxSpinCtrl had focus.
Fix this by always preprocessing such keys in wxSpinCtrl itself, just as
it was already done for wxTextCtrl and even reuse the same function for
doing it (which had to be factored out in order to allow it).
Closes#22404.
Ensure that the accelerators using non-English strings are recognized
properly again, provided the translations for these prefixes are
available, just as it was the case before the changes of e6abc4ca12
(Update message catalogs after adding keyboard key context, 2022-04-27)
See #22354.
Closes#22388.
There are several ways to do it, and it's not clear which one of them
should be illustrated here, but it should definitely be one that works.
Closes#22389.
Don't take the value of "mask" parameter of wxImageList constructor too
prescriptively, it predates support for alpha in wxWidgets by many years
and was never meant to actually suppress using it.
Instead, do the best thing we can in all cases, i.e. use alpha if it's
specified and supported and use mask otherwise. But only create the mask
from light grey colour if we have nothing else if "mask" is true in
wxImageList constructor, as this is a potentially destructive action
that must not be performed if the user has explicitly decided to set
this parameter to false.
Incidentally fix handling of alpha with comctl32.dll v5 (which is used
in the absence of any manifest) by converting it to a mask in this case:
this is not ideal, but better than just using black background as it
happened before, and restores pre-3.1.5 behaviour.
Also simplify the generic version which just has to create the default
mask if necessary and doesn't have to do anything at all in all the
other cases.
Note that these changes required relaxing some of the existing unit
tests as wxMSW implementation now can add alpha channel to the bitmaps
that didn't have it -- but this is a more useful behaviour, and so it
makes more sense to adapt the tests to it rather than doing a less
useful thing just to conform to the tests.
This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-spac options.
Closes#22349.
Allow reusing the code for creating a mask from wxImage mask from
elsewhere.
No real changes yet, this is a just a refactoring.
This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-space options.
Add information about the recommended way of using wxFrame
as a form, i.e., to not create the input controls as its
direct children but use wxPanel for this instead.
Closes#22395.
Increase usable scrolling range in wxMSW by a factor of 10,000 by
switching to handling the device origin in wxWidgets itself instead of
letting GDI handle it.
See #22382.
Reuse the same code for handling mouse events for both rows and columns
instead of duplicating almost (but not quite) the same code for both of
them.
As part of resolving the inconsistencies between the two versions, add
wxEVT_GRID_ROW_AUTO_SIZE corresponding to the existing event with the
same name for the columns.
Closes#22380.
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.