Commit Graph

63673 Commits

Author SHA1 Message Date
Vadim Zeitlin
c85da939e5 Tidy up the previous commit slightly
Declare the variables just before using them (and also initialize them
at the same time); use more readable variable names; fix braces style
and add a comment explaining why do we do all this in the first place.

No real changes.
2017-12-10 19:21:03 +01:00
Jens Göpfert
57bdd372fb Reduce number of calls to GetLineStart() in generic wxDVC
GetLineStart() is very expensive when using wxDV_VARIABLE_LINE_HEIGHT
style, so don't call it again unnecessarily if we already have the
result.
2017-12-10 19:06:29 +01:00
Paul Cornett
67a28b7968 Use better approximation for gradient caption colors
Caption color is a better choice than black
2017-12-10 10:00:05 -08:00
Paul Cornett
fcf21e61db Add wxDisplay implementation for GTK+4
GdkMonitor replaces GdkScreen
2017-12-10 09:40:26 -08:00
Vadim Zeitlin
6f23cea6df Fix the path of Expat library after move to submodules
It's in src/expat/expat now instead of being directly under src/expat.
2017-12-10 17:53:21 +01:00
Vadim Zeitlin
05a40aa510 Merge branch 'master' into cmake
Pull in the latest fixes, notably for wx(X)Locale to allow the tests to
pass.
2017-12-10 17:52:06 +01:00
Vadim Zeitlin
198adec748 Merge branch 'xlocale-fixes'
Fix completely broken wxXLocale and wxLocale unit tests.
2017-12-10 17:48:20 +01:00
Vadim Zeitlin
b5d0a291a5 Merge branch 'msw-double-buffer'
Improve double-buffering support in wxMSW wxListCtrl and optionally use
it in wxTreeCtrl too.

Closes https://github.com/wxWidgets/wxWidgets/pull/636
2017-12-10 17:47:31 +01:00
Steve Browne
ef91e5ecbe Implement wxTreeCtrl::SetDoubleBuffered() in MSW wxTreeCtrl
Also don't erase background when the control is double-buffered because
it's not necessary and can cause flicker.

See https://github.com/wxWidgets/wxWidgets/pull/374
2017-12-10 17:47:26 +01:00
Vadim Zeitlin
061e6f9a3c Fix flicker when resizing columns of report-mode MSW wxListCtrl
Just turn off background erasing to avoid having horrible flicker which
can be seen perfectly well simply by drag-resizing a column in a list
control with non-default background colour.

See https://github.com/wxWidgets/wxWidgets/pull/374
2017-12-10 17:47:21 +01:00
Vadim Zeitlin
17105cfd07 Simplify changing window styles in wxMSW code
Add wxMSWWinStyleUpdater and wxMSWWinExStyleUpdater helper classes which
allow writing code changing GWL_STYLE and GWL_EXSTYLE bits,
respectively, in a shorter and more clear way.

There should be no real changes in behaviour.
2017-12-10 17:47:16 +01:00
Vadim Zeitlin
588ae3744c Move fallback BS_TYPEMASK definition to wx/msw/missing.h
It can be useful in source files other than src/msw/control.cpp too.
2017-12-10 17:47:11 +01:00
Vadim Zeitlin
badf6bc300 Disable scrollbars for frozen wxTreeCtrl in MSW
Replace the hack with resizing the control to the minimal possible size
while it's frozen with just disabling its scrollbars in the frozen
state. This should also fix the original problem (of scrollbar jumping
around wildly as the items are added), but without different problems
due to the control being resized unexpectedly.

Unfortunately we don't have a reproducer for the original problem, which
the commits 6754c300cf ("Freeze wxTreeCtrl
in wxMSW by hiding it") and 4e1e8dc51b
("Change wxMSW wxTreeCtrl::DoFreeze() to not hide the tree any more" --
but resize it instead) tried to fix, so it's difficult to be sure that
it really doesn't exist any more, but it does seem like it ought to be
as the comment added back then spoke of the problem with scrollbar
updating and this really shouldn't happen if scrollbars are completely
disabled.

See https://github.com/wxWidgets/wxWidgets/pull/375
2017-12-10 17:47:06 +01:00
Vadim Zeitlin
2ad2bccf33 Don't call static wxLocale::GetInfo() via an object
This is just confusing and unnecessary.

No real changes.
2017-12-10 03:28:18 +01:00
Vadim Zeitlin
9036b3dba8 Remove "C" locale date and time formats test
This test didn't make sense at all as it didn't actually test "C" locale
formats as calling setlocale(LC_ALL, "C") didn't actually change the
values returned by wxLocale::GetInfo(), so it still returned the values
corresponding to the French locale set in this test setUp() method and
the test only passed because it used wrong values (i.e. the same ones as
in French locale test).

We also don't have any simple way to test "C" locale formats, we can
only test them for wxLANGUAGE_DEFAULT, but this corresponds to the OS
defaults which can be customized by user (e.g. in the control panel
under MSW) and so we can't expect them to be equal to any fixed values.

The simplest solution is to just drop this test, as it's not very useful
anyhow (French locale test above already covers the same code).
2017-12-10 03:24:47 +01:00
Vadim Zeitlin
e97c020285 Fix wxLocale::GetInfo() test for French locale under macOS 10.12
The date and time format has changed since 10.10 and now contains an extra
" à " in its middle, so adjust the test to deal with this.
2017-12-09 19:04:52 -07:00
Vadim Zeitlin
38cc8498d1 Fix wxXLocale availability detection in configure
This was broken by 9507bc430e which
stopped defining HAVE_LOCALE_T in configure but didn't update the code
using it.

Restore the old behaviour by continuing to define HAVE_LOCALE_T even if
we don't test (just) for it any longer.

See https://github.com/wxWidgets/wxWidgets/pull/461
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
17041075b4 Fix wxLanguageInfo::GetLocaleName()
This function could (and did) return completely wrong results because
the value of the pointer returned by setlocale() could be (and was)
changed by the subsequent call to setlocale() with different arguments.

Fix the problem by copying the returned value into wxString immediately,
without any intervening setlocale() calls.
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
5e429702bf Fix fatal bug in wxXLocale initialization
Ensure that m_locale is always initialized to null pointer, as it could
remain not initialized at all if information for wxLanguage could be
found, but its locale name was empty, which resulted in a crash in dtor
when the wxXLocale object was destroyed as freelocale() was called with
an invalid pointer.
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
8cb84cd0f7 Add LexEDIFACT.cxx to wxscintilla library CMake sources
This file has been added after CMake branch split from master.
2017-12-09 23:56:12 +01:00
Vadim Zeitlin
f6c7e8f774 Don't use "-t" command line option when running tests
This option just lists the available tags now instead of running the
tests with timing information as before.
2017-12-09 22:00:34 +01:00
Vadim Zeitlin
82b92c6d8f Update CMake files after switch from CppUnit to Catch
Don't look for CppUnit library nor build it any longer, but just use the
Catch headers under 3rdparty/catch.
2017-12-09 18:33:12 +01:00
Vadim Zeitlin
d37f758ae9 Update the list of non-GUI test source files
streams/bstream.cpp was removed in the meanwhile while a new
strings/hexconv.cpp was added.
2017-12-09 18:25:33 +01:00
Vadim Zeitlin
aa4d51d579 Fix font creation using font flags in Cairo wxGraphicsContext
Don't crash trying to use an uninitialized font in
GetPartialTextExtents() later if the font was created using
CreateFont(sizeInPixels, facename, flags) overload.

Closes #18021.
2017-12-09 16:31:28 +01:00
Vadim Zeitlin
bd6d22d890 Avoid trailing spaces in auto-generated build/cmake/setup.h.in
Tweak the sed command to ensure that "\1" in it refers only to the name
of the preprocessor symbol being defined, without all the spaces after
it.
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
c66c9c5ae6 Merge branch 'build_cmake' of https://github.com/TcT2k/wxWidgets
Add CMake-based build system.

Merge the original branch without any changes except for resolving the
conflict due to moving the contents of .travis.yml to a separate file by
propagating the changes done in this file since then to the new script
and rerunning ./build/update-setup-h and ./build/cmake/update_files.py
to update the file lists changed in the meanwhile.

Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
22e14e7c7b Check for wxXLocale availability without using wxLocale
This extends the changes done 01cd702ee3
to another test case and so makes as much sense as the other commit.

It's still not clear what's really going on here as, somehow, this test
passed under AppVeyor before, which shouldn't have been happening if the
explanation in that commit message was correct. And it also doesn't
explain why did it suddenly fail after a completely unrelated change,
see https://ci.appveyor.com/project/wxWidgets/wxwidgets/build/2502/job/l24gc2j0j7h7huxl
2017-12-09 14:17:34 +01:00
Vadim Zeitlin
ddf3604545 Fix harmless warning in Base64 unit test
Avoid

warning C4245: 'initializing': conversion from 'int' to 'std::size_t', signed/unsigned mismatch

from MSVC with an explicit cast.
2017-12-09 14:15:37 +01:00
Vadim Zeitlin
f4af243e5c Enable wxUSE_GRAPHICS_CONTEXT for MinGW >= 4.8
It seems that MinGW-w32 started distributing GDI+ headers since this
version and MinGW-w64 might have supported them for even longer, but
it's difficult to test for the MinGW distribution used in this header,
as it is included before wx/msw/gccpriv.h which defines
__MINGW32_TOOLCHAIN__ and __MINGW64_TOOLCHAIN__ symbols and changing
this is tricky due to relative order of defining UNICODE and
wxUSE_UNICODE and including MinGW headers, which can only be included
once UNICODE is set properly.

But while the fully correct solution is difficult, just checking for the
compiler version should solve the problem in 99.99% of the cases in
practice as there should be vanishingly few people using MinGW-w64 with
gcc < 4.8 currently, so this simple solution is good enough.

Closes #17973.
2017-12-08 19:42:21 +01:00
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