Commit Graph

69165 Commits

Author SHA1 Message Date
Vadim Zeitlin
0744cd14a1 Try using Python 3 for codespell
Running it using Python 2 seems to result in a problem with not matching
an exclusion line with non-ASCII character, which works fine with Python
3 locally.
2020-07-13 17:38:01 +02:00
Vadim Zeitlin
77e1e6330b Run codespell from where it is installed by pip
And disable the (useful) warning about this directory not being in PATH.
2020-07-13 17:35:30 +02:00
Vadim Zeitlin
d432b1a685 Try installing codespell 1.17.1 via pip
The 1.16 version available in Ubuntu 20.04 doesn't work nearly as well
as the latest one.
2020-07-13 17:30:47 +02:00
Vadim Zeitlin
1fcdaa7f22 Combine all values of codespell --skip option into one
codespell 1.17.1 from Debian Sid accepts multiple -S options, but 1.16
in Ubuntu 20.04 doesn't seem to like them.
2020-07-13 17:25:18 +02:00
Vadim Zeitlin
e4a826d250 Add GitHub workflow checking spelling for headers and docs
Run codespell using GitHub Actions to flag any new spelling errors.
2020-07-13 17:19:26 +02:00
Vadim Zeitlin
77095c5fbd Remove the now unused DISABLED_TEXT_COLOR constant
The previous commit removes all references to this hardcoded colour.
2020-07-13 16:01:05 +02:00
Daniel Kulp
01e9bd008d Use previously Mac-specific colours for all platforms in wxAUI
Get rid of platform checks in wxAUI and use (the same) system colours
everywhere.
2020-07-13 15:59:46 +02:00
Daniel Kulp
623c116b7a Honour the colour alpha channel in wxAuiBitmapFromBits()
This fixes creating wrong bitmaps for system colours with alpha and
allows to use the correct wxSYS_COLOUR_INACTIVECAPTIONTEXT constant
in wxAuiGenericTabArt instead of a wrong but, due to the loss of alpha,
better looking wxSYS_COLOUR_INACTIVECAPTION which was used before.
2020-07-13 15:57:59 +02:00
Vadim Zeitlin
69e27acf0d Merge branch 'im/clipboard' of https://github.com/imciner2/wxWidgets
Ensure the clipboard contents are stored properly on GTK.

See https://github.com/wxWidgets/wxWidgets/pull/1953
2020-07-13 15:33:58 +02:00
Vadim Zeitlin
325648136c Fix system colours in wxGTK wxSysColourChangedEvent handlers
Using wxSystemSettings::GetColour() in wxSysColourChangedEvent handler
in wxGTK could return the old colour value, before the change, because
the callback for notify::gtk-theme-name signal defined in wxTLW, which
generates wxSysColourChangedEvent, could be invoked before the callback
for the same signal in wxSystemSettings, which invalidated its cache.

Fix this by registering the former using g_signal_connect_after() and
thus ensuring that wxSystemSettings callback runs before it, and the
cache is cleared before wxSysColourChangedEvent handlers can use it.

Closes #18818.
2020-07-13 14:23:42 +02:00
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