Commit Graph

38841 Commits

Author SHA1 Message Date
Tobias Taschner
bbde6e2e88 Move wxWebViewEdge implementation to private header 2020-01-15 21:23:37 +01:00
Tobias Taschner
0d00af5913 Add wxLogApiError() to important WebView2 API calls 2020-01-15 17:05:34 +01:00
Tobias Taschner
bf6b51e702 Various small code fixups 2020-01-15 17:05:27 +01:00
Tobias Taschner
bce0e65a80 Rename wxWebView::IsDevToolsEnabled() to IsAccessToDevToolsEnabled() 2020-01-15 16:22:43 +01:00
Tobias Taschner
e20296fee2 Remove explicit check for Windows 7 2020-01-15 16:17:45 +01:00
Tobias Taschner
dea80692b4 Use wxDL_INIT_FUNC() macro 2020-01-15 16:13:26 +01:00
Tobias Taschner
c3f0b7a6cb Apply suggestions from code review
Co-Authored-By: VZ <vz-github@zeitlins.org>
2020-01-15 15:55:49 +01:00
Tobias Taschner
1f1202807b Implemented wxWebViewEdge::Print() 2020-01-11 15:06:29 +01:00
Tobias Taschner
a1a155618e Set Edge data folder to UserLocalDataDir 2020-01-11 14:59:08 +01:00
Tobias Taschner
f919b6e2f5 Rename from webview_edgec to webview_edge 2020-01-11 14:47:47 +01:00
Tobias Taschner
d72e5874eb Add wxWebView methods to enable dev tools
Currently only implemented for the Edge (Chromium) backend.
2020-01-10 22:27:36 +01:00
Tobias Taschner
6750d30102 Load WebView2Loader.dll dynamically 2020-01-10 22:22:29 +01:00
Markus Pingel
6a99e7e273 Add wxWebView Edge (Chromium) implementation
This backend requires WebView2 SDK and enables usage of Edge (Chromium)
on Windows 7 and newer
2020-01-10 22:22:28 +01:00
Tobias Taschner
095a93e0c0 Add wxWebView::IsBackendAvailable()
This allows to check if a specified backend has been registered before creation of a new instance
2020-01-09 13:44:06 +01:00
Steve Browne
bb14c5f69b Preserve mask when copying wxBitmapRefData to avoid crashes
This crash was introduced in 2d15218c9d
and could happens inside wxBitmap::MSWBlendMaskWithAlpha() because the
code checked for a mask and alpha, but the mask could be lost after
AllocExclusive().

In practice, this happened e.g. when using 16-bit color as is the case
for Windows 7 Hyper-V VMs.

Closes https://github.com/wxWidgets/wxWidgets/pull/1695
2020-01-07 16:56:50 +01:00
Vadim Zeitlin
d52331046c Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:22:52 +01:00
Vadim Zeitlin
b2ab6c99e4 Fix wxCommandEvent::GetString() for wxSearchCtrl events
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.

Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
2020-01-07 03:22:39 +01:00
Vadim Zeitlin
826cc882dc Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:16:02 +01:00
Vadim Zeitlin
d62b79a11b Fix wxCommandEvent::GetString() for wxSearchCtrl events
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.

Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
2020-01-07 03:15:39 +01:00
ali kettab
020b6ebcb8 Derive from wxTextEntry instead of wxTextCtrlBase 2020-01-07 03:15:39 +01:00
AliKet
c09db9c23d Add native wxSearchCtrl for GTK+ port 2020-01-07 03:15:35 +01:00
Paul Cornett
833ae03c6a Draw bitmap in disabled state when wxStaticBitmap control is not enabled on GTK3
See #18638
2019-12-29 09:14:08 -08:00
Paul Cornett
8db62d179c Move code for creating a disabled bitmap to wxBitmap
To allow using it from multiple places
2019-12-29 09:08:40 -08:00
Vadim Zeitlin
dda052d38a Fix activation loss when hiding floating frame TLW in wxMSW
Generalize the fix of d6fb86a81c and
explicitly activate the parent when a TLW with wxFRAME_FLOAT_ON_PARENT
style is hidden or minimized and not only when it is destroyed.

Closes #18535.
2019-12-29 16:47:49 +01:00
Vadim Zeitlin
8b90073c83 Send kill focus events to modal dialogs earlier in wxGTK
Ensure that the dialog is still alive when it gets the kill focus event
for its child which had focus just before the dialog was closed (or any
other events generated by this child when it detects that it's losing
focus, such as wxEVT_SPINCTRL) by resetting focus when the dialog is
being hidden and not when it's being destroyed.

This makes the events order more consistent with wxMSW but also, most
importantly, safer, as wxEVT_KILL_FOCUS handlers could previously easily
reference the fields of an already half-destroyed wxDialog-derived
object by the time they were run during wxTopLevelWindowGTK destructor
execution.

Closes #18145.
2019-12-29 01:40:28 +01:00
Artur Wieczorek
38cec22d4c Use division assignment operator to simplify the statement 2019-12-28 23:34:17 +01:00
Artur Wieczorek
c6e188610d Don't allocate colour tables if palletes are not in use 2019-12-28 23:32:34 +01:00
Paul Cornett
8b2f413b42 Fix wxStaticBitmap with HiDPI bitmaps for GTK3
See #18638
2019-12-28 13:07:28 -08:00
Vadim Zeitlin
bcb0d42d7a Fix harmless warning from the last commit
This is yet another fix related to recent wxBMPHandler changes: this one
is trivial, as it just avoids gcc signed/unsigned comparison warning,
but is still needed for the clean build.

See #18634.
2019-12-28 02:36:07 +01:00
Vadim Zeitlin
ca065c5004 Fix Unix build by avoiding the use of BITMAPINFOHEADER struct
The code from the previous commit used sizeof(BITMAPINFOHEADER), but
this struct is only defined under MSW, so this broke the build under the
other platforms.

Luckily, we don't actually need the struct itself, but just its size, so
simply hardcode it here as it's fixed (part of the BMP format) and not
going to change.

See #18634.
2019-12-28 02:19:54 +01:00
Eric Jensen
cccda9ef6b Fix loading colour palette from BMP file
Only BITMAPINFOHEADER data are explicitly read and processed so for a bitmap
with BITMAPV4HEADER or BITMAPV5HEADER we have to forward stream position
to the end of the actual header in order to start reading colour table
from the right position.

Closes #18634.
2019-12-28 00:18:10 +01:00
Vadim Zeitlin
d583fb017b Merge branch 'msw-thread-priority'
Fix wxThread::SetPriority() documentation and avoid a spurious error
message.

Closes https://github.com/wxWidgets/wxWidgets/pull/1683
2019-12-28 00:06:40 +01:00
Vadim Zeitlin
2c4f42608b Avoid spurious error from wxThread::SetPriority() in wxMSW
Just skip calling ::SetThreadPriority() if the thread hadn't been
created yet: this was useless and just resulted in an error message.
2019-12-28 00:06:27 +01:00
orbitcowboy
a7f31db8cd Fix mismatching delete in wxList code
Use delete, not free, to free a pointer allocated with new.

Closes https://github.com/wxWidgets/wxWidgets/pull/1686
2019-12-23 16:50:39 +01:00
orbitcowboy
6e6e1cf25b Fix mismatching delete in wxTarOutputStream code
Free the buffer allocated with new[] using delete[] and not just
"delete".

Closes https://github.com/wxWidgets/wxWidgets/pull/1685
2019-12-23 16:49:06 +01:00
Vadim Zeitlin
dcb1f9e8f7 Fix another mismatching delete in IFF image handler code
This is similar to the previous commit and fixes the same problem in
another place.

See https://github.com/wxWidgets/wxWidgets/pull/1684
2019-12-23 16:48:06 +01:00
orbitcowboy
3b52ed60bb Fix mismatching delete in IFF image handler code
Use delete[] for a buffer allocated with new[].

Closes https://github.com/wxWidgets/wxWidgets/pull/1684
2019-12-23 16:46:22 +01:00
Artur Wieczorek
9689bd124e Use optimized function to draw horizontal/vertical lines only with wxCOPY raster operation mode
Optimized function to draw H/V lines is based on ExtTextOut() API and therefore raster operations modes other than wxCOPY are not applicable.

Closes #18635.
2019-12-19 22:36:59 +01:00
Jouk
d90953d8c6 wxGTK1 : change type of wxMask.GetBitmap() from GdkBitmap* to wxBitmap 2019-12-19 09:20:36 +01:00
Vadim Zeitlin
7ecb687f24 Merge branch 'mac-dvc-check-icons'
Add back support for icons to Mac wxDataViewCheckIconTextRenderer OSX.

See https://github.com/wxWidgets/wxWidgets/pull/1680
2019-12-17 02:07:33 +01:00
Vadim Zeitlin
854b61cd05 Merge branch 'generic-dvc'
Add option for using generic wxDataViewCtrl and fixes to make it work
under GTK and Mac.

See https://github.com/wxWidgets/wxWidgets/pull/1680
2019-12-17 02:06:15 +01:00
Stefan Csomor
df6304caa6 add baselineOffset override to better align icons
Cocoa by default aligns the cell on the text baseline, which is not suitable for our needs, solved by subclassing NSTextAttachmentCell
2019-12-16 16:28:08 +01:00
Vadim Zeitlin
20269a58c0 Avoid spurious assert failures in wxGenericStaticBitmap
Don't trigger a confusing assertion failure about unknown scale mode if
a 0-sized window is being repainted.

It's not clear why should an empty window get repaint events in the
first place, but this does happen, at least under MSW, so guard against
it.
2019-12-16 15:08:35 +01:00
Vadim Zeitlin
b16a1453af Fix the build of Expat library with 32 bit TDM-gcc 5.1
Update to the version of Expat submodule which avoids the use of
rand_s() when using this old (but otherwise still supported) compiler.

Closes #18631.

Closes https://github.com/wxWidgets/wxWidgets/pull/1679
2019-12-16 15:04:55 +01:00
Vadim Zeitlin
7fa1afafc2 Re-add support for icons to Mac wxDataViewCheckIconTextRenderer
Icons were not supported any longer since the switch to the native
implementation in 235e61c311.

Restore them now by using text attachments (thanks to Scott B for the
idea). The vertical alignment is still not right, but it's better than
nothing.

See #17473.
2019-12-15 19:27:58 +01:00
Vadim Zeitlin
50ba73cbf4 Fix using unknown selector in Mac wxDataViewCtrl code
Don't call -[NSCell setTextColor:] unless it really handles it: testing
for "colText" validity was insufficient, as it could be set as a
fallback.

Also move the fallback assignments inside the branches where they're
really used.

This fixes a bug introduced in 540fed9216,
see https://github.com/wxWidgets/wxWidgets/pull/1673
2019-12-15 19:26:18 +01:00
Vadim Zeitlin
24042b2a2a Fix build with generic wxDataViewCtrl under Mac
Generic wxDataViewCheckIconTextRenderer is needed under Mac too if the
generic version of wxDVC is used.

Closes #18632.
2019-12-15 16:44:42 +01:00
Vadim Zeitlin
4203104d54 Fix using wxTreeListCtrl with generic wxDataViewCtrl in wxGTK
Restrict GTK workaround in wxTreeListModel::IsContainer() to the native
version, it does have a drawback when using the generic one as it
resulted in all items having the expander button.

See #18632.
2019-12-15 16:26:18 +01:00
Vadim Zeitlin
55f148a2ea Avoid asserts when moving mouse in empty wxGridColLabelWindow too
The changes of the previous commit were insufficient, as we could also
use an invalid column index when handling mouse event in an empty grid.

Fix this by checking for the line validity in PosToEdgeOfLine() instead
of adding another ad hoc check to wxGridColLabelWindow itself, as it
seems reasonable for this function to verify that it uses valid indices.

See #18629.
2019-12-14 00:03:01 +01:00
Vadim Zeitlin
9c1e8fde8f Avoid asserts when painting empty wxGridColLabelWindow
When the grid is empty, XToCol() has no choice but to return invalid
index (because there are no valid ones) when it's called from the
drawing code and passing such indices to GetColPos() results in an
assert, which is fatal inside wxEVT_PAINT handler.

Just short-circuit all this code by not doing anything in the case of
empty grid. This is sloppy, but simpler and more robust than any
alternatives.

Closes #18629.
2019-12-13 16:19:47 +01:00