Avoid duplicating the complicated logging code twice, when it's exactly
the same for both the SELECTED and SELECTING events. Just use a common
helper function instead.
Remove m_isSelecting and StartSelecting() from wxGridSelection to avoid
inconsistency of wxGridSelection selecting mode state with wxGrid state,
as wxGrid already has m_isDragging field which tells it if the selection
state is final or not.
Instead, just allow wxGrid to specify the event to send from
ExtendCurrentBlock().
We still need a separate EndSelecting() for sending the final
wxEVT_GRID_RANGE_SELECTED event, but send it only for the last selection
block, and not all the selected blocks, as this makes more sense (there
should be one SELECTED event for each block and it was already sent for
the other blocks before) and is consistent with the events generated
when performing the same actions from keyboard.
This will allow the applications that are only interested in the final
selection to ignore the intermediate SELECTING events, which are now
sent as soon as the selection changes while dragging the mouse, and only
handle the final SELECTED ones, when the drag is over.
This can take multiple seconds in big lists, meanwhile the UI is frozen at the
display border. Adjust the font of the attribute to the DPI when it is used for
drawing.
This is not needed any longer after the changes of the last commit.
Note that the (still existent) public wxGetDisplaySizeMM() didn't use
this function, but used PPI instead.
Don't try computing the PPI ourselves from the physical size and the
number of pixels, this doesn't work and nobody else does it like this.
Just assume that we're using standard PPI by default and use
toolkit-specific functions for the platforms with support for high DPI.
This is similar to CreatePopupMenu(), but the menu pointer returned by
the new function won't be deleted by wxWidgets, allowing it to return
the same pointer every time it is called.
Closes#18886.
Using wxRegEx in wxCmpNaturalGeneric() introduced a dependency of the
base library on the regex library.
Replace wxRegEx with character classification functions wxIsspace(),
wxIspunct(), and wxIsdigit() to remove this rather unnecessary
dependency.
Closes https://github.com/wxWidgets/wxWidgets/pull/2014
Memory leaks in the test programs run by configure when using GTK 2
result in configuration failures when using -fsanitize=address in
{CXX,LD}FLAGS, so fix these leaks to allow configuring using
"CXXFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address" together with
--with-gtk=2 (this already worked correctly with the default GTK 3).
Closes https://github.com/wxWidgets/wxWidgets/pull/2001
This was already done for clang -Winconsistent-missing-override, but
gcc has a similar warning since 5.1 and, moreover, latest versions of
clang support this gcc warning as well, so add a special macro which
handles both compilers and use it in all wx macros defining virtual
functions instead of just disabling one of the clang warnings.
Closes https://github.com/wxWidgets/wxWidgets/pull/2000
This is conceptually the same as the ratio of the current DPI to the
standard one, but can be implemented more directly for wxGTK3 and wxOSX
(although the latter doesn't implement it yet).
Just scale the standard PPI by the scaling factor instead of trying to
compute the actual physical PPI, as the latter is not useful and is
incompatible with the value used by all the other applications.
Add "--recursive" option which is needed since the changes of 37cf80240b
(Exclude unwanted files in wxMSW tags script, 2020-01-31) as otherwise
no files were parsed at all.
The global wxCurrentPopupWindow used by wxMSW wasn't reset in this case
and resulted in a crash during the next mouse or focus event.
Do it in wxPopupWindow dtor now, and not just when the popup is hidden.
Check that deselecting a row leaves the cells outside of this row
selected.
This requires passing "true" to the previous call of SelectRow() to
prevent it from clearing the existing selection, as it does by default.
These functions got broken by the changes of cdf3187fe5 (Improve rows,
columns and cells deselection in wxGrid, 2020-03-26), but this went
unnoticed because they were not covered by the unit tests, so add the
tests for them to prevent this from happening again in the future.
Use wxBRUSHSTYLE_SOLID/TRANSPARENT constants instead of wxPENSTYLE_XXX
ones, as even though they have the same values, using brush style for
the background makes more sense.
Also document that the default background mode is transparent.