Commit Graph

68351 Commits

Author SHA1 Message Date
Vadim Zeitlin
e6e6dbe077 Fix problems due to deleting grid cells in the event handlers
Deleting last grid rows or column in a few event handlers could result
in asserts/crashes in wxGrid code if the event handler also called
event.Skip(), as wxGrid still tried to perform the default action using
the deleted cell, when these events happened in the last row or column.

It's not totally clear whether calling event.Skip() after performing an
action modifying the grid should be allowed at all, but, in doubt, at
least avoid crashing if it does happen, by considering the event as
being handled (and even vetoed) if its handler deleted the cell in which
it was generated.

Closes #18731.
2020-05-02 00:53:59 +02:00
Vadim Zeitlin
5cdcfddc61 Refactor event sending code in wxGrid to use even more functions
Move the logic determining the return value of SendEvent() into its own
function instead of repeating it twice.

No real changes, this is a pure refactoring.
2020-05-02 00:49:08 +02:00
Artur Wieczorek
f938402dd0 Use conditional operator instead of conditional statement 2020-05-01 19:38:52 +02:00
Artur Wieczorek
c0f7275b11 Get rid of redundant return statement 2020-05-01 19:36:09 +02:00
Artur Wieczorek
b9ebffd832 Set also wxPGEditor items while changing wxPGProperty choices
If we replace current set of choices when editor is active
we need also replace editor items.

Closes #18741.
2020-05-01 19:35:29 +02:00
Vadim Zeitlin
c098363e0d Add test for wxMemoryFSHandler bug fixed in the parent commit
Executing this test before the changes of the previous commit would
result in test failure/crash/Valgrind errors. Now it passes.

See #18744.
2020-05-01 18:57:54 +02:00
Artur Wieczorek
8a9e5e5ac7 Implement method to set items of wxPGChoiceEditor
In addition to the current methods to add/delete one item to the control
we would need a method to replace all existing control items with new ones
at once.
2020-05-01 17:57:46 +02:00
Ben Bronk
10ee1b8d10 Fix use of invalid find iterator in wxMemoryFSHandler
Calling FindFirst() with an URL without wildcards returned the correct
result, but didn't reset m_findIter, which kept its value from the
previous search that could have been invalidated since then, e.g. if
RemoveFile() has been called. Using this value could result in a crash
during the next call to FindNext().

Fix this by ensuring that we always reset m_findIter to the valid (even
if pointing to the end) value as the first thing we do in FindFirst().

Closes #18744.
2020-05-01 15:40:43 +02:00
Vadim Zeitlin
a973d02c9f Get rid of CppUnit cruft in wxFileSystem test case
Use CATCH macros directly and define separate test cases instead of
using a useless FileSystemTestCase class.

Also add INFO() macros to provide information about the context in case
of test failure.

No real changes.
2020-05-01 15:06:05 +02:00
Vadim Zeitlin
aacd26c27b Save specified, not actual, col width in wxPersistentDataViewCtrl
This is more correct as saving the current width of the last column
would prevent the user from shrinking it under the last automatically
set size, i.e. the UI behaviour would change after restarting the
program, which shouldn't be the case.

Doing this required making WXGetManuallySetWidth(), which previously
existed in the generic version only, available in all ports, so do it
and also rename it to WXGetSpecifiedWidth() in the process, as this
seems a somewhat better name (it doesn't have to be manually specified,
i.e. it could also be done by the program itself or even implicitly by
wxPersistentDataViewCtrl).

Don't make this function public, at least for now, because it's not
clear how could it be useful and it might still need to be changed to
behave differently in the other ports.
2020-05-01 03:39:40 +02:00
Vadim Zeitlin
44578b883c Don't set m_manuallySetWidth incorrectly
This fix for disallowing shrinking the last column to nothing instead of
showing horizontal scrollbar when it became smaller than its minimum
size was wrong and is not necessary any more after the correct fix in
the previous commit.

This effectively reverts 0c90ea40c3 (Don't auto-resize wxDataViewCtrl
columns below their initial size, 2019-10-03).

See #18343.
2020-05-01 03:39:41 +02:00
Vadim Zeitlin
d74389f930 Fix WXGetManuallySetWidth() for columns using wxCOL_WIDTH_DEFAULT
Columns without any explicitly specified width still shouldn't be shrunk
down to 0 size by UpdateColumnSizes(), so handle them as if they were
created using wxDVC_DEFAULT_WIDTH instead -- which is what their actual
width is/would be.

This is a better fix than the one in 0c90ea40c3 (Don't auto-resize
wxDataViewCtrl columns below their initial size, 2019-10-03) and that
commit can be reverted now, as will be done soon.

See #18343.
2020-05-01 03:39:21 +02:00
Vadim Zeitlin
6c5f3f8929 Refactor generic wxDataViewColumn to use DoGetEffectiveWidth()
This function will be used for m_manuallySetWidth too, in addition to
m_width, in the next commit.

No changes yet in this one.
2020-05-01 03:25:52 +02:00
Vadim Zeitlin
ecc58e5211 Allow shrinking last column down to its minimal size
Not doing this when the last column size should have been exactly equal
to its manually set size resulted in showing the horizontal scrollbar
unnecessarily.
2020-05-01 03:23:52 +02:00
Vadim Zeitlin
9ed122b31f Update column sizes after updating scrollbars, not before
As UpdateColumnSizes() uses client size, call it after the client size
is set correctly after adjusting scrollbars to the new virtual size.
2020-05-01 03:22:40 +02:00
Vadim Zeitlin
7a8f04302f Use client size for calculating column sizes, not the full size
We need account for the place taken by the vertical scrollbar, if any.
2020-05-01 03:21:45 +02:00
Vadim Zeitlin
f10d9e199f Remove unnecessary GetColumnCount() test in wxDataViewCtrl code
The presence of columns is already checked inside UpdateColumnSizes()
itself, so there is no need to do it before calling it too.

No real changes.
2020-04-30 23:37:00 +02:00
Vadim Zeitlin
fa9b13f64b 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.
2020-04-30 23:32:42 +02:00
Paul Cornett
9d4bb47050 Don't compile Cairo dynamic linking code with GTK
It's useless as Cairo is always linked to any program using GTK
2020-04-30 09:11:37 -07:00
Paul Cornett
861cc376d6 Avoid -Wempty-body warning with non-debug build 2020-04-30 09:01:09 -07:00
Paul Cornett
af5950c108 Avoid Gtk-CRITICAL with GTK3 when calling SetFont() before Create() 2020-04-29 07:35:44 -07:00
Dummy
b3730a59c6 Document default value for wxDialog::Show() parameter correctly
It's "true", not "1".

See #18743.
2020-04-29 15:46:47 +02:00
Dummy
bbc88cedf1 Fix wrong documentation of EVT_CLOSE for the dialogs
Clicking OK/Cancel buttons closes the dialog (by default), but doesn't
generate wxEVT_CLOSE event, so don't write that it does.

Closes #18743.
2020-04-28 18:52:49 +02:00
Vadim Zeitlin
7a56a200bf Remove the mention of update_release_info.rb from release HOWTO
This is now done automatically in the GitHub action of wxWidgets/website
repository.

Do mention that rebuilding the web site requires the release to be
available.
2020-04-28 00:53:06 +02:00
Maarten Bent
52d830398a Fix -Wsuggest-override warning
Manually checked by adding -Wsuggest-override as compile parameter.
2020-04-27 00:33:03 +02:00
Maarten Bent
3631951928 Fix -Wunused-const-variable warning 2020-04-27 00:33:03 +02:00
Maarten Bent
1607ec48c3 Fix -Wunused-function warning 2020-04-27 00:33:02 +02:00
Maarten Bent
4d81cc3ae9 Fix -Wunused-const-variable warning 2020-04-27 00:33:02 +02:00
Maarten Bent
c8ca4bde06 Fix -Wunused-function warning 2020-04-27 00:33:02 +02:00
Maarten Bent
542887080b Fix -Wdelete-non-abstract-non-virtual-dtor warning 2020-04-27 00:33:01 +02:00
Maarten Bent
abb2eb9ed0 Fix -Wmicrosoft-exception-spec warning 2020-04-27 00:33:01 +02:00
Maarten Bent
08ae164417 Fix -Wreorder-ctor warning 2020-04-27 00:33:01 +02:00
Maarten Bent
04d82e24cd CMake: enable -Wall for builds using clang or gcc 2020-04-27 00:33:01 +02:00
Vadim Zeitlin
a9fda9bfa8 Recognize wxFIXED_MINSIZE in sizer flags in the XRC schema
This seems to have been an accidental omission.
2020-04-26 23:37:02 +02:00
Stefan Csomor
7c61841d27 adding implementation for GetMatchingPair on macOS, streamlining wxDataObject
When adding the GetMatchinPair implementation, some clean-ups were done, for further details please see #1821
2020-04-26 17:50:33 +02:00
Vadim Zeitlin
a98410504b Document updating docs.wxwidgets.org for the releases
[skip ci]

Closes https://github.com/wxWidgets/wxWidgets/pull/1823
2020-04-26 16:33:51 +02:00
Stefan Csomor
dc93ff1967 correcting include style 2020-04-26 15:55:51 +02:00
Stefan Csomor
a235f8e04c bracket code not working on ios 2020-04-26 11:54:54 +02:00
Stefan Csomor
68b22e65b8 adding bitmap button implementation to ios 2020-04-26 11:54:04 +02:00
Paul Cornett
9f3ad89ba9 Update some documentation to reflect change of default GTK version for configure
Make some other feeble attempts to update these very outdated files, including
dropping '+' from GTK, and most references to GTK 1.
2020-04-25 08:39:42 -07:00
Vadim Zeitlin
c385676610 Prefer using https://www.wxwidgets.org/downloads/ download link
This is more user-friendly than GitHub links with their tons of files.

Also use the recently added #vX.Y.Z_msw anchor to link directly to MSW
binaries downloads from the corresponding file.

Closes https://github.com/wxWidgets/wxWidgets/pull/1820
2020-04-24 23:02:16 +02:00
Vadim Zeitlin
dc34600c0c Fix built-in PNG library build with MSVC 9 and older
Upgrade the submodule to a version which doesn't try to use SSE2 with
this old compiler, as it doesn't support the required intrinsics.

See https://github.com/wxWidgets/libpng/pull/4
2020-04-24 00:42:41 +02:00
Vadim Zeitlin
4ee7202121 Merge branch 'upgrade-travis-platforms'
Use more recent Linux and macOS versions for Travis CI builds.

See https://github.com/wxWidgets/wxWidgets/pull/1818
2020-04-24 00:39:25 +02:00
Paul Cornett
9f9bb66d18 Fix for GTK2 wxSpinCtrl SetIncrement() not immediately updating increment
See #18735
2020-04-23 08:55:46 -07:00
Vadim Zeitlin
0397da2a8f Use ld --no-as-needed in Travis Ubuntu 18.04 wxGTK build
This works around a problem in our build system which doesn't set rpath
correctly when linking our own libraries, which means that "qa" library,
for example, doesn't record the path to its "xml" library dependency.

We already worked around this by linking any program using "qa" with
"xml" too, however this doesn't do anything if "--as-needed" flag is in
effect, as is the case by default under Ubuntu 18.04, so make our
workaround work by forcefully disabling this flag.

Real solution would be to use -Wl,-rpath correctly and then stop linking
with "xml" library unnecessarily in e.g. test_gui bakefile.
2020-04-23 02:59:45 +02:00
Vadim Zeitlin
f1ee627736 Update Travis testing script to work for non-GUI builds too
Skip parts that don't work in this case.
2020-04-22 21:00:28 +02:00
Vadim Zeitlin
7cfe4ee9f2 Disable GUI parts build for PPC and S/390 Travis platforms
People are unlikely to use wxGTK on those anyhow, and it takes an
awfully long time to build, especially on PPC.
2020-04-22 18:26:02 +02:00
Vadim Zeitlin
30241e18ba Fix configure success test one more time
Quotes are important.
2020-04-22 18:25:48 +02:00
Vadim Zeitlin
ea11be554c Install libpango1.0-dev for wxX11 build on Travis
Hopefully this is what explains pangoxft pkg-config check failure.
2020-04-22 17:56:45 +02:00
Vadim Zeitlin
cc86204c98 Change wxOSX CMake build name to include "CMake" 2020-04-22 17:54:01 +02:00