Commit Graph

39762 Commits

Author SHA1 Message Date
ali kettab
bca8bc13b4 fix typo 2020-07-10 21:47:05 +01: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
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
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
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
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
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
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
Paul Cornett
687267b9db Fix the default background color reported for toplevel windows with GTK3
See #18811
2020-07-06 23:13:33 -07: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
f259f4152b Merge branch 'safer-sizers'
Improvements to the safety of wxSizer API.

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

Closes #18611.
2020-07-06 17:54:46 +02:00
Stefan Csomor
792e4dcced macOS wxTextEntry::GetTextPeer fix for wxGenericComboCtrl (#1931)
* overriding GetTextPeer in generic combo control

* undo 81e3760e4a

* inlining GetTextPeer()

* moving out of line to reduce header include
2020-07-06 17:06:09 +02:00
Vadim Zeitlin
42108c64f6 Avoid warnings about literals-to-char* conversions in wxMotif
Suppress -Wwrite-strings warnings.
2020-07-06 13:06:57 +02:00
Vadim Zeitlin
655b343246 Avoid unused variable warning in wxRibbon with wxUSE_TOOLTIPS==0 2020-07-06 13:06:03 +02:00
Vadim Zeitlin
3004e594b9 Replace deprecated wxDEFAULT with wxFONTFAMILY_DEFAULT in wxMotif
Just avoid a -Wdeprecated-declarations warning.
2020-07-06 13:04:18 +02:00
Vadim Zeitlin
7c268092bd Avoid an unused variable warning in wxUIActionSimulatorX11
This happens in wxMotif build, where this class probably doesn't work
anyhow, so just suppress it.
2020-07-06 13:03:09 +02:00
Vadim Zeitlin
698c356050 Fix -Wwrite-strings warning in non-Pango wxFontEnumerator code
Don't convert wxString::c_str() to decltype(wxT("*")), which is
non-const "wchar_t *". Just pass wxString to Printf() directly instead,
this is simpler and more efficient anyhow.
2020-07-06 12:58:16 +02:00
Vadim Zeitlin
e7bb37436a Warn if wxCairoContext(wxPrinterDC) ctor is not implemented
Use an explicit #warning to explain the problem. This is more
informative and avoids errors when building with -Werror (but also
-Wno-error=cpp).
2020-07-06 12:54:15 +02:00
Vadim Zeitlin
3fc15101be Fix unhelpful unused parameter warning in wxX11 wxFontEnumerator
This warning can't really be avoided in this case, unless we decided not
to return any fonts at all if we can't test whether they're monospaced
or not, but this would probably be even less useful.
2020-07-06 12:40:03 +02:00
Stefan Csomor
9be2c3717d Improve native keyDown handling in wxOSX
Provide API for dealing with m_lastKeyDownEvent instead of using it
directly and extend it to avoid sending duplicate events for keys which
are mapped to multiple selectors, such as Ctrl-O with the default key
bindings.

Closes https://github.com/wxWidgets/wxWidgets/pull/1928
2020-07-06 00:13:18 +02:00
Vadim Zeitlin
d09ed641f2 Merge branch 'osx-10_10-min-10_11-SDK' of csomor/wxWidgets
Increase minimum required macOS SDK version to 10.11 and minimum support
macOS deployment version to 10.10.

See https://github.com/wxWidgets/wxWidgets/pull/1929
2020-07-06 00:08:44 +02:00
Vadim Zeitlin
957183ef47 Associate the window with the sizer in wxSizer::Replace()
If wxSizerItem passed to Replace() contains a window, the window must be
associated with the sizer to ensure that it is uncoupled from it when it
is destroyed.

Add a simple test which resulted in a use-after-free before but passes
now.
2020-07-05 23:19:36 +02:00
Vadim Zeitlin
2f49325d4c Simplify check for whether wxSizerItem window is null
No real changes, just write the check more compactly and without
redundant IsWindow() check.
2020-07-05 23:18:43 +02:00
Vadim Zeitlin
187cbf1efa Use CHECK, not ASSERT, in wxSizer::Replace() if item is NULL
This is a violation of function preconditions, so don't bother doing
anything in this case.
2020-07-05 23:15:05 +02:00
Vadim Zeitlin
a9b419af51 Fix code determining the rows to refresh in wxGrid::SetColSize()
The changes in 15de1a4cf4 (Optimize refresh when resizing grid rows or
columns, 2020-02-18) incorrectly translated XToPos() used in
SetRowSize() to YToRow(), which compiled due to an implicit conversion
of m_gridWin pointer to bool, but did the wrong thing, as the wrong grid
window could be used for a frozen grid.

Fix this by switching to internalYToRow() which actually does what the
original code tried to do.

Co-authored-by: Artur Wieczorek <artwik@wp.pl>
2020-07-05 15:04:00 +02:00