Commit Graph

63523 Commits

Author SHA1 Message Date
pavelxdd
504c22a512 Fix wxURLDataObject comment and documentation for wxGTK
Fix a copy-and-pasto in the header and also mention that wxURLDataObject
derives from wxDataObjectComposite, and not wxTextDataObject, in wxGTK
too.

Also add a note about the exact base class being an implementation
detail.

Closes https://github.com/wxWidgets/wxWidgets/pull/624
2017-12-08 13:14:19 +01:00
Vadim Zeitlin
879876e047 Fix libtiff compilation with MinGW-w32 6.3
Avoid redefining snprintf as this breaks -Wformat-related macros in this
compiler stdio.h -- and is unnecessary anyhow.

Closes #17936.
2017-12-08 03:30:41 +01:00
Vadim Zeitlin
b8bc595546 Use zlib submodule with "wx_zlib_" prefix
This will allow projects to use static wxWidgets libraries and zlib
(either directly or indirectly, as can heppen e.g. via Boost.IOStreams)
at the same time without link conflicts.

See #15314.
2017-12-08 02:38:47 +01:00
Vadim Zeitlin
b0c4cb7131 Correct order of 3rd party libraries in wx-config output
A recent change fixing monolithic build broke the normal build when
using built-in libraries under Unix as -lwxzlib now came before -lwxpng
and so zlib symbols used by libpng were not found (in fact, they could
still be found in the system library which is usually available under
Unix, so the problem wasn't seen immediately, but it was still there).

See https://github.com/wxWidgets/wxWidgets/pull/621
2017-12-08 02:38:47 +01:00
Paul Cornett
db00ab9c02 Avoid gtk_show_uri() with GTK+3.9x 2017-12-07 10:51:57 -08:00
Vadim Zeitlin
23caf6fe00 Remove misleading comment from wxStaticBox::PaintBackground()
We do use wxStaticBox colour for painting its background (as can be seen
with test code from #18018, for example) under MSW, so don't say that we
don't.

Also, the reasons for not doing it mentioned in the comment are either
obsolete (wxGTK3 does do it too, unlike wxGTK2) or lost (the link to the
mailing list message doesn't work any longer and can't be recovered).

Closes #17913.
2017-12-07 18:49:59 +01:00
Paul Cornett
2f19014d71 Avoid deprecated GdkColor with GTK3 2017-12-06 22:08:25 -08:00
Vadim Zeitlin
f3f158403c Merge branch 'file-readall-len'
See https://github.com/wxWidgets/wxWidgets/pull/629
2017-12-06 16:42:58 +01:00
Vadim Zeitlin
38c67b68e3 Remove unnecessary "virtual" keywords from Cairo code
Several methods were virtual for no apparent reason, just don't make
them virtual unnecessarily.

No real changes.
2017-12-06 14:46:26 +01:00
Vadim Zeitlin
7ee73c9332 Slightly clean up font handling in wxGraphicsContext in wxGTK
Returning true/false from wxCairoFontData::Apply() to indicate whether
Pango should or not be used was not very clear, so prefer to test for
the font explicitly in the code calling Apply() and make Apply() itself
void, consistently with the method with the same name in the other
classes.

Also avoid calling it at all from GetTextExtent() when using Pango, this
is completely unnecessary as the text colour doesn't have any bearing on
its extents.

Also use static_cast and const_cast as appropriate instead of C-style
casts.
2017-12-06 14:41:21 +01:00
Vadim Zeitlin
436d27baf0 Use correct length for the string returned from wxFile::ReadAll()
This corrects f75387850b and just uses the
newly added assign() overload taking the buffer directly: as the buffer
already knows its length, this makes it unnecessary to pass it
separately.

Closes #16490.
2017-12-06 03:41:35 +01:00
Vadim Zeitlin
140d6fea88 Add wxString ctor from wxScopedCharBuffer and wxMBConv
This is more convenient and less error prone than using the existing
ctor taking char pointer and length as the buffer contains both.

Also add the corresponding assign() overload for consistency.

See #16490.
2017-12-06 03:41:25 +01:00
Vadim Zeitlin
6e678e3a85 Improve output of test failures for unprintable characters
Show non-printable characters when comparing strings more clearly if the
comparison fails, this is notably useful for strings containing NULs as
they were previously completely lost.
2017-12-06 03:23:26 +01:00
ARATA Mizuki
54dfc341ce Add a test for wxFile::ReadAll() with an embedded NUL
See #16490.
2017-12-06 03:10:27 +01:00
Pavel O
204bc3c887 Fix linking of wxscintilla in static monolithic build
wx-config didn't report -lwxscintilla for `wx-config --libs stc` in static
monolithic build.

Since stc is a part of monolithic lib, -lwxscintilla will be reported
for `wx-config --libs` now as well.
2017-12-05 23:02:47 +01:00
Paul Cornett
f75387850b Fix reading wide character data in wxFile::ReadAll()
See #16490
2017-12-05 11:29:38 -08:00
Paul Cornett
696a5ba3dd Fix for modified state not set after next change following a ChangeValue()
See #17540
2017-12-05 06:41:08 -08:00
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