Commit Graph

68603 Commits

Author SHA1 Message Date
Vadim Zeitlin
499252ace8 Fix unit tests compilation in C++20
There is no more overload of std::ostream::operator<<() for wchar_t in
C++20, i.e. it is explicitly deleted, so we need to define some other
way of printing wchar_t out from Catch macros.

Do it by specializing Catch::StringMaker<> for it and outputting it
either as a (7 bit) ASCII character, if this is what it is, or as a
Unicode character code otherwise, as this will probably be more useful
in case of a test failure.
2020-05-10 23:05:41 +02:00
Vadim Zeitlin
63626acbe4 Fix std::ostream::operator<<(wxScopedWCharBuffer)
This never worked correctly as using operator<<() with wchar_t pointer
just fell back to the overload for void pointers, i.e. printed out the
address of the wide string, which wasn't especially useful, but with
C++20 it doesn't even compile, as this overload is explicitly deleted.

Fix both problems at once by actually doing something useful for it
instead and printing out data in either current encoding or UTF-8 if
converting it to the current encoding failed.
2020-05-10 23:00:00 +02:00
Vadim Zeitlin
176b9dde90 Fix wxString iterator comparison in C++20
In C++20 the reverse comparison operators are also considered when
searching for the operator to use and a wrong operator was selected for
comparisons between iterator and const_iterator, that would result in an
infinite recursion at run-time.

Fix this, thanks to the nice gcc 10 warning about it, by explicitly
defining the operators for this overload set too instead of relying on
implicit conversions.

Although not all these overloads are necessary, and they are only
necessary in C++20, it seems better to define all of them and always
just to be perfectly explicit and clear, as this code is not exactly
simple to follow.
2020-05-10 22:57:41 +02:00
Vadim Zeitlin
30079ad0e6 Fix building GUI tests with MSVC
This was broken by da48b9e45d (adding an iOS build to travis (#1847),
2020-05-08), as we can't use preprocessor directives inside macro
arguments with MSVC (at least with its traditional preprocessor).

Use a helper macro to make this work again.
2020-05-10 02:15:52 +02:00
Vadim Zeitlin
216c14d346 Merge branch 'travis-other-archs' into window-id
Minor fixes for testing PPC/s390 architectures on Travis CI.

See https://github.com/wxWidgets/wxWidgets/pull/1844
2020-05-09 23:37:43 +02:00
Vadim Zeitlin
3e724ffa96 Merge branch 'memoryfs-iter' into window-id
Fix bug in wxMemoryFSHandler iteration.

See https://github.com/wxWidgets/wxWidgets/pull/1833
2020-05-09 23:37:14 +02:00
Vadim Zeitlin
d3b9686099 Take number of digits into account in GTK wxSpinCtrlDouble
When determining the entry width in wxSpinCtrlDouble, we need to account
not only for the width of the integer part, but also for the number of
digits that determines the width of the fractional part.

Do it in the overridden version of (now virtual) GtkSetEntryWidth().

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

Closes #18734.
2020-05-09 23:36:25 +02:00
Vadim Zeitlin
3ab187f75f Add a test for "%e" to wxDateTime::ParseFormat()
See https://github.com/wxWidgets/wxWidgets/pull/1842
2020-05-09 23:23:31 +02:00
Vadim Zeitlin
2cf0537722 Correct the test for ParseFormat() with fall back date
This was added back in b5f85206a9 (fix ParseFormat("%d") to set the date
it finds (#10002), 2008-09-26), but the test didn't do what the comment
said and didn't use the default date object it added.

Fix this now to finally do what was intended all these years ago.
2020-05-09 23:22:13 +02:00
Stefan Csomor
da48b9e45d adding an iOS build to travis (#1847)
* fixing compilation of tests that cannot build

bracket code with the corresponding wxUSE… macros

* adding directive for iOS

* adding a switch for skipping the run - not the build of tests

right now I don’t know yet, how to run the test binary in the iOS simulator, but building it is still a good test in itself

* adding skipping of tests

* increasing minimum deployment to get proper c++17 support

* using --disable-sys-libs, restoring other targets

even when the zlib in -isysroot is used, due to deployment on lower iOS versions inflateValidate may not be available and crash. The guards are evaluated using macros from the zlib from the SDK, not from the lowest version supported.
2020-05-08 08:01:56 +02:00
Stefan Csomor
665bed8521 skipping gui test and samples for now on ios 2020-05-07 13:01:43 +02:00
Stefan Csomor
396eafd15f correct option name 2020-05-07 11:17:16 +02:00
Stefan Csomor
ccf241ef95 force built-in tiff on ios 2020-05-07 10:59:52 +02:00
Stefan Csomor
0edda02847 removing register keyword
needed for c++17 compatibility, this file is only used in iOS builds
2020-05-07 10:36:51 +02:00
Stefan Csomor
f6bb4aa6e2 copy paste error with tripple dash 2020-05-07 09:13:22 +02:00
Stefan Csomor
50b1f8b183 first attempt at ios travis 2020-05-07 08:29:05 +02:00
Vadim Zeitlin
b30dfcc8d5 Ignore failures in PPC/s390 builds
They fail just too often for some infrastructure flakiness reasons and
constantly result in false positives.
2020-05-06 22:47:26 +02:00
Vadim Zeitlin
7e5c8915c5 Changes labels of wxBase builds on PPC/s390 architectures
We're only building wxBase there, not the full wxGTK.
2020-05-06 22:44:43 +02:00
Vadim Zeitlin
7466681607 Merge branch 'grid-event-delete'
Handle deleting grid rows/columns in event handlers gracefully.

See https://github.com/wxWidgets/wxWidgets/pull/1834
2020-05-06 18:45:16 +02:00
Vadim Zeitlin
6a084e799e Merge branch 'dvc-colsize-vert-scroll'
Fix issues with generic wxDVC last column size when using
wxPersistentDVC.

See https://github.com/wxWidgets/wxWidgets/pull/1832
2020-05-06 18:44:28 +02:00
Vadim Zeitlin
b0c36d02ef Decrease precision for values using factor with number validator
Using too high precision could result in bogus digits appearing in the
displayed value, e.g. 0.058 shown in percents (with a factor of 100)
appeared as 5.800000000000001 before this change.

Closes https://github.com/wxWidgets/wxWidgets/pull/1831
2020-05-06 18:43:43 +02:00
Vadim Zeitlin
e60d43c21e Add compilation guards for macOS 10.10 to avoid warnings
"[NSColor linkColor]" gives a compile-time warning even if we don't use
it during the run-time, so check MAC_OS_X_VERSION_MAX_ALLOWED before
using it.
2020-05-06 17:48:28 +02:00
Vadim Zeitlin
d0fb641498 Merge branch 'cmake-warnings' of https://github.com/MaartenBent/wxWidgets
Enable warnings for CMake builds and fix some warnings that this
exposed.

Also add wxUSE_NATIVE_DATAVIEWCTRL option and change default GTK version
to 3 for CMake too.

See https://github.com/wxWidgets/wxWidgets/pull/1825
2020-05-06 14:34:34 +02:00
Vadim Zeitlin
46dfc54e8d Generalize changes of the previous commits to wxMac too
Handle "impossible" flag combinations such as wxTB_LEFT|wxTB_RIGHT and
wxTB_TOP|wxTB_BOTTOM that are actually possible under Mac too.
2020-05-06 02:14:02 +02:00
Vadim Zeitlin
101f135445 Fix problem with wxTB_VERTICAL | wxTB_RIGHT too
This is similar to the previous commit, but for the other direction.
2020-05-06 02:09:34 +02:00
Maarten Bent
d3d1a91620 CMake: change default GTK version from 2 to 3 2020-05-06 01:52:27 +02:00
Maarten Bent
b1ddd454f8 CMake: add wxUSE_NATIVE_DATAVIEWCTRL option 2020-05-06 01:52:27 +02:00
Maarten Bent
57c385350d Fix inconsistent use of boolean and HRESULT 2020-05-06 01:52:24 +02:00
Danny Scott
b424ac6fe9 Update how-to-release instructions
Document bakefile version needed and the commands for regenerating the
files generated by it.

Also update instructions for changing C:R:A values.

Closes https://github.com/wxWidgets/wxWidgets/pull/1838
2020-05-06 01:47:34 +02:00
Teodor Petrov
5dab468444 Implement wxSYS_COLOUR_HOTLIGHT on macOS
* There is linkColor avaiable since 10.10. Just use it.
* https://developer.apple.com/documentation/appkit/nscolor/2998828-linkcolor
* https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color/
2020-05-05 23:40:10 +03:00
PB
33cda12b74 Handle wxToolBars created with wxTB_HORIZONTAL | wxTB_BOTTOM style correctly
wxToolBar created with wxTB_HORIZONTAL | wxTB_BOTTOM had two issues:
(1) There was a toolbar-high gap below the menu bar.
(2) The status bar was not positioned correctly.

Fix both issues by taking into account that wxTB_TOP is an alias for wxTB_HORIZONTAL
and so a wxToolBar can have quite counter-intuitively set both wxTB_TOP and wxTB_BOTTOM.

In such cases it means that the toolbar is horizontal and on the frame bottom,
this needs to be accounted for when computing the origin of the frame client
area as well as the status bar position.

Closes #18760
2020-05-05 20:22:11 +02:00
Vadim Zeitlin
013cacee4d Don't use unsigned variables for pixel values
This is not a good idea because we really don't want them to wrap around
and it also provokes signed/unsigned comparison warnings when using
them.

Also make this variable and the other related one const.
2020-05-03 21:10:03 +02:00
Konstantin S. Matveyev
403a8ed115 Improve drag-and-drop support in generic wxDataViewCtrl
Set the proposed drop index in wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE event
generated by the control to allow dropping either on or between the
items in the control, as it was already possible with the Mac version.

Closes https://github.com/wxWidgets/wxWidgets/pull/1822
2020-05-03 21:10:04 +02:00
Vadim Zeitlin
7158c9b5be Use Destroy() rather than delete for dialogs in the sample
Even though it doesn't make any real difference for these dialogs, we
still shouldn't delete top level windows directly and should rather call
Destroy() on them to let them be cleaned up during the next idle time
processing.

See #18747.
2020-05-03 20:21:23 +02:00
Vadim Zeitlin
05bf67df1e Fix parent/child relationship in MSW wxFindReplaceDialog
It's not enough to set the parent pointer in the child, the parent also
needs to be aware of its child, so call AddChild() to do both at once.

This ensures that find dialog with non-null parent is destroyed by it
when it is itself destroyed.

Closes #18747.
2020-05-03 20:17:31 +02:00
Anton Triest
35f1cb417b Fix hit testing in generic wxTreeCtrl in high DPI
Update the code doing hit testing to use FromDIP() too, to be consistent
with the changes of 3a9b5001ce (Fix size of wxGenericTreeCtrl buttons
when using high DPI, 2020-02-23) # Please enter the commit message for
your changes. Lines starting.

See #18674.

Closes #18749.
2020-05-03 19:59:37 +02:00
Vadim Zeitlin
b6c593af45 Fix regression in MSW DoDragDrop() return code
It always returned wxDragNone since the changes of f5548e399e (Fix
problem with dragged icon remaining on screen under MSW 10, 2020-01-11)
which wrongly changed pdwEffect to DROPEFFECT_NONE before doing anything
else, disregarding the fact that it's an in-out parameter and not just
an output one.

Fix this by simply not doing this, just as it hadn't been done before.

See #18499.
2020-05-03 03:13:01 +02:00
Vadim Zeitlin
c88f3a114c Fix warnings in recently added MSWSetTabStops()
gcc complained about converting NULL to long (-Wconversion-null), so use
0 explicitly. Also really pass the pointer to the first element, rather
than iterator, which is not guaranteed to be a pointer.

This amends the changes of d1553c63ed (Improve support for TABs in
wxListBox under MSW, 2020-04-13).

See https://github.com/wxWidgets/wxWidgets/pull/1789
2020-05-03 03:02:20 +02:00
Vadim Zeitlin
43bdadda0d Update PNG library to avoid more -Wundef warnings in MinGW build
Define symbols used in MIPS/PPC code which are also tested using "#if
PNG_FOO > 0" as 0 instead of leaving them undefined.
2020-05-03 02:57:58 +02:00
Vadim Zeitlin
fc08ce94a5 Improve documentation of wxDataViewCtrl item dragging
Try to explain at least a little how is this supposed to work. This is
still insufficient, but better than nothing, which was what we had
before.
2020-05-02 20:12:22 +02:00
Konstantin S. Matveyev
bcddfd6efb Don't start dragging invalid items in generic wxDataViewCtrl
It's not useful to allow dragging from the control area where there are
no items and it resulted in assert failures due to using an invalid row
in wxDataViewDropSource::GiveFeedback(), so simply don't do it at all.

Note that native GTK wxDataViewCtrl implementation doesn't do this
neither, so it also makes the behaviour more consistent.

Closes https://github.com/wxWidgets/wxWidgets/pull/1828
2020-05-02 20:06:49 +02:00
Vadim Zeitlin
fd2aea0352 Log wxEVT_DATAVIEW_ITEM_BEGIN_DRAG in the sample
Show when an attempt to start dragging an item is made, to be able to
compare the behaviour under different platforms easily.
2020-05-02 20:06:48 +02:00
Lauri Nurmi
42af101836 Remove obsolete Darwin-specific code in dynlib.*/dlunix.cpp
We don't have our own dlxxx() implementations under Darwin since 76c5594
(Remove our own dlxxx() functions emulation for OS X <= 10.3.,
2013-10-17).

wxHAVE_DYNLIB_ERROR is reduced to being the same HAVE_DLERROR, so use
the latter one instead.

Closes https://github.com/wxWidgets/wxWidgets/pull/1826
2020-05-02 19:30:28 +02:00
Kvaz1r
67c1c412c6 Implement support for copying wxGrid cells to clipboard
This is useful for read-only grids, in which an editor can't be shown to
copy the value of a cell, and also for copying an entire selection block
and not just a single cell.

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

Closes #13562.
2020-05-02 19:20:48 +02:00
Kvaz1r
63e1697dda Add wxGridBlocks::iterator::operator->()
An iterator should have this operator defined too, and not just
operator*() as it used to.
2020-05-02 18:50:03 +02:00
Vadim Zeitlin
e6ab2391c4 Merge branch 'dvc-virtual-has-value'
Allow overriding wxDataViewModel::HasValue() to specify which cells
should, and should not, show anything.

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

Closes #18724.
2020-05-02 18:22:27 +02:00
Artur Sochirca
d1553c63ed Improve support for TABs in wxListBox under MSW
Always set the LB_USETABSTOPS style flag to achieve behaviour more
compatible with other platforms and expand TABs to align them at tab
stops positioned at every 8 characters.

Also add MSW-specific MSWSetTabStops() method allowing to customize tab
stops.

Update the documentation and the sample to demonstrate using TABs.

Closes https://github.com/wxWidgets/wxWidgets/pull/1789
2020-05-02 18:07:50 +02:00
Vadim Zeitlin
ebe7816516 Finish editing on Enter in cells in the last shown row of wxGrid
Previously, pressing Enter in a cell of a row which wasn't the last one,
but was the last shown one, didn't do anything because we explicitly
checked whether the cell was in the last row and not in the last visible
row, but MoveCursorDown() doesn't move the cursor for the latter, and
not just for the former.

Fix this by avoiding any row checks at all and just calling
MoveCursorDown() in any case and DisableCellEditControl() if it didn't
do anything.

Closes #18754.
2020-05-02 17:45:51 +02:00
Vadim Zeitlin
f5001e728c Rebake with bakefile 0.2.12
No real changes, just synchronize with the bakefile release used now.
2020-05-02 17:02:36 +02:00
Vadim Zeitlin
f83085cff8 Add back the use of INSTALL_SCRIPT correctly
Due to a momentary lapse of reason, the changes of 99cb097f4d (Install
wx-config as a script, not as a binary program, 2018-08-16) were applied
to the generated Makefile.in file and so were promptly lost during the
next rebake.

Reapply them properly now, by modifying the .bkl file from which this
file is generated.

Note that rebaking now requires bakefile v0.2.12, which adds support for
defining INSTALL_SCRIPT.

See #18197.
2020-05-02 15:55:25 +02:00