Commit Graph

63506 Commits

Author SHA1 Message Date
Paul Cornett
f2106dcc3c Avoid overriding text control color in generic wxSearchCtrl
Although it's the same color the control already had, overriding it
can have unexpected consequences, such as overriding the text selection
colors with GTK3. Fixes invisible wxSearchCtrl selection with GTK3.
2017-12-04 09:23:47 -08:00
Paul Cornett
281ad86d8d Avoid permanently setting text hint color when using generic text entry hints
Multiple calls to SetHint() would cause the original color to be lost
See #17118
2017-12-04 09:18:10 -08:00
Tim Kosse
26f48c225e Fix crash when switching between monitors in wxOSX
It is possible for CGDisplayModeCopyPixelEncoding to return NULL, e.g.
during a switch between the built-in screen and an external monitor on a
Macbook. Check the return value to prevent a crash.

Closes #18015.
2017-12-04 15:11:16 +01:00
Paul Cornett
be37dd4862 Fix keyboard navigation for controls which are initially disabled
See #16806
2017-12-03 14:41:57 -08:00
Paul Cornett
d833667326 Update config.{guess,sub} 2017-12-03 14:31:12 -08:00
Paul Cornett
88b317f89e Avoid overwriting m_filterIndex initialization
There should be no need to set it again in Create()
See #17718
2017-12-03 10:19:03 -08:00
Paul Cornett
b8734109ff Fix ribbon page does not delete scroll buttons on destruction
See #17546
2017-12-03 10:08:01 -08:00
Paul Cornett
a671974bab Fix ribbon page layout wrong when scroll button is shown or hidden due to a scroll operation
See #17454
2017-12-03 10:04:23 -08:00
Paul Cornett
91d8082cc9 Fix ribbon page scroll button not shown on window restore
See #17453
2017-12-03 09:57:12 -08:00
Vadim Zeitlin
289fbcf5be Fix use of GDK_TOUCHPAD_GESTURE_MASK with GTK+ 3.14..3.16
Define GDK_TOUCHPAD_GESTURE_MASK ourselves if GTK+ headers don't define
it and don't use it during run-time if GTK+ version is less than 3.18,
in which it was added.
2017-12-02 21:29:09 +01:00
Vadim Zeitlin
3e0adbf541 Merge branch 'gesture-events'
Integrate GSoC 2017 work by Prashant Kumar implementing support for
gesture events.

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

Closes https://github.com/wxWidgets/wxWidgets/pull/565
2017-12-02 18:46:53 +01:00
Vadim Zeitlin
d83cd91d13 Merge branch 'tz-fixes'
Miscellaneous fixes for time zones and DST handling in wxDateTime.

This still leaves 2 big problems:

1. We have no support for using the correct time zone offset at the
   given date and always use the current time zone offset, which may,
   and often is, wrong.

2. Our code for converting to/from broken down representation doesn't
   handle DST at all, so support for DST is non-existent for the dates
   before 1970-01-01 or after 2038-01-01 (i.e. roughly outside of the
   32 bit time_t range).

See #10445 and the other tickets linked from there.
2017-12-02 16:28:05 +01:00
Vadim Zeitlin
2de4d9d296 Update to libtiff 4.0.9
No important changes, just switch to following the branch of the new
official upstream Git repository.
2017-12-02 16:26:38 +01:00
Vadim Zeitlin
36cc6ac1d2 Add a hack to work around DST problems in unit tests in BST
wxDateTime is still broken with respect to DST outside of the standard
time_t range, but make a special exception for the dates near Unix epoch
when using BST as not accounting for DST for them broke the unit tests
when run in this time zone.

Note that constructing the dates outside of the standard range is broken
too, so if this problem is ever fully fixed in GetTm(), it would need to
be fixed in Set() too, where the DST is not taken into account neither.
The problems in unit tests were due to using the (correctly behaving)
standard mktime() for 1970-01-01 but then using our (broken) GetTm() for
accessing them and could, in principle, be also worked around by not
using mktime() for this date, but it seems better to keep correct
behaviour at least for it, even if it's still broken for many earlier
dates.

See #15370.
2017-12-02 14:38:45 +01:00
Vadim Zeitlin
15a97924b6 Simplify wxDateTime ticks test by only using UTC times
Converting to another time zone and dealing with DST is completely
useless here, ticks values are always in UTC, so we can just use UTC
values from the beginning.
2017-12-02 14:38:45 +01:00
Vadim Zeitlin
179dced0e0 Include testdate.h before catch.hpp in unit tests
This ensures that dates are printed out correctly if comparing them
fails.

It might be better to avoid always including this header, but this is
the simplest solution.
2017-12-02 14:38:19 +01:00
Artur Wieczorek
d68bb24333 Fix rescaling images with wxIMAGE_QUALITY_BOX_AVERAGE
Current algorithm used to calculate the bounds of the boxes in the source
image to which the pixels in the target (rescaled) image are mapped to, has
flaws which cause a non-uniform distribution of the boxes in the source
image. And these miscalculations may result in the visible distortions
of the colours in the rescaled image.
New algorithm assures uniform distribution of the boxes in the source image
and thanks to the integer arithmetic is faster than currently used
and not prone to the problems with floating point representation.

Closes #18012.
2017-11-30 22:50:31 +01:00
Pavel O
390a3885ba Fix linking of third party system libs in static monolithic build
Include 3rd party libs in wx-config output even when using the system,
and not the built-in, versions of them for static monolithic build.

See https://github.com/wxWidgets/wxWidgets/pull/621
2017-11-30 21:58:06 +01:00
Vadim Zeitlin
0e65d91a38 Correctly detect DST in UK during 1969-1971 BST-only period
Take into account that from 1968-10-27 and until 1971-10-31 UK used BST
time instead of GMT, i.e. that DST was permanently on.

This fixes unit test failures in BST time zone for the dates around the
Unix epoch of 1970-01-01.

See #15370.
2017-11-30 21:44:38 +01:00
Vadim Zeitlin
ef372460be Recognize BST and GMT as time zones for UK
This doesn't really change anything yet, but is a prerequisite for
implementing better DST handling for the BST time zone.
2017-11-30 21:43:27 +01:00
Vadim Zeitlin
9655ca9e68 Close the gestures frame too in the event sample
Make "Exit" menu item really exit the sample again instead of just
closing the main window, but possibly leaving the gestures testing
window still open and thus not really exiting the program.

Also avoid creating more than one gesture window, use the existing one
if we had already opened it.
2017-11-30 21:40:24 +01:00
Vadim Zeitlin
fc9244614a Request GDK_TOUCHPAD_GESTURE_MASK events in wxGTK
This is apparently needed in order to get the gesture events.
2017-11-30 21:36:49 +01:00
Vadim Zeitlin
322144299d Use wxDateTime::TimeZone::IsLocal() in the unit test
No real changes, as this doesn't affect this test, but use the new
IsLocal() method instead of comparing the time zone offset with the time
zone, which doesn't work correctly for BST.
2017-11-30 17:53:52 +01:00
Vadim Zeitlin
d49784b0a2 Disable wxDateTime tests failing due to TZ offset changes
wxDateTime timezone-related methods always use the current timezone
offset, while other methods, using CRT, use correct value for the given
date, which may be different.

This discrepancy accounted for test failures in Europe/Minsk time zone
as Belarus has switched from UTC+2 to UTC+3 since 1999 date used in the
test.

It is impossible to really fix the problem easily, so just skip the test
in this case and also mention this bug in the documentation.

See #15370.
2017-11-30 17:44:41 +01:00
Jouk
d17665da3a Update OpenVMS makefile for change from cppunit to catch 2017-11-30 12:23:02 +01:00
Vadim Zeitlin
d3a01e3fe6 Show more information in other DateTimeTestCase tests too
Show the loop variable when doing checks inside a loop to make it more
obvious for which test case the failures occur.

Also use CHECK(), instead of REQUIRE(), to which CPPUNIT_ASSERT_EQUAL
expands, to continue with the other loop iterations after failure.
2017-11-29 23:55:13 +01:00
Vadim Zeitlin
4868ec0893 Show more information if DateTimeTestCase::TestTimeFormat() fails
No real changes, just show the variable values if any checks fail and
also continue running the test for the other data points even if one of
them fails.
2017-11-29 23:19:01 +01:00
Vadim Zeitlin
c7c30504c8 Do nothing when converting wxDateTime to/from local time zone
In particular, do not (unexpectedly) adjust time by the DST.

Closes #16585.

See #10445.
2017-11-29 23:18:57 +01:00
Vadim Zeitlin
543c522cb8 Explicitly disambiguate local time zone from UTC
Don't rely on time zone offset to check whether it is local as this
doesn't, and can't, work for the local time zone in Great Britain which
uses the same offset as UTC, but does use DST, unlike the latter.

Add a unit test (albeit disabled by default) checking that the code that
previously didn't work correctly in BST does work now (run the tests
using "TZ=Europe/London ./test wxDateTime-BST-bugs" under Unix to test).

Closes #14317, #17220.

See #10445.
2017-11-29 23:02:22 +01:00
Vadim Zeitlin
f13b7c6a55 Extract common code in a new wxTryGetTm() helper function
Replace exactly the same code occurring in both wxDateTime::GetTm() and
Format() with a single version in a new wxTryGetTm() function.

No real changes yet, except for removing of some useless asserts.
2017-11-29 22:02:16 +01:00
Vadim Zeitlin
7728c3a86d Fix linking code using wxDataViewCheckIconText under Unix
The class needs to use WXDLLIMPEXP_ADV in order for its (default,
compiler-generated) dtor to be generated inside the library, otherwise
this doesn't happen and linking code using this class inside a shared
library fails with errors due to the dtor being undefined.
2017-11-29 15:27:10 +01:00
Vadim Zeitlin
39dc254bf4 Don't call time() from wxLogRecordInfo ctor
This is a tiny optimization (or maybe not so tiny on platforms other
than Linux where time() might not as fast as just reading a memory
location), but mostly is done to work around faketime bug[*] which
prevented it from being used for testing programs using wxWidgets, such
as our own unit tests because time() was called from wxLogTrace() in
wxCSConv::DoCreate() called when creating global conversion objects
during the library initialization.

Arguably, it might be better to avoid calling wxLogTrace() during the
initialization, but this can't be done as simply and this change might
have a small performance benefit too.

[*] https://github.com/wolfcw/libfaketime/issues/132
2017-11-29 02:22:16 +01:00
Vadim Zeitlin
5b2f7aa96d Remove IsDST() check in wxDateTime DST unit test
IsDST() returns 0 for the DST end date itself, which is wrong, but
doesn't seem to be directly relevant for this test.
2017-11-28 23:59:21 +01:00
Vadim Zeitlin
13c3b5cbd1 Use different sections for wxDateTime DST test
Try to make it more clear where exactly does it fail on buildbot.
2017-11-28 23:40:51 +01:00
Vadim Zeitlin
efb8d82c8a Provide more information if wxDateTime DST test fails
Show the original date and the date after modification.
2017-11-28 23:19:26 +01:00
Vadim Zeitlin
369e6f6554 Use "datetime" tag for all wxDateTime unit tests
Make it possible to run all these tests at once (and no other ones)
easily.
2017-11-28 23:09:51 +01:00
Vadim Zeitlin
e23ff6fded Add tests for wxDateTime setters around DST end time
Check that setting the other date components doesn't change its hour.

See https://github.com/wxWidgets/wxWidgets/pull/367
2017-11-28 23:05:45 +01:00
Vadim Zeitlin
8415d12c61 Fix signed integer overflow in ZIP reading code
Subtracting a huge negative offset from the current position could
overflow it, which was correctly detected as undefined behaviour by
UBSAN.

Credit to OSS-Fuzz: this solves its issue 4388.
2017-11-28 22:43:57 +01:00
Vadim Zeitlin
9d97e4e7cc Don't use invalid static_cast<> in wxAppConsoleBase ctor
Although the object being created _will_ be of type wxAppConsole, it
doesn't have this type yet, as wxAppConsole ctor hadn't yet run, and so
the static cast is invalid and detected as such by UBSAN in g++ 6.3.
2017-11-28 22:39:24 +01:00
Jouk
3100af8eef use wxUSE_PRIVATE_FONTS on OpenVMS only for gtk2+ 2017-11-28 12:56:06 +01:00
Pavel O
e7e649df40 Check for lzma and jbig when using system libtiff
Currently lzma and jbig libraries are checked only for builtin
libtiff. When the system libtiff is built with lzma and jbig
support and when the `--with-libtiff=sys` flag is specified
the configure script will fail, due to missing linking with
lzma and jbig.

Fixed this by moving lzma and jbig checks from libtiff-builin check
above all libtiff checks. Also added lzma and jbig libs to
EXTRALIBS_GUI.

See https://github.com/wxWidgets/wxWidgets/pull/619
2017-11-27 21:57:07 +01:00
Jouk
ba58172987 change max to max_ to avoid %CXX-E-AMBIGUOUSNAME, "max" is ambiguous on OpenVMS 2017-11-27 09:00:29 +01:00
Jouk
23b8496e63 Add wxUSE_PRIVATE_FONTS to setup for OpenVMS 2017-11-27 08:57:54 +01:00
Vadim Zeitlin
310c45a5e2 Merge branch 'deprecated' of https://github.com/MaartenBent/wxWidgets
Fixes for deprecation and other warnings in samples and demos.

See https://github.com/wxWidgets/wxWidgets/pull/617
2017-11-26 17:30:49 +01:00
Paul Cornett
bca2d063bb Avoid using NULL style provider
Fixes assertions with wxNotebook
2017-11-26 00:00:44 -08:00
Vadim Zeitlin
797fad2858 Merge branch 'xtifix' of https://github.com/pavelxdd/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/618
2017-11-25 22:22:59 +01:00
Vadim Zeitlin
302fc5190a Merge branch 'gtk2-version-checks'
Simplify GTK+ 2 version checks with a helper function.

See https://github.com/wxWidgets/wxWidgets/pull/614
2017-11-25 22:18:31 +01:00
Paul Cornett
6830767839 Fix STL build broken in 003faa9 2017-11-25 11:26:07 -08:00
Paul Cornett
17de4e31fb Avoid using NULL GtkSettings pointer
Seems to happen when running tests
2017-11-25 11:00:31 -08:00
Paul Cornett
23e3323655 Add non-const overload for GetToolByPos()
See #16763
2017-11-25 10:57:23 -08:00