Commit Graph

71396 Commits

Author SHA1 Message Date
Dimitri Schoolwerth
b86bcb09ce Travis CI: Use default target for CMake iOS build
Remove an explicitly set CMAKE_OSX_DEPLOYMENT_TARGET from the CMake iOS
build in order to use the default value which is now also set to an iOS
instead of macOS version.
2021-01-08 13:03:24 +01:00
Dimitri Schoolwerth
086ad7bc9a CMake: Fix out of sync iOS/macOS deployment target
The minimal sample doesn't have an implicit deployment target set, while
the library does through CMakeLists.txt in root. This can result in iOS
link errors when not explicitly setting CMAKE_OSX_DEPLOYMENT_TARGET as
the sample will then use a target OS with an architecture that may not
be present in the library with its current target OS version.

Fix by copying the part setting CMAKE_OSX_DEPLOYMENT_TARGET in the
library to the minimal sample as well. Both parts should be kept in sync
but that still seemed preferable to additionally polluting an example
file for CMake usage with a dependency by introducing a common include
file.
2021-01-08 13:02:30 +01:00
Dimitri Schoolwerth
161ecbf01d CMake: Separate minimal support for iOS and macOS
Differentiate between the minimal supported version of macOS (10.10)
and iOS (12.0) instead of setting CMAKE_OSX_DEPLOYMENT_TARGET to
(macOS-only) 10.10 for both platforms.
2021-01-08 13:00:02 +01:00
Jouk
003d24d3c1 workaround for which is probably a compiler-bug on OpenVMS-AXP 2021-01-07 09:47:46 +01:00
Vadim Zeitlin
ec2ea5c7fa Handle request still in progress gracefully on shut down
Cancel the request and wait until it actually is cancelled when exiting
the sample.

This is a bit ugly, especially the busy-waiting part, but still better
than potentially crashing.
2021-01-06 23:54:51 +01:00
Stefan Csomor
86c1fe4c79 Fixing crash under BigSur
We get a late redraw event in the current 11.X versions, fixes #19030
2021-01-05 15:35:48 +01:00
Vadim Zeitlin
d22956a56a Tiny simplification in wxWebRequestWinHTTP code
Add and use SetFailed(error) function for symmetry with the existing
SetFailedWithLastError().
2021-01-05 00:41:21 +01:00
Vadim Zeitlin
dbc1d9c40e Fix cancelling wxWebRequest under MSW
A cancelled request is not supposed to end up in the "failed" state, but
it did, resulting in showing an error in the webrequest sample after
pressing on the "Cancel" button, which was clearly unwanted.
2021-01-05 00:38:16 +01:00
Vadim Zeitlin
dd23d2cf25 Fix and simplify wxWebRequestImpl objects ref counting
When cancelling a request it was possible for it to be deleted while it
was still used from another thread.

Fix this and make the code much more obviously correct by simply
"locking" the request until the event generated by it is processed: now
IncRef() and DecRef() calls are always balanced as they're called from
ctor and dtor of StateEventProcessor helper only.
2021-01-05 00:26:49 +01:00
Vadim Zeitlin
d2dc11da4f Allow starting request by pressing "Enter" in the sample
Just a small ergonomic improvement.
2021-01-04 23:16:52 +01:00
Vadim Zeitlin
f89781bfdd Simplify status bar updates in the webrequest sample
Use wxLogStatus() to update the status bar, this is shorter and simpler
than using GetStatusBar()->SetStatusText(wxString::Format(...)).

Also use wxFrame::SetStatusText() which forwards to wxStatusBar method
with the same name when we want to just clear the status bar.

No real changes.
2021-01-04 02:13:53 +01:00
Vadim Zeitlin
6e546a3d4b Don't use wxSharedPtr<> in factory registration code
Shared ownership semantics again seems inappropriate here as we're not
actually sharing the pointers here, so just use raw pointers instead
(with C++11 we could use std::unique_ptr<>, but this is impossible with
our own map and scoped pointer implementations).

No real changes.
2021-01-04 02:06:10 +01:00
Vadim Zeitlin
989cafe535 Take raw pointer and not wxSharedPtr<> in SetData()
Using shared pointer seems to be ill-advised here, the stream shouldn't
be shared as it's going to be used by wxWebRequest itself and can't be
used by the application code in parallel, so the ownership transfer
semantics is more appropriate.

We could take a wxScopedPtr<> instead, but wx API takes ownership of raw
pointers everywhere else, so do it here too.

Incidentally fix a bug with calling IsOk() on a possibly null pointer.
2021-01-04 01:57:36 +01:00
Vadim Zeitlin
b58ee58a7b Update copyright years to 2021
Just run misc/scripts/inc_year and commit the results.

See #18690.
2021-01-03 18:12:37 +01:00
Vadim Zeitlin
b2cb5e7f3b Fix wxChoice drop down height without visual theme in wxMSW
When using pre-v6 comctl32.dll (e.g. by disabling the visual styles
explicitly or by just not using the manifest), we need to update the
drop down height manually, and for this we must ensure that overridden
wxChoice::DoMoveWindow() is called from MSWUpdateDropDownHeight().

Closes #19026.
2021-01-03 18:10:03 +01:00
Vadim Zeitlin
35b0d4e696 Merge branch 'update-third-party-libs'
Update third party libraries to their latest releases.

See https://github.com/wxWidgets/wxWidgets/pull/2157
2021-01-03 15:35:23 +01:00
Artur Wieczorek
31ae1f8094 Fix build with wxUSE_OLE==0 2021-01-02 10:20:12 +01:00
Vadim Zeitlin
faff721ef0 Merge branch 'image_data_object' of https://github.com/a-wi/wxWidgets
Implement wxImageDataObject to allow copying wxImage, including its
metadata, to/from clipboard.

See https://github.com/wxWidgets/wxWidgets/pull/2156
2021-01-02 00:27:44 +01:00
Stefan Csomor
405eb4779e moving archs to xcconfig 2021-01-01 21:10:05 +01:00
Václav Slavík
d28771cfb5 Tweak wxStatusBar size for macOS 11
Finder's status bar size increased by 4pt in Big Sur.
2021-01-01 12:15:58 +01:00
Václav Slavík
e687d0c4f6 Render statusbar natively on macOS
Instead of trying to mimic native statusbar background rendering in our
own code, use NSWindow setContentBorderThickness:forEdge: to extend the
border that is drawn by the system. This is the canonical way of doing
statusbars ("bottom bar") in AppKit.

The text is still drawn generically, but that's a much smaller issue
than trying to match the border gradient.
2020-12-31 18:51:46 +01:00
Vadim Zeitlin
e5428d5c7b Upgrade libtiff to the latest 4.2.0 release
Apply some workarounds of our own to fix -Wundef warnings and MSVS 200x
build.
2020-12-31 14:37:55 +01:00
Václav Slavík
5ebd76c5db Fix window background tinting on macOS 11
macOS 11 has an option (on by default) to tint window backgrounds with wallpaper colors. This means that standard window background color is not a constant anymore and can change as the window is moved across the screen.

The key to supporting this is to _not set background color_ internally to what we think is the correct default color, or to repaint backgrounds. Let the OS handle the default behavior instead.
2020-12-31 14:00:43 +01:00
Artur Wieczorek
0a06a5066a Add test of putting wxImage on and retrieving it from clipboard 2020-12-31 13:59:13 +01:00
Artur Wieczorek
51cd4ceb5c Demonstrate storing wxImage to clipboard in image sample 2020-12-31 12:58:23 +01:00
Artur Wieczorek
e09c35efb5 Implement wxImageDataObject
Using this object we can put an wxImage on or retrieve it from the clipboard. wxImage is stored internally as a blob with either a PNG file (wxMSW, wxGTK) or a TIFF file (wxOSX) and therefore some its metadata (like resolution) is stored on the clipboard too (what is not the case for wxBitmap stored with wxBitmapDataObject). wxImages stored with wxImageDataObject can be used by native applications.

Closes #17631.
2020-12-31 12:49:06 +01:00
Artur Wieczorek
a27a7656ea Provide support for storing PNG files on the clipboard (wxMSW)
PNG is a custom clipboard format but images stored in this format are supported by e.g. MS Excel, MS PowerPoint, GIMP (including image transparency).

See #17631.
2020-12-31 12:14:08 +01:00
Vadim Zeitlin
88332e06c8 Update expat to the latest 2.2.10 release 2020-12-30 23:33:55 +01:00
Vadim Zeitlin
28348b578a Update libpng to fix compatibility with older macOS versions
See https://github.com/wxWidgets/libpng/pull/5
2020-12-30 23:33:03 +01:00
Vadim Zeitlin
c069a62bd6 Merge branch 'github-ci-asan' of https://github.com/thesiv/wxWidgets
Switch to GitHub Actions for the ASAN CI build: running it on Travis CI
often fails (see https://github.com/google/sanitizers/issues/1353),
making it more trouble than it's worth, so try running it on GitHub
instead.

If it works fine there, we can move more Travis CI builds to that
platform later.

See https://github.com/google/sanitizers/issues/1353
2020-12-30 15:23:18 +01:00
Jorge Moraleda
ca9fa09fd8 Fix drawing expander column without values in generic wxDVC
When an item is marked as not containing any value in the expander
column, we must still draw the expander button if it has children, so
skip only drawing the item value in this case (and also preparing it for
drawing it, as calling PrepareForItem() would trigger an assert failure
for the items without value), but still execute the rest of the drawing
code for it, including drawing the background and expander button.

Closes https://github.com/wxWidgets/wxWidgets/pull/2144
2020-12-30 14:47:01 +01:00
Vadim Zeitlin
63f1260739 Skip wxWebRequest authentication tests when using NSURLSession
The NSURLSession-based backend is missing authentication support, so
these tests always fail there, skip them for now.
2020-12-30 14:41:17 +01:00
Vadim Zeitlin
a2a409f7a5 Remove references to non-existent wxWebRequest headers
Remove the platform-specific wxWebRequest headers from the files lists
and from MSVS 200x project files.

This should have been done in e5bd5a926c (Move backend-specific
wxWebRequest headers to private subdirs, 2020-12-26) manually, as
update-setup-h script doesn't remove the old files from the variable
definitions.

It notably fixes CMake build under MSW and Mac, which failed due to not
finding the referenced files.
2020-12-30 14:36:06 +01:00
Vadim Zeitlin
7b6c4cb9e9 Include required module before using check_c_source_compiles()
Fix CMake build with 3.10, which gave the following errors

CMake Error at build/cmake/init.cmake:321 (check_c_source_compiles):
  Unknown CMake command "check_c_source_compiles".
Call Stack (most recent call first):
  build/cmake/main.cmake:16 (include)
  CMakeLists.txt:69 (include)

previously. Apparently the required CheckCSourceCompiles module was
already included from somewhere else with later CMake versions, but not
with this one, so do include it explicitly.
2020-12-30 14:26:06 +01:00
Ilya Sinitsyn
67d286d499 Remove build with ASAN from Travis builds 2020-12-30 13:50:59 +07:00
Ilya Sinitsyn
ea6af85859 Add GitHub CI Workflow action for ASAN build
Unfortunately Travis build with ASAN fails with the segmentation violation
so build wx with GitHub CI.
2020-12-30 13:37:17 +07:00
Robin Dunn
bf6fee0af9 Avoid array overrun in OSX's wxCheckListBox::IsChecked 2020-12-29 18:07:20 -08:00
Vadim Zeitlin
50424cba2c Change wxWebRequest and related objects to hide ref counting
Don't force the application code to deal with wxObjectDataPtr<> or,
worse, calling {Inc,Dec}Ref() manually by hiding it inside the wx
objects themselves and giving the value-like semantics to them.

There should be no real changes in the behaviour, but the API does
change significantly. Notably, wxWebRequest is not a wxEvtHandler itself
any longer, as this would be incompatible with the value semantics, and
an event handler needs to be specified when creating it, so that it
could be notified about the request state changes.
2020-12-30 02:02:20 +01:00
Vadim Zeitlin
04bbb844ae Allow constructing/assigning wxObjectDataPtr from compatible type
Generalize copy ctor and assignment operators to allow implicit
conversions from wxObjectDataPtr<D> to wxObjectDataPtr<B> if D is
implicitly convertible to B (e.g. if B is the base class and D is a
class derived from it).

This makes wxObjectDataPtr<> more like standard smart pointer classes
and more useful.
2020-12-30 01:02:47 +01:00
Xaviou
be5b68459d Add scripts used for building MinGW official binaries
Add the scripts themselves and the documentation explaining how to use
them and which compilers are currently supported.

Closes https://github.com/wxWidgets/wxWidgets/pull/2129
2020-12-29 17:41:01 +01:00
Vadim Zeitlin
f742bbaddf Merge branch '15943-grid-autosize-loop' of https://github.com/discnl/wxWidgets
Fix infinite loop with auto-wrapped multi-line cells in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/2154

Closes #15943.
2020-12-29 17:28:17 +01:00
Jorge Moraleda
ce4d95eac0 Fix not resorting generic wxDVC when model sort order changes
We can't skip resorting wxDataViewCtrl contents when the sort order is
defined by the model class, as it can change at any moment, so restrict
this optimization to the cases when we're sorting by the value of some
column.

Closes https://github.com/wxWidgets/wxWidgets/pull/2153
2020-12-29 17:23:18 +01:00
Vadim Zeitlin
87d94819a1 Merge branch 'add-ribbonBar-coord-functions' of https://github.com/STgithub64/wxWidgets
Add wxRibbonToolBar GetToolByPos() and GetToolRect().

See https://github.com/wxWidgets/wxWidgets/pull/2152
2020-12-29 17:13:58 +01:00
VZ
9160181bcc Minor simplifications and code style fixes
No real changes.
2020-12-29 17:00:08 +01:00
Jorge Moraleda
9640f0027f Fix assert when computing best column width in generic wxDVC
Do not invoke a renderer's PrepareForItem when estimating best column
width in generic wxDVC for items with no value because PrepareForItem
fails for items with no value when the null variant cannot be converted
to the expected type.

Closes https://github.com/wxWidgets/wxWidgets/pull/2149
2020-12-29 16:47:54 +01:00
Vadim Zeitlin
f5bc0a9b31 Merge branch 'webview_edge_improvements2' of https://github.com/TcT2k/wxWidgets
Disable status bar in Edge-based webview for consistency with the other
backends.

See https://github.com/wxWidgets/wxWidgets/pull/2147
2020-12-29 16:23:32 +01:00
Christian
8255a71dc7 Fix error when clicking on empty space in wxDVC under Mac
Double clicking on empty space under the items in wxDataViewCtrl still
results in actionDoubleClick: being called, even though there is no
valid item under the mouse.

Just ignore such notifications, as we're not supposed to generate any
events in this case (neither GTK nor generic version do it) and calling
itemAtRow: with invalid row results in errors due to invalid index use.

Closes https://github.com/wxWidgets/wxWidgets/pull/2142

Closes #18984.
2020-12-29 15:52:56 +01:00
Artur Wieczorek
34fd2bc030 Fix setting alpha flag of wxBitmap created from HBITMAP
If HBITMAP represents 32-bit bitmap we need to check if this is a bitmap with transparency (ARGB) or maybe RGB only (0RBG) and set alpha flag accordingly.

Closes #18798.
2020-12-28 14:05:56 +01:00
Dimitri Schoolwerth
c6a588424d wxGrid: Fix potential infinite loop with auto-wrap
When using wxGridCellAutoWrapStringRenderer::GetBestWidth() with a cell
containing more newlines than fit, the function never exits because it
keeps on trying to wrap fit into the number of lines based on available
height only.

Fix by also taking into account the number of newlines a cell's text
value has.

Closes #15943.
2020-12-28 00:15:28 +01:00
Dimitri Schoolwerth
ff79db8ac1 wxGrid: Add test for auto-wrapped multi-line cells
Check that a row's height doesn't change when auto-sizing a column with
an auto-wrapping cell containing newlines.

Also currently will cause an infinite loop which will be fixed in the
next commit.

See #15943.
2020-12-28 00:13:17 +01:00