Commit Graph

70478 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
23c7805742 Document that wxTE_READONLY can't be used with wxTextEntryDialog
This style doesn't make any sense here, but using it is confusing
because it has the same value as wxCANCEL and is interpreted as it,
rather than as expected by users.

We can't do much about this, but at least document that this flag
doesn't work to prevent people from wasting time trying to use it.
2020-12-27 18:32:10 +01:00
Vadim Zeitlin
be5f1344b6 Add some comments describing wxWebSession methods
No real changes.
2020-12-27 13:01:49 +01:00
Vadim Zeitlin
71d5729171 Make wxWebSessionFactory private
Having wxWebSessionFactory part of the public API implies keeping
compatibility with the possible ways of implementing it which is too
restrictive for no good reason, so move this class to the private header
and don't document it nor wxWebSession::RegisterFactory() (which is now
private).
2020-12-27 01:03:08 +01:00
Vadim Zeitlin
e5bd5a926c Move backend-specific wxWebRequest headers to private subdirs
There is no need to make these headers public and keeping them private
will allow making backwards-incompatible changes to them in the future.
2020-12-26 17:00:07 +01:00
Vadim Zeitlin
8b632bb892 Enable wxWebRequest tests by default
Don't require WX_TEST_WEBREQUEST_URL environment variable to be set, but
only allow defining it to override the default https://httpbin.org value
or to disable the tests by setting it to 0.
2020-12-26 16:43:03 +01:00
Vadim Zeitlin
6a064c85d4 Compile even less code when wxUSE_WEBREQUEST==0 in the test
Move the check slightly higher, there is no need to include the headers
if we're not going to compile any tests anyhow.
2020-12-26 16:00:03 +01:00
Maarten Bent
13d0e0a152 Fix linking with libcurl under MSW when using CMake
Enable CMP0060 policy to use full path for the library.
2020-12-26 15:56:56 +01:00
Maarten Bent
1f504d3c5c Fix using wxThreadHelper in DLL builds
Remove the unnecessary and actually harmful WXDLLIMPEXP_BASE from the
declaration of wxThreadHelperThread and wxThreadHelper classes that only
have inline methods.
2020-12-26 15:54:43 +01:00
Vadim Zeitlin
45757c6728 Fix harmless warnings about unused Objective C methods parameters
Add wxUnusedVar() to suppress them (WXUNUSED() can't be used with
Objective C functions).

No real changes.
2020-12-26 15:26:41 +01:00
Vadim Zeitlin
139db5cc16 Fix harmless warning about missing return type in initWithSession:
The return type defaults to "id" anyhow, but it's better to specify it
explicitly.
2020-12-26 12:31:07 +01:00
Dimitri Schoolwerth
f6a9466856 Merge pull request #2151 from MaartenBent/clang-warnings
Fix clang warnings and replace tabs.
2020-12-24 10:19:37 +01:00
Gary Allen
ae9a62d5a2 Add wxRibbonToolBar GetToolPos and GetToolRect coord functions 2020-12-23 20:08:39 +02:00
Maarten Bent
a530d645d1 Replace tabs with spaces 2020-12-23 17:03:10 +01:00
Maarten Bent
32a0c57f7a CMake: mark WEBKIT2_JS_LIBRARY as advanced 2020-12-23 17:03:07 +01:00
Maarten Bent
ea4368317f Fix suggest-override warning 2020-12-23 17:03:07 +01:00
Maarten Bent
e889924bc1 Fix sign-compare warning 2020-12-23 17:03:06 +01:00
Maarten Bent
da455f3c0b Fix extra-semi-stmt warning 2020-12-23 17:03:06 +01:00
Maarten Bent
bdfe77c23f Fix redundant-parens warning 2020-12-23 17:03:06 +01:00