Commit Graph

68758 Commits

Author SHA1 Message Date
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
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
Vadim Zeitlin
9fde10f53e Use #!/bin/bash for Travis build script which requires bash
It uses arithmetic expansion and, now, arrays, neither of which exists
in POSIX sh.
2020-07-07 12:43:12 +02:00
Vadim Zeitlin
30582f4be4 Disable OpenGL support in wxQt build
It's not implemented anyhow and results in warnings about
GK_GLEXT_VERSION redefinition due to include both the standard
GL/glext.h and Qt QtGui/qopenglext.h (which seems to be a slightly
different version of the same file).

This probably should be fixed by not including GL/gl.h at all, but for
now just disable it.
2020-07-07 12:42:40 +02:00
Vadim Zeitlin
403884e1d8 Fix quoting of CXXFLAGS passed to make
Use arrays to simplify passing CXXFLAGS and LDFLAGS, both of them may
contain spaces, separately on make command line.

Simpler solution of just using individual variable doesn't work because
of bash/POSIX word splitting behaviour (zsh should be blamed for
spoiling me with its much more reasonable behaviour and allowing me
to forget about this insanity in the first place). In principle, we
could work around this by temporarily resetting IFS, but using arrays is
arguably more clear and this script already uses bashisms, in spite of
its shebang line.
2020-07-07 12:40:22 +02:00
Paul Cornett
687267b9db Fix the default background color reported for toplevel windows with GTK3
See #18811
2020-07-06 23:13:33 -07:00
PB
fec7abd54e Reset displayed wxDirCtrl in Widgets sample after pressing Reset button 2020-07-06 20:28:15 +02:00
Vadim Zeitlin
589e043358 Add an explicit warning about missing OpenGL support in wxQt
This is better than a bunch of warnings about unused parameters due to
many wxGLCanvas methods being just empty stubs.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
80ba460b1f Suppress unused parameter warning in wxX11
It seems better to keep it for consistency, as all the other functions
take both Drawable and GC, but it isn't being used in this particular
function.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
b1f5203a08 Add an explicit #warning for missing dashes support in wxX11 wxDC
This is better than warnings about unused dash-related variables.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
6119a7c630 Suppress warnings about deprecated pango_xft_get_context()
We can still use it as long as it exists, there is no benefit whatsoever
in using the new functions as the old one does exactly the same thing
anyhow.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
eaee5416cf Remove unused PangoContext variable from X11 code
It's has been there since basically always, but seems to never have been
used, so remove it to avoid warnings.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
1cdfdcc3a8 Allow warnings in iOS build, there are too many of them
Mostly there are warnings about unused parameters because of
unimplemented functionality, but we don't have a simple way to disable
just those, so just don't use -Werror with this build at all.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
a4c1e542aa Use makefile flags when building the samples too
This will notably detect all warnings in them.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
85ad131adb Fix not handling #warning as errors for clang
clang uses "#warnings" warning category instead of "cpp" as gcc does and
complains about unknown "cpp" warning option if we use it with it.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
437b8eebec Pass -Werror on make command line
Setting CXXFLAGS=-Werror in the environment wasn't enough, it was still
overridden by the empty CXXFLAGS in the makefile.

Ideal would be to get rid of the empty flags there, but for now override
them on make command line explicitly.
2020-07-06 18:01:38 +02:00
Vadim Zeitlin
c4152869f5 Split wxMAKEFILE_FLAGS in separate CXX/LDFLAGS variables
This will allow appending extra CXXFLAGS to use with make in the
upcoming commit.
2020-07-06 18:01:38 +02:00