Commit Graph

68905 Commits

Author SHA1 Message Date
Stefan Csomor
f9618ebe5b Revert "disable this test when no wxMenuBar is present"
This reverts commit 769881a45b.
2020-07-13 11:24:16 +02:00
Stefan Csomor
769881a45b disable this test when no wxMenuBar is present
it just is full of calls to menubars ..
2020-07-13 11:19:52 +02:00
Vadim Zeitlin
1eccf833f9 Add codespell line suppression file
This file is used with "-x misc/suppressions/codespell-lines" codespell
option and allows to ignore entire lines, instead of ignoring words that
only occur once or twice and shouldn't be ignored globally because they
could well be misspelt elsewhere.

The remaining words in codespell.ignore occur too many times (as
parameter names in various places) to be ignored in this way.
2020-07-13 02:28:38 +02:00
Vadim Zeitlin
ebc418a02a Move codespell ignore file to new misc/suppressions directory
This is not really a script, so having it under misc/scripts was not
very logical.

Also rename it to explicitly indicate that this file contains the words
to ignore as the next commit will also add another file ignoring the
whole lines.
2020-07-13 02:28:38 +02:00
Daniel Kulp
872692132a Use more appropriate colours for AUI dock art under Mac
Use system colours instead of hard-coding white.

This is still not ideal because ideally the same wxSYS_COLOUR_XXX
constants should be usable under all platforms, but better than just
using completely wrong colours when using dark mode under Mac.
2020-07-13 01:50:21 +02:00
Daniel Kulp
a829b1df06 Simplify bitmap initialization in wxAuiDefaultDockArt
Reduce the number of __WXMAC__ checks by using helper wxColour variables
which have different values under Mac and non-Mac.

No real changes.
2020-07-13 01:50:21 +02:00
Daniel Kulp
f3d4f01513 Improve dark mode test in wxAuiGenericTabArt
Use wxSystemSettings for this instead of manually checking the base
colour components which is both more verbose/difficult and less
reliable.
2020-07-13 01:50:21 +02:00
Daniel Kulp
3d33fcdba8 Adapt the gradient used in AUI tab art in dark mode
Invert its direction and make it darker for better fit.
2020-07-13 01:49:51 +02:00
Daniel Kulp
e12a9b11e4 Update AUI art colours after system colours change
Move code initializing colours and colour-dependent bitmaps from ctor to
UpdateColoursFromSystem(), which means that now this is done not only
once, when creating the object, but also later if the system colours
change (e.g. due to turning on or off the dark mode).
2020-07-13 00:54:02 +02:00
Daniel Kulp
88928e712a Use system colours in wxAuiGenericTabArt
Don't hardcode black and grey, which don't look right in all themes.
2020-07-13 00:52:50 +02:00
Vadim Zeitlin
e779450638 Merge branch 'tipwindow'
Miscellaneous wxTipWindow enhancements, including better high DPI
support.

See https://github.com/wxWidgets/wxWidgets/pull/1949
2020-07-12 22:31:08 +02:00
Vadim Zeitlin
32489c914c Merge branch 'vector-reverse-iter'
Fix wxVector reverse iterator base().

See https://github.com/wxWidgets/wxWidgets/pull/1948
2020-07-12 22:30:42 +02:00
Vadim Zeitlin
98241e21cd Merge branch 'colour-as-string'
Return empty string from wxColour::GetAsString() if it's invalid.

See https://github.com/wxWidgets/wxWidgets/pull/1947
2020-07-12 22:29:09 +02:00
tm
f6cc8ff52c Add GetOpenGLScaleFactor() to abstract OpenGL coordinates scaling
The fix for OpenGL coordinates when using high DPI in b134589cbb (Fix
OpenGL samples when using HiDPI displays, 2019-08-06) did fix it for GTK
3 and macOS, but broke it for MSW and other platforms not using pixel
scaling, as window coordinates are the same as OpenGL ones there, while
GetContentScaleFactor() can still return values > 1 even on these
platforms.

Provide new GetOpenGLScaleFactor() function abstracting this platform
difference and use it in all OpenGL samples to make them work correctly
in high DPI under all platforms.

Closes https://github.com/wxWidgets/wxWidgets/pull/1944

Closes #17391.
2020-07-12 22:28:29 +02:00
Ian McInerney
8f322ffb23 Replace g_clipboardAtom with GDK_SELECTION_CLIPBOARD
GDK_SELECTION_CLIPBOARD is the prefered way of referencing
the GdkAtom for the clipboard, and using it provides a clearer
distinction between the primary clipboard and the normal clipboard.
2020-07-12 20:14:41 +01:00
Stefan Csomor
01d7fa8116 adding utf8 as when data is read from the pasteboard 2020-07-12 20:59:32 +02:00
Stefan Csomor
1e64278150 macOS fixing potential crash in PasteboardWriter
using a pasteboard peeker tool lead to a crash when the drag pasteboard was accessed after our session has long finished. Make sure the writer is working correctly event after the data object is not valid anymore
2020-07-12 20:58:41 +02:00
Artur Wieczorek
95b5fcc0ea Use empty() function to check if vector is empty
Use this dedicated function instead of checking if size() function
returns zero/non-zero value.
2020-07-12 20:07:29 +02:00
Artur Wieczorek
c1cbc1aee7 Suppress MSVC++ performance warning
This is to prevent warning C4800: 'LRESULT': forcing value to bool 'true'
or 'false' (performance warning).
2020-07-12 20:04:59 +02:00
Artur Wieczorek
3feea201da Add tests of setting wxSpinCtrl base and range 2020-07-12 19:58:30 +02:00
Artur Wieczorek
a4928c0fde Use Catch in wxSpinCtrl unit tests
Use Catch instead of CppUnit for unit tests of wxSpinCtrl.
2020-07-12 19:58:30 +02:00
Artur Wieczorek
776b28cba7 Don't allow wxSpinCtrl range to include negative values if base != 10 (wxOSX)
For the sake of consistency with another ports only unsigned
hexadecimal numbers should be supported. To do so we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

Closes #18805.
2020-07-12 19:58:30 +02:00
Artur Wieczorek
845988e0ed Don't allow wxSpinCtrl range to include negative values if base != 10 (wxGTK)
Hexadecimal numbers are always unsigned in the native wxSpinCtrl
implementation under wxMSW so for the sake of consistency we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

See #18805.
2020-07-12 19:58:30 +02:00
Artur Wieczorek
ae1e93cbae Don't allow wxSpinCtrl range to include negative values if base != 10 (wxMSW)
In a native up-down control hexadecimal numbers are always unsigned (see
UDM_SETBASE message documentation) so we need to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.

See #18805.
2020-07-12 19:58:30 +02:00
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