Commit Graph

69231 Commits

Author SHA1 Message Date
Stefan Csomor
b2d4a9dedc adding data-transfer direction when getting native datatypes
we are publishing exactly what we have internally when data has to be get, and when setting, we might have more formats we can support
2020-07-12 17:53:10 +02:00
Ian McInerney
04ff2254a0 Ensure the clipboard contents are stored properly on GTK
GTK needs to be told the data on the clipboard can be stored
before the store is attempted.

Also, document that the clipboard behavior on GTK is very
dependent on the configuration of the user's machine.

Closes #10515
2020-07-12 00:39:33 +01:00
Maarten Bent
10ac26d6e5 Fix DPI of wxTipWindow
Take care to use the DPI of the display the window will be actually
displayed on and not that of its parent window, which can be different.
2020-07-11 19:59:40 +02:00
Vadim Zeitlin
01b0a50f8f Move wxTipWindow members used only by wxTipWindowView there
No real changes, just move m_textLines and m_heightLine from wxTipWindow
to wxTipWindowView as they were only used by the latter and so can just
as well be its members.

Also use this as an opportunity to replace wxArrayString with wxVector.
2020-07-11 19:59:40 +02:00
Vadim Zeitlin
c6d1a851da Make wxUSE_TIPWINDOW dependent on wxUSE_POPUPWIN
It doesn't seem to make sense to provide wxFrame-based implementation of
wxTipWindow, if anything we should use similar code to implement
wxPopupTransientWindow itself on the platforms not providing it.

So simplify wxTipWindow code by leaving only a single implementation,
using wxPopupTransientWindow. This should have arguably been done back
in 8962e1d938 (wxTipWindow is now a wxPopupTransientWindow instead of a
wxFrame., 2001-11-30) which introduced the use of wxPopupTransientWindow
in this code.
2020-07-11 19:59:40 +02:00
Vadim Zeitlin
b7057c336f Merge branch 'msw-dismiss-unfocused-popup'
Allow wxPopupTransientWindow to work without wxPU_CONTAINS_CONTROLS too
in wxMSW and don't use wxPU_CONTAINS_CONTROLS by default, notably
allowing wxTipWindow to be shown without stealing focus.

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

Closes #18636.
2020-07-11 19:56:32 +02:00
Vadim Zeitlin
6f7dc14801 Fix wrong iterator in wxInfoBar::RemoveButton() in wxGTK
The iterator passed to erase() was off by 1, but this worked correctly
in the default build using wxVector, and not std::vector, because its
base() implementation was off by 1 too.

Now that wxVector bug is fixed (see the parent) commit, fix the code
using it too, which makes it work both in the default and STL builds.

Closes #18765.
2020-07-11 19:33:35 +02:00
Vadim Zeitlin
5495389db5 Fix off-by-one bug in wxVector::reverse_iterator::base()
This is embarrassing, but the iterator returned by this method seems to
have always been wrong, ever since it was added back in 946954d3bf
(Added reverse iterator to wxVector<T>, 2008-09-16). Moreover, it was
also broken in its const_reverse_iterator counterpart where it was
copy-and-pasted in f7ef20685f (Add wxVector<>::const_reverse_iterator,
2013-05-08).

Finally fix this to return the correct value and add at least a simple
unit test check that this method behaves as expected.
2020-07-11 19:05:06 +02:00
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