Commit Graph

68873 Commits

Author SHA1 Message Date
Vadim Zeitlin
885ef5819e Remove CppUnit boilerplate from wxVector unit test case
No real changes.
2020-07-11 18:52:49 +02:00
Vadim Zeitlin
9890cf6bac Return empty string from wxColour::GetAsString() if it's invalid
This is consistent with wxToString(wxColour) and seems more useful than
either returning black string representation (as wxMSW used to do) or
asserting (as wxGTK did).

Document this behaviour and add a test checking for it.

Closes #18623.
2020-07-11 14:31:54 +02:00
Vadim Zeitlin
5d14346325 Replace CppUnit assertion macros with Catch ones
Also define wxColour-specific matchers to allow comparing RGB(A)
channels to the expected values, replacing the old ASSERT_EQUAL_RGB(A)
macros.

No real changes.
2020-07-11 14:24:06 +02:00
Vadim Zeitlin
e3f505afdb Merge branch 'test-fix-gtk2' of https://github.com/AliKet/wxWidgets
Fix setting focus in GUI tests using wxUIActionSimulator with GTK 2.

Fixing the actual problem allows to re-enable activating the TLW in
SetFocus() (done in d06e97e8d9 (Make sure toplevel is active in
SetFocus(), 2020-07-08), see #18783) and remove the now unnecessary
workarounds in the tests too.

See https://github.com/wxWidgets/wxWidgets/pull/1945
2020-07-11 13:57:49 +02:00
Vadim Zeitlin
0918ab679b Merge branch 'dirdialog-multi-hidden'
Add wxDD_MULTIPLE and wxDD_SHOW_HIDDEN support to wxDirDialog.

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

Closes #18736.
2020-07-11 13:52:12 +02:00
Vadim Zeitlin
617db49fda Remove support for gcc < 4
We probably could drop support for some gcc 4.x versions too, but we
definitely don't need to support gcc 3.x any longer and not doing it
simplifies the code a bit, so just assume gcc >= 4.

Closes https://github.com/wxWidgets/wxWidgets/pull/1943
2020-07-11 13:51:58 +02:00
Vadim Zeitlin
39ac04b0d0 Allow wxGTK/ARM build failures on Travis CI
ARM VMs/containers seem to be broken on Travis right now and all builds
fail, sometimes without even starting, so ignore them, at least for now.
2020-07-11 13:41:38 +02:00
ali kettab
a33a38c1ad Remove unneeded workarounds 2020-07-10 22:31:00 +01:00
ali kettab
8fd09b9382 SetInputFocusToXWindow() fixup 2020-07-10 22:29:23 +01:00
ali kettab
bca8bc13b4 fix typo 2020-07-10 21:47:05 +01:00
Vadim Zeitlin
de6bc5f062 Remove useless CppUnit test case class from wxColour unit test
No real changes, just get rid of the unnecessary legacy boilerplate.
2020-07-10 19:31:33 +02:00
Vadim Zeitlin
6c5751db4f Remove unused HEADER_HEIGHT constant
It wasn't used since f8252483ec (Applied patch [ 803473 ] wxListCtrl
header height bugfix, 2003-09-11) but remained, commented out, in the
code for some reason.
2020-07-10 18:09:16 +02:00
Vadim Zeitlin
96acdae1e6 Remove the test for y mouse position in wxListHeaderWindow
This test was apparently supposed to check if the mouse was inside the
header, vertically, but this should always be the case unless the mouse
is captured and when it is captured in this code, m_isDragging is set to
true meaning that the code in the "else" branch of the test for it can't
be executed at all, so checking the vertical position seems completely
unnecessary.

Worse, it was actively harmful when using GTK 2 with DPI scaling, as in
this case the height of the window could be different from 22 (e.g. 44
for 2x scaling).

Closes #18713.
2020-07-10 18:06:32 +02:00
Vadim Zeitlin
a47fd95e45 Avoid overriding wxDirDialog::GetPath[s]() unnecessarily
Don't duplicate practically the same code in all ports, just add m_paths
itself to the base class. The only drawback of doing this is that it's
unused in the ports not (yet) using it, but this saves enough code in
the aggregate to be worth it.
2020-07-10 03:52:15 +02:00
Vadim Zeitlin
2b0323ebc8 Avoid using wxString::Empty()
This is confusingly similar to std::string::empty() which doesn't do the
same thing, so prefer using clear() instead.

And simply remove Empty() calls before the assignment, as they're
useless.

No real changes.
2020-07-10 03:43:23 +02:00
Vadim Zeitlin
d8f460200a Use wxCoTaskMemPtr<> instead of manual ::CoTaskMemFree()
No real changes, just use a smart pointer instead of manual memory
management calls.
2020-07-10 03:40:53 +02:00
PB
83aa1a19a5 Implement MSW support for wxDD_MULTIPLE and wxDD_SHOW_HIDDEN 2020-07-10 03:32:49 +02:00
Ian McInerney
ade5030c56 Warn on incompatible wxDirDialog styles 2020-07-10 03:32:49 +02:00
Ian McInerney
7230acd110 Fix setting the title for the wxDirDialog on OSX
OSX 10.11+ doesn't actually display the title, so update documentation
to reference SetMessage instead. For pre-10.11 override the SetTitle
method to set the title of the NSOpenPanel instead of the window.

Also change so the directory is not updated unless it is provided.

Closes #15143.
2020-07-10 03:32:48 +02:00
Ian McInerney
61afcae0be Implement multiple selection support in wxOSX
Add support for wxDD_MULTIPLE style to wxDirDialog in wxOSX too.
2020-07-10 03:32:19 +02:00
Ian McInerney
5e1cf4cdf2 Implement hidden directory support in wxOSX too
Add support for wxDD_SHOW_HIDDEN style to wxDirDialog in wxOSX.
2020-07-10 03:31:46 +02:00
Ian McInerney
b98660b996 Use non-deprecated NSOpenPanel methods in wxDirDialog on OSX 2020-07-10 03:31:46 +02:00
Ian McInerney
79d73d4eb3 Add show hidden folders flag to wxDirDialog
Add wxDD_SHOW_HIDDEN similar to the existing wxFD_SHOW_HIDDEN.
2020-07-10 03:29:16 +02:00
Ian McInerney
b43f9b0ea4 Update sample to use multiple selection in wxDirDialog 2020-07-10 03:25:51 +02:00
Ian McInerney
f9e9b19c92 Add wxDD_MULTIPLE wxDirDialog style and implement it for GTK
Add wxDirDialog::GetPaths() similar to the existing member of
wxFileDialog with the same name and also taking, for consistency,
wxArrayString as the output parameter.
2020-07-10 03:24:42 +02:00
Vadim Zeitlin
fa6680be4d Merge branch 'widgets-sample' of https://github.com/PBfordev/wxWidgets
Improve behaviour of wx{File,Dir}Ctrl in the widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1934
2020-07-10 02:07:44 +02:00
Vadim Zeitlin
41410610ef Don't force wxPU_CONTAINS_CONTROLS on wxPopupTransientWindow
Popups not using this style work too now (since the parent commit), so
this style should be used only if the popup actually requires focus and
not always, unconditionally.

Turn on this style explicitly in the sample which shows a popup window
with wxTextCtrl inside it (which requires focus to work).
2020-07-10 00:02:48 +02:00
Vadim Zeitlin
3bcbc8fe8e Implement dismissal for unfocused wxPopupTransientWindow
Popups not using wxPU_CONTAINS_CONTROLS were not automatically dismissed
at all any longer, as the only auto-dismissal mechanism related on
getting WM_ACTIVATE, which they never did, so implement a different
logic for dismissing them: do it on any change of focus and also any
mouse press (but not move and not key press neither).

This will allow not using wxPU_CONTAINS_CONTROLS for popups that don't
need focus, but still must disappear on their own.
2020-07-09 23:58:29 +02:00
Vadim Zeitlin
2ac90f9d38 Don't call SetFocus() for popups not using wxPU_CONTAINS_CONTROLS
Under MSW only popup windows with wxPU_CONTAINS_CONTROLS can have focus,
attempting to set it to a [child of a] popup without it will just result
in a debug error message from wxWindow::SetFocus() and nothing else, so
just avoid doing it entirely.
2020-07-09 19:55:03 +02:00
Ian McInerney
8b7fdc5e5b Close the cell editor when the editors combobox is closed
Closes #16404
2020-07-09 18:15:24 +01:00
Vadim Zeitlin
03e79fce63 Don't set focus to wxTipWindowView when using wxPopupWindow
At least under MSW this results in an activation loss for the previously
active TLW, as it activates wxTipWindow itself, which looks bad. And, of
course, setting focus is completely unnecessary in the first place, as
this window doesn't accept any input and wxEVT_KILL_FOCUS is handled
only when not using wxPopupWindow.
2020-07-09 17:40:20 +02:00
ali kettab
6f8509f8eb Revert 06ffd1d
This reverts commit 06ffd1dbab.
2020-07-09 16:29:16 +01:00
Vadim Zeitlin
3ceb425a73 Call OnDismiss() in wxMSW wxPopupTransientWindow on deactivation
The window should be notified about its dismissal, as it happens in the
result of the user action and not due to a call to Dismiss() from the
program itself.
2020-07-09 15:14:45 +02:00
Vadim Zeitlin
fd29d86da1 Demonstrate the use of wxTipWindow in the dialogs sample
As we show wxRichToolTip in this sample, it's only logical to show the
simple wxTipWindow in it too.
2020-07-09 14:52:14 +02:00
Vadim Zeitlin
099ea7176d Properly stop Travis CI build after a test failure
Using "pushd tests && test-command && popd" loses the exit code of the
test command, as it's not taken into account by "set -e" when the
command is part of a "&&" list.

Fix this by simply splitting such lists in their individual commands.
2020-07-09 14:08:44 +02:00
Robin Dunn
4c0288435b Add missing wxRICHTEXT_HANDLER_USE_CSS 2020-07-08 16:38:02 -07:00
Danail Stoychev
5e7e89de16 Fix re-parenting TLWs in wxMSW
We need to set the new owner for the TLW, instead of using the new
parent as the actual parent, in the MSW sense, as this results in a
weird situation in which the TLW becomes a child (i.e. non-TLW) window.

Closes #18785.
2020-07-09 00:34:44 +02:00
Vadim Zeitlin
8f4ebb4bdc Show wxEVT_TOGGLEBUTTON from toggle button in the widgets sample
Allow checking that the events are received as expected.
2020-07-09 00:09:43 +02:00
Vadim Zeitlin
06ffd1dbab Revert SetFocus() change for GTK 2 to fix the GUI tests suite
Limit the changes of d06e97e8d9 (Make sure toplevel is active in
SetFocus(), 2020-07-08) to GTK 3 only as they break GTK 2 GUI test
suite, resulting in many CI failures.

See #18783.
2020-07-08 23:45:25 +02:00
Paul Cornett
d06e97e8d9 Make sure toplevel is active in SetFocus()
See #18783
2020-07-08 08:52:12 -07:00
Paul Cornett
f07197e2ba Avoid -Wimplicit-fallthrough warnings 2020-07-08 08:34:21 -07:00
Vadim Zeitlin
2289f8be55 Merge branch 'natural-sort'
Add natural sort functions.

See https://github.com/wxWidgets/wxWidgets/pull/1923
2020-07-07 23:17:05 +02:00
PB
83a2a1e505 Refactor the natural string compare and sort algorithm
Add a new string fragment type for whitespace and punctuation which needs
to be assessed separately from letters and symbols.

Use wxUint64 instead of long for storing the value for numeric fragment.

Use collate instead of compare for non-numeric fragments.

Change names for the public comparison functions: wxWidgets provided function
is now named wxCmpGenericNatural() and for common public use is wxCmpNatural()
which calls a native function in wxMSW and wxCmpGenericNatural() elsewhere.

Try harder in wxCmpNaturalGeneric() if wxRegEx is unavailable: do not
just make a simple string comparison, but perform a case-insensitive
collation.

Make some other changes to simplify and possibly speed up the code.
2020-07-07 23:10:18 +02:00
Hugo Elias
371c4b1366 Add functions for sorting strings in natural sort order
Use StrCmpLogicalW() under MSW and generic implementation under the
other platforms.

See https://github.com/wxWidgets/wxWidgets/pull/780
2020-07-07 23:10:11 +02:00
Vadim Zeitlin
a2e4e6ebcf Merge branch 'readme-macos-update'
Update platforms supported by wxOSX in the README.

See https://github.com/wxWidgets/wxWidgets/pull/1937
2020-07-07 22:59:17 +02:00
Vadim Zeitlin
7aa0d9465c Mention support for macOS on ARM in the README too
Instead of putting 32/64, which is not even correct any more, as latest
macOS versions don't support 32 bit builds anyhow.
2020-07-07 22:58:27 +02:00
Hertatijanto Hartono
a5e8316dc8 Update README.md to define macOS 10.10 as the lowest version supported
Show that macOS 10.10 is lowest version supported by wxWidgets
2020-07-08 01:12:12 +07:00
Vadim Zeitlin
eeb69ba185 Fix wxGLCanvas build in wxQt when using MSVC
Use "#pragma message" instead of "#warning" with this compiler to fix
the build after the recent changes of 589e043358 (Add an explicit
warning about missing OpenGL support in wxQt, 2020-07-06).
2020-07-07 15:31:26 +02:00
Scott Talbert
270c8bec3d Fix wxMediaCtrl::Seek() on macOS for sub-second resolution
On macOS, wxMediaCtrl::Seek() currently only works to the nearest second.
For example, Seek(5033) will actually seek to an offset of 5000.  This is
because the timescale was being set to 1, meaning 1 possible timeslice per
second.  The fix is to set the timescale to 60000, which means that there are
60000 timeslices per second.  This is probably overkill since the API for seek
is an integer in milliseconds, but should be fine.

References:
https://stackoverflow.com/questions/22666190/using-seconds-in-avplayer-seektotime
http://warrenmoore.net/understanding-cmtime

Closes https://github.com/wxWidgets/wxWidgets/pull/1936
2020-07-07 15:07:54 +02:00
Vadim Zeitlin
a3f61f973d Merge branches 'travis-warning-errors' and 'travis-cleanup'
Fail CI builds if any warnings (other than those given by an explicit
preprocessor #warning directive) are encountered.

Also cleanup Travis config a bit.

See https://github.com/wxWidgets/wxWidgets/pull/1933,
    https://github.com/wxWidgets/wxWidgets/pull/1935
2020-07-07 12:45:58 +02:00