Commit Graph

71396 Commits

Author SHA1 Message Date
Vadim Zeitlin
eb60684ac7 Make log window in the grid sample expand too
It is too small to show more than a few lines of logs otherwise.
2020-08-20 17:06:09 +02:00
Vadim Zeitlin
4b918966f6 Refactor logging of wxGridRangeSelectEvent in the grid sample
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.
2020-08-20 16:56:23 +02:00
Vadim Zeitlin
9e27efb2cb Further improve wxEVT_GRID_RANGE_SELECT{ED,ING} documentation
Explain when it is preferable to handle events of each kind.
2020-08-20 16:56:23 +02:00
Vadim Zeitlin
e2f316b19d Mention that wxEVT_GRID_RANGE_SELECT{ED,ING} are new in 3.1.5
Also explained that SELECTED is just the new spelling of SELECT.
2020-08-20 16:56:03 +02:00
Ilya Sinitsyn
39725cabd4 Fix wxGrid selecting mode ending condition 2020-08-20 16:56:03 +02:00
Ilya Sinitsyn
0a2c62fc5c Remove the selecting mode flag from wxGridSelection
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.
2020-08-20 16:56:03 +02:00
Daniel Kulp
decc255846 Update grid sample to show selecting events 2020-08-20 16:56:03 +02:00
Daniel Kulp
415f080c80 Split wxGrid RANGE_SELECT event into SELECTING and SELECTED
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.
2020-08-20 16:56:03 +02:00
Maarten Bent
8cb0d0741c Don't iterate all item of wxListCtrl on DPI change
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.
2020-08-19 21:35:49 +02:00
Maarten Bent
c661be4fc9 Make custom renderer in dataview sample DPI Aware 2020-08-19 21:35:49 +02:00
Maarten Bent
6f7f387b1b Use GDI Scaling for dpi-unaware system dialogs
Fall back to system scaling when GDI scaling fails or is unavailable.
2020-08-19 21:35:48 +02:00
Paul Cornett
5192feb38e Fix restoring TLW size when using wxPersistenceManager on GTK
The decoration size must be restored before restoring the window size
See #18863
2020-08-18 08:46:19 -07:00
Arrigo Marchiori
a63ef850fb Also mention --flavour in wx-config script
The parameter is already supported but not documented.
2020-08-18 15:47:33 +02:00
Vadim Zeitlin
d5f5376e95 Remove useless "Modified by:" header line
This is not needed nor used since a long time any longer.
2020-08-17 02:04:59 +02:00
Vadim Zeitlin
8e1f2adc3b Add wx/artids.h to build/files and rerun upmake and bakefile
Finish adding the new file, which was previously added manually to a
couple of files, but not everywhere.
2020-08-17 02:03:45 +02:00
Vadim Zeitlin
21b37aa88e Add ctor to wxArtStockMapping to fix C++98 build
Can't use aggregate initialization without C++11.
2020-08-17 02:01:11 +02:00
Vadim Zeitlin
b6a369bd86 Remove trailing blank line from the new wx/artids.h file
No real changes.
2020-08-17 01:58:45 +02:00
Vadim Zeitlin
ae1bcc5cb2 Show only the first difference when images differ in the tests
The code was supposed to do this, but didn't, as "break" only broke from
the inner loop, but not the outer one, so replace it with "return".
2020-08-15 16:16:45 +02:00
Vadim Zeitlin
5324b9f184 Update libtiff and expat to allow using them with CMake
These changes are required in order to use the built-in versions of
these libraries with CMake.
2020-08-15 15:42:25 +02:00
Vadim Zeitlin
41142dff20 Make a minor optimization in Mac wxDisplay::GetFromWindow()
Call GetContentScaleFactor() only once, which doesn't cost anything and
could be minutely faster on systems with multiple displays.
2020-08-15 00:28:32 +02:00
Stefan Csomor
08a63c3b49 use common contentScaleFactor also for DPI on macOS
and give a reasonable default for missing tlw
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
c346fd0321 Show scale factor in the display sample too
Show it for consistency with all the other wxDisplay accessors and to
make it simpler to test its return value.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
434faa39e6 Remove unused wxDisplayImpl::GetSizeMM()
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.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
bcb101b9e9 Simplify PPI and scale factor handling in wxDisplay
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.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
4e6df3f7b2 Implement GetDPIScaleFactor() more directly for wxMSW too
Use the existing GetDPI() implementation instead of forwarding to
wxDisplay.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
6a820a8f9a Implement GetDPIScaleFactor() more efficiently in wxGTK
Don't pass via wxDisplay, but use gtk_widget_get_scale_factor() (almost)
directly instead.
2020-08-15 00:28:32 +02:00
Stefan Csomor
99f7c8f3a4 using common method for determining scale from displayID 2020-08-15 00:28:32 +02:00
Stefan Csomor
7dc67a1f9f making GetDPIScaleFactor virtual, adding macOS direct impl 2020-08-15 00:28:32 +02:00
Stefan Csomor
8bad3b5e80 macOS clientRect implementation for non-primary displays 2020-08-15 00:28:32 +02:00
Stefan Csomor
d5180d3604 add a GetFromWindow implementation to wxDisplayFactory
on displays with different resolutions we must make sure we pick one that matches the frame’s contentScale
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
f04c904b60 Improve wxTaskBarIcon::Create/GetPopupMenu() documentation
Try to make the text more clear and prescriptive.

Also add a "@since" tag.
2020-08-14 19:48:29 +02:00
Vadim Zeitlin
c5161f6296 Get rid of an unnecessary local variable
No real changes, just simplify the code a bit more.
2020-08-14 19:43:00 +02:00
Vadim Zeitlin
cdd68da370 Use wxScopedPtr<> instead of explicit calls to "delete"
No real changes, but the code is a bit safer and hopefully more clear.
2020-08-14 19:41:53 +02:00
Andreas Falkenhahn
c70a8261cb Add wxTaskBarIcon::GetPopupMenu()
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.
2020-08-14 19:33:38 +02:00
Vadim Zeitlin
5a27ea9a86 Merge branch 'fix_grid_deselect' of https://github.com/swt2c/wxWidgets
Fix regression in wxGrid::DeselectRow() and wxGrid::DeselectCol() and
add unit tests for them.

See https://github.com/wxWidgets/wxWidgets/pull/2017
2020-08-14 19:27:48 +02:00
PB
a4647825cb Do not use wxRegEx in wxCmpNaturalGeneric()
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
2020-08-14 19:26:33 +02:00
Vadim Zeitlin
8e2aad2621 Merge branch 'webview_ie-js' of https://github.com/MaartenBent/wxWidgets
Fix using JavaScript in wxWebViewIE with custom scheme.

This repairs a regression in 3.1.4 due to the changes of 6787b0548b
(Merge branch 'webview-ie-fixes', 2020-07-23).

See https://github.com/wxWidgets/wxWidgets/pull/2004
2020-08-14 19:23:27 +02:00
Teodor Petrov
90082b002d Fix configure errors when using GTK 2 and ASAN
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
2020-08-14 19:19:46 +02:00
Teodor Petrov
c924ecb10a Suppress -Wsuggest-override warnings in user code for gcc too
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
2020-08-14 19:15:03 +02:00
Stefan Csomor
16ff1f8f7c macOS Implementation for wxDisplay::GetScaleFactor 2020-08-14 16:09:27 +02:00
Vadim Zeitlin
f572797965 Use wxDisplay::GetScaleFactor() in wxWindow::GetDPIScaleFactor()
This can be more direct and efficient than computing the ratio of DPIs
in wxWindow.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
19fd0fcfd7 Add wxDisplay::GetScaleFactor()
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).
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
e902050002 Return "logical" PPI from wxDisplay::GetPPI() in wxGTK3
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.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
52b25211c8 Add wxDisplay::GetStdPPIValue() and GetStdPPI()
Provide public way to access the default platform DPI, which was
previously a constant private to src/common/wincmn.cpp.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
19db07d668 Fix broken MSW tags generation script
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.
2020-08-14 15:55:41 +02:00
Vadim Zeitlin
c80e529021 Fix crash when destroying wxPopupWindow without hiding it first
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.
2020-08-14 13:15:49 +02:00
Vadim Zeitlin
bb93682a87 Improve wxGrid selection test slightly
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.
2020-08-14 12:41:10 +02:00
Vadim Zeitlin
4475df8264 Add unit tests for wxGrid::Deselect{Row,Col}()
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.
2020-08-14 12:36:46 +02:00
Scott Talbert
9be1f86ca0 Fix regression in wxGrid::DeselectRow() and wxGrid::DeselectCol() 2020-08-13 20:01:45 -04:00
Vadim Zeitlin
e96155fece Fix and improve wxDC background mode documentation
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.
2020-08-13 23:08:58 +02:00