Commit Graph

71396 Commits

Author SHA1 Message Date
Maarten Bent
01d8c1bf8e Improve wxComboCtrl popup position with multiple displays 2021-02-13 01:59:21 +01:00
YuSanka
76354fbc8d Fixed wxComboCtrlBase::ShowPopup() to show a popup control in respect to the display of the provided window instead of primary display. See issue The "Show" Dropdown list goes out of the screen #2999 (https://github.com/prusa3d/prusaslicer/issues/2999) 2021-02-13 01:56:12 +01:00
Tobias Taschner
e09063186c Provide generic wxWebView::Find() implementation
This implementation is based on javascript 'window.find()'
https://developer.mozilla.org/en-US/docs/Web/API/Window/find
It's not standard, but implemented in most browsers.

It's not a complete implementation as it can't determine how
many search results can be found.

If the backends API provides a native find interface it should be
used instead of this implementation, but it's good fallback.
2021-02-10 23:55:18 +01:00
Tobias Taschner
5512089d5b Apply suggestions from code review
Co-authored-by: VZ <vz-github@zeitlins.org>
2021-02-09 23:35:01 +01:00
Tobias Taschner
a3f85e9cd5 Implement wxEVT_WEBVIEW_FULLSCREEN_CHANGED in GTK 2021-02-09 22:28:29 +01:00
Tobias Taschner
1aad333ab9 Don't send wxWebViewEdge cancel event on veto
When vetoing a wxEVT_WEBVIEW_NAVIGATING a wxEVT_WEBVIEW_ERROR was send
this was unexpected and unnecessary.
2021-02-09 22:28:29 +01:00
Tobias Taschner
f6a23a0431 Add wxEVT_WEBVIEW_FULLSCREEN_CHANGED event
The event is triggered by wxWebView when the page requests fullscreen view.

It's currently only implemented for the edge backend.
2021-02-09 22:28:29 +01:00
Maarten Bent
36ab71301c Add CI check for mixed line endings
Trigger workflow on all file changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/2224
2021-02-09 22:17:13 +01:00
Tobias Taschner
693d946ffc DPI independent default size in WebView sample 2021-02-09 18:02:36 +01:00
Tobias Taschner
fea23a0be4 Handle in-document navigation with wxWebViewEdge
Send EVT_WEBVIEW_NAVIGATING, EVT_WEBVIEW_NAVIGATED and EVT_WEBVIEW_LOADED
when an anchor is clicked within a document. This kind of navigation
cannot be vetoed.

Fixes: #19074
2021-02-09 17:55:37 +01:00
Vadim Zeitlin
7a74c0872c Merge branch 'msw_webview_edge3' of https://github.com/TcT2k/wxWidgets
Make using wxWebViewEdge even simpler in CMake builds.

See https://github.com/wxWidgets/wxWidgets/pull/2223
2021-02-09 15:22:56 +01:00
Gary Allen
2da5129e13 Allow customizing all tool colours in wxRibbonMSWArtProvider
A number wxRIBBON_ART_TOOOL_XXX constants were not taken into account by
GetColour() and SetColour() for some reason, even though the class did
have the corresponding member colour variables.

Fix this by simply adding cases for them to the existing switch.

Closes https://github.com/wxWidgets/wxWidgets/pull/2225
2021-02-09 15:03:34 +01:00
Artur Wieczorek
279ee715fd Fix creating wxCairoBitmapData from wxImage with mask
If source wxImage has a mask we need to create ARGB32 Cairo surface (even
for RGB image) and based on the mask values set the alpha values to fully
transparent or retain original values.
2021-02-09 00:14:12 +01:00
Artur Wieczorek
c7667c16f8 Add tests of creating wxGraphicsBitmap from wxImage 2021-02-09 00:14:12 +01:00
Vadim Zeitlin
f2d5ff0121 Make wxNumValidator::m_value protected rather than private
This is useful for writing overridden TransferXXX() methods in the
derived validator classes, give a motivating example in the docs.

See https://github.com/wxWidgets/wxWidgets/pull/2222
2021-02-08 22:43:48 +01:00
Tobias Taschner
1ee05c54ed CMake: Download SDK when wxUSE_WEBVIEW_EDGE=ON
Automatically download the WebView2 SDK from nuget (official repo for the SDK)
when enabling wxUSE_WEBVIEW_EDGE to simplify usage.
Copying to 3rdparty/webview2 is still supported optionally.
2021-02-08 21:29:08 +01:00
New Pagodi
ab63e73920 Record active sockets in wxWebSessionCURL
If a wxWebRequestCURL object is canceled or deleted before its transfer
is complete, we need to manually close its active socket.  Record each
transfer’s active socket in wxWebSessionCURL::SocketCallback so can use
it if needed.

Previously, this was done using curl_easy_getinfo, but this required
some compile time and run time checks and could fail in some specific
cases. Recording the socket ourselves significantly simplifies the code
and should always work.
2021-02-08 12:32:32 -06:00
Artur Wieczorek
e74cc53775 Fix creating CGImage from wxBitmap
For internal purposes wxBitmap with mask should be converted to CGImage
with alpha values only (with no mask). This is i.a. needed to assure
compatibility of wxGraphicsBitmap format with other ports where these
bitmaps are in pure ARGB format.
2021-02-08 18:56:10 +01:00
Vadim Zeitlin
d4e5adf5d6 Merge branch 'webview_misc' of https://github.com/TcT2k/wxWidgets
More wxWebView miscellaneous improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2221
2021-02-08 13:50:25 +01:00
Vadim Zeitlin
b99c88767d Regenerated wxstd.pot using the new xgettext options
No real changes, ignore the huge diff which is due to reordering of all
the strings in this file after the changes of 87c56c7c1d (Do not sort
content of generated POT files alphabetically, 2021-01-23).

See https://github.com/wxWidgets/wxWidgets/pull/2214
2021-02-08 12:51:24 +01:00
Vadim Zeitlin
26eb738562 Merge branch 'drop-msw-it.po'
Remove platform-specific translations.

This is unnecessarily complicated for the single string that we
currently use this for, so just handle it specially.

Also some other minor translation-related improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2213
2021-02-08 12:50:43 +01:00
Vadim Zeitlin
0d3b04013f Merge branch 'cmake-benchmarks' of https://github.com/MaartenBent/wxWidgets
Add support for building benchmarks with CMake.

See https://github.com/wxWidgets/wxWidgets/pull/2220
2021-02-08 12:46:18 +01:00
Vadim Zeitlin
d6b8ed1e3c Merge branch '4238-fix-grid-multicell-editing' of https://github.com/discnl/wxWidgets
Fix grid multicell integrity after inserting/deleting rows/columns.

See https://github.com/wxWidgets/wxWidgets/pull/2192
2021-02-08 12:43:44 +01:00
Vadim Zeitlin
3978a0df0e Check stream error in LastRead() unit test too
It doesn't make sense to call LastRead() if an error happened while
reading, so check if it did.
2021-02-08 12:42:54 +01:00
Tobias Taschner
1cd0904260 Fix mixed line breaks in webview sources 2021-02-08 11:27:49 +01:00
Tobias Taschner
e0c705648f Add missing wxOVERRIDE to wxWebViewFactoryWebKit 2021-02-08 09:20:53 +01:00
New Pagodi
7105499561 Make wxWebRequestCURL's progress callbacks static 2021-02-08 01:06:56 -06:00
New Pagodi
4c8f9ff34d Cancel a transfer if socket poller operation fails
When using the socket poller implementation using wxEventLoopSource
objects to monitor sockets, the operation
wxEventLoopBase::AddSourceForFD(... can sometimes return NULL. In these
cases the socket will not be monitored as needed. The only option seems
to be to cancel the transfer and report a failure
2021-02-07 20:56:27 -06:00
New Pagodi
252a920bd7 Use main thread for the socket poller if possible
On windows and systems where wxUSE_EVENTLOOP_SOURCE is 1, it is
possible to monitor socket descriptors for activity from the main
thread. The SocketPoller class used with wxWebSessionCURL is modified
to use an implementation class that does so.

On windows, the implementation uses the winsock1 function
WSAAsyncSelect to send events to wxWebSessionCURL when activity is
detected. When wxUSE_EVENTLOOP_SOURCE is 1, a wxEventLoopSource is used
to monitor for socket activity. The event loop source is given a custom
wxEventLoopSourceHandler object to send the necessary event.
2021-02-07 20:55:24 -06:00
New Pagodi
88dca37b3f Change cancel method for wxWebRequestCURL objects
Previously wxWebRequestCURL objects were canceled by removing their
CURL easy handle from the CURLM multihandle. Unfortunately the really
only pauses the connection and does not truly cancel it. This commit
tries to stop the transfer by retrieving the active socket from the CURL
handle for the transfer and closing it.

There are some complications in doing this because the option curl uses
to get the socket have changed over the years. A combination of compile
time and run time checks are used to use the appropriate options to get
the socket. However in the case of 64bit windows using a curl version
older than 7.45.0 simply won’t have an usable option. In this case,
it seems nothing can be done.
2021-02-07 20:49:50 -06:00
New Pagodi
774a752bed Track active transfers in wxWebSessionCURL class
At various points in a transfer being managed by the wxWebSessionCURL
class we need to perform operations on a wxWebRequestCURL object.
However it’s possible for the request object to be deleted while the
transfer is in progress.

To ensure that the request objects are valid, keep track of the request
objects with a hash map. Objects are added to the map when a transfer is
started and removed when the transfer is complete or in the request’s
destructor.
2021-02-07 20:49:37 -06:00
New Pagodi
b0b53e8db3 Check wxWebSessionCURL::StartRequest really starts 2021-02-07 20:48:12 -06:00
New Pagodi
48cba4f88e Set wxWebResponseCURL buffer size as soon as known
Currently for wxWebRequestCURL objects using memory storage, a download
is processed by appending to a wxMemoryBuffer each time the write
callback is called. For a large transfer, this can result in many, many
reallocation calls and can block the main application.

This commit uses the progress callback for wxWebRequestCURL objects
added in a previous commit to set a minimum size for the buffer as soon
as it is known.
2021-02-07 20:43:51 -06:00
New Pagodi
3e5fd5462d Add a progress callback for wxWebRequestCURL
This commit adds a progress callback for use with wxWebRequestCURL
objects. This has some complications because over the years curl has
changed the signature of the callback.

A combination of compile-time and run-time checks is used to make sure
the appropriate callback and preferred return value are used.
2021-02-07 20:37:47 -06:00
Dimitri Schoolwerth
cc239f36cc Remove doc warning regarding wxGrid multicells and deletion
Since the parent commit multicells work correctly when deleting (and
inserting) rows (or columns) intersecting with them and the comment
warning about it resulting in a crash is no longer needed.

This reverts commit 4d8e8355b4 (Added a warning about multi-cells in
wxGrid::DeleteRows() docs., 2011-12-25).

See #4238.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
3123c76394 Fix grid multicell integrity after inserting/deleting rows/columns
Deal with possible size changes of a multicell (both main and inside
cells) when inserting or deleting rows or columns and, in the case of
deletion only, the disappearing of a multicell's main cell.

Closes #4238.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
d282ccf696 Add grid tests for multicell integrity after insertions/deletions
Multicells currently don't get any special treatment when inserting
or deleting rows or columns so neither a multicell's main size nor
inside cells' sizes (which are offsets to the main cell) are updated.
Most tests fail and will be fixed by the next commit.

See #4238.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
04a3dda5c5 Refactor common wxGridCellAttrData::UpdateAttrRows/Cols code
Move two symmetrical functions into one and clean up, preparing it for
multicell support.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
30de99470a Add multiple insertion support to grid sample
Only single insertions of rows and columns were supported, allow N
insertions provided the row/column selection is consecutive.
Do the same for deletions: while deleting selected rows and columns
already works it's useful to test deleting multiple positions at once.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
058192dde8 Add a few accelerators to menu items of grid sample
Add convenience accelerators for insert and delete menu options.
2021-02-07 22:59:02 +01:00
Dimitri Schoolwerth
bc7e5ffc56 Add basic tests for wxGrid cell attribute presence and count
Do some simple sanity checks with attributes, particularly overwriting
a cell with NULL attribute (as was already checked very usefully in
the grid sample for ref count reasons), and their total count in a grid
when inserting and deleting rows and columns.

While the tests are not particularly useful for the next intended grid
change, they do contain some functions that also work for upcoming tests
so these (harmless) tests are included as well.
2021-02-07 22:59:02 +01:00
Tobias Taschner
8a9db461ff Implement wxWebView::GetVersionInfo() for macOS
Return the operating system version as the WebKit
version used by WKWebView is bound to the OS.
(Also works for iOS)
2021-02-07 22:14:18 +01:00
Tobias Taschner
334872e726 Notify WebView2 API when minimizing a window with wxWebView
As suggested by the ICoreWebView2Controller documentation
call put_isVisible() when the window containing the
wxWebViewEdge is minimized/restored.
2021-02-07 21:48:02 +01:00
PB
623e6a4fc3 Make wxWebViewEdge visible after creating
Fixes: #18851
2021-02-07 21:33:28 +01:00
Maarten Bent
b3b5cde7f5 CMake: Mark some build options as advanced 2021-02-07 20:34:42 +01:00
Maarten Bent
9585e08365 CMake: Add benchmarks
Put each benchmark application in a sub-directory instead of specifying all in one
file, because cotire cannot create PCH targets for the same file twice (bench.cpp).
2021-02-07 20:34:42 +01:00
Maarten Bent
7b79423470 CMake: Add argument to specify console app that uses gui libraries 2021-02-07 20:11:56 +01:00
New Pagodi
f406fcd12a Fix compilation of SocketPoller class on windows 2021-02-07 00:02:04 -06:00
VZ
38510d8e89 Normalize whitespace
No real changes.
2021-02-07 00:02:04 -06:00
New Pagodi
b1b53ed85c Remove the worker thread from wxWebSessionCURL
Instead of having wxWebSessionCURL run a worker thread that uses curl
to monitor and process network activity, set up a separate socket
poller class to monitor socket activity. The socket poller class will
throw an event back to wxWebSessionCURL when it detects activity on the
sockets so that it can tell curl to process the activity in the main
thread.
2021-02-07 00:02:04 -06:00