Commit Graph

63623 Commits

Author SHA1 Message Date
Paul Cornett
ecfcab41e5 Simplify setting background color in wxPseudoTransparentFrame 2017-11-25 10:56:15 -08:00
Paul Cornett
ee0b07fc31 Avoid deprecated GtkAlignment with GTK3 2017-11-25 10:54:32 -08:00
Vadim Zeitlin
cf02d15646 Merge branch 'appveyor-tests'
Fix several problems in tests under MSW (mostly with MinGW) and enable
building and running them on AppVeyor CI.
2017-11-25 19:18:14 +01:00
Paul Cornett
003faa993e Use CSS for window font and colors on GTK3
Avoids deprecated gtk_widget_override_* functions
2017-11-25 10:13:34 -08:00
Maarten Bent
a96171def4 Fix unused variable and parameter warnings in samples
These variables are only used in debug builds, causing warnings in release builds.
2017-11-25 17:52:08 +01:00
Maarten Bent
afc02a34ee More use of wxFALLTHROUGH in MSW code and samples 2017-11-25 17:52:08 +01:00
Maarten Bent
6315ae04fb Fix reading poems from file in wxPoem demo
When using ftell to get the position in the file, it should be opened in binary mode.
Regenerate the poem index file with the correct start positions.
Use the wxICON macro for creating the icon, so .ico is used on Windows.
2017-11-25 17:52:07 +01:00
Maarten Bent
4d8fad3d80 Fix warnings and modernize demo code
Fix wxFont, wxPen and wxBrush style deprecation warnings.
Add wxFALLTHROUGH to resolve implicit fallthrough warnings in switch statements.
Fix build error when using long for GetTextExtent (with wxUSE_GRID 0).
Remove unused icon from fractal demo.
2017-11-25 17:52:07 +01:00
Maarten Bent
dc6858d905 Fix wxPen and wxBrush style deprecation warnings in utils
Fix a warning about hidden local variable in the helpview util.
2017-11-25 17:52:07 +01:00
Maarten Bent
2156d29801 Add FindOrCreateFont overload accepting wxFontInfo 2017-11-25 17:52:03 +01:00
Vadim Zeitlin
b29aa3f785 Run unit tests on AppVeyor too
Launch the tests after building them.
2017-11-25 17:30:51 +01:00
Vadim Zeitlin
f10bd1279d Remove the correct directory from PATH for MinGW AppVeyor builds
We need to remove the directory containing sh.exe from the PATH as
otherwise mingw32-make seems to use it and not cmd.exe for executing the
commands in the makefile, but the wrong directory was being removed in
appveyor.yml, having no effect.

Fix this and undo 5f2ccde269 which
compensated for it by (almost) clearing the PATH entirely which, in
turn, broke one of our unit tests (and could break other things in the
future, as having an empty PATH is rather unexpected).

Also use the full path for head program now that its directory is not in
the PATH any more. Alternative could be to use PowerShell, but while

powershell -Command "'gcc','mingw32-make','ar'|%%{ iex \"$_ --version\"|select -first 1 }"

does work, it looks really ugly, so avoid it for now.

See https://github.com/wxWidgets/wxWidgets/pull/142

See #17274.
2017-11-25 17:28:42 +01:00
Vadim Zeitlin
4e4617a9e6 Show value if comparison fails in VarArgTestCase
Use string comparison instead of wxStrcmp() to view the actual value of
the string if it doesn't have the expected value.
2017-11-25 17:28:42 +01:00
Vadim Zeitlin
01cd702ee3 Test for wxXLocale availability directly in the unit test
Apparently a locale can be available at MSW level, so that
wxLocale::IsAvailable() returns true, but not supported by the MSVC CRT,
so that constructing the corresponding wxXLocale fails, which resulted
in wxXLocale unit test failures.

Fix them by checking that wxXLocale can be constructed directly instead
of using wxLocale::IsAvailable() as a proxy.

This is not ideal and perhaps wxLocale::IsAvailable() should check that
the locale is supported in wxXLocale too, but should at least allow unit
tests to pass on AppVeyor for now.
2017-11-25 17:28:42 +01:00
Maarten Bent
cbf13e68a2 Replace deprecated std::auto_ptr with wxScopedPtr 2017-11-25 17:00:18 +01:00
Vadim Zeitlin
62f9438ad3 Rewrite wxPathList unit test without CppUnit-compatible API
Simplify the test by using a single function instead of all the
machinery inherited from CppUnit.

Also provide more information in case of test failure.
2017-11-25 16:08:01 +01:00
Vadim Zeitlin
b630abffd2 Fix FormatConverterTestCase for MinGW and Cygwin
Standard/Unix format strings are intentionally used when using these
compilers/environments (see d62c535d4c for
the former), so don't check for Windows/MSVC format strings in the test.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
471a771382 Fix built-in wxPrintf() for repeated positional parameters
Allow wxPrintf("%1$s %1$s", "foo") to work.

Take into account the possibility that the number of format specifiers
and the number of actual arguments can be different.

Closes #9367.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
dd8155980b Enable building the unit tests for x64 in MSVS solutions
For some reason (but probably accidentally), building tests was disabled
for x64 platform.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
3508e3a623 Disable test for clicking URLs under AppVeyor
It fails, for whatever reason, even though it passes locally and other
tests using wxUIActionSimulator work under AppVeyor too.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
753aa757a4 Recognize AppVeyor CI environment in unit tests
Check for APPVEYOR environment variable in addition to TRAVIS one.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
0c29775d4d Skip wxTopLevelWindow showing/activation tests in CI builds
It doesn't seem to work when run unattended, for whatever reason.
2017-11-25 11:13:02 +01:00
Vadim Zeitlin
838a687d94 Document wxComboBox::SetValue() better in wxCB_READONLY case
Make it clear that the control doesn't send wxEVT_TEXT event in this
case.
2017-11-25 10:47:50 +01:00
Vadim Zeitlin
075ebbe12a Skip AppVeyor CI builds on documentation-only changes
There is no need to rebuild everything if only the documentation files
have changed.

Unfortunately there doesn't seem to be any way to do the same thing for
Travis CI yet, see https://github.com/travis-ci/travis-ci/issues/6301
2017-11-25 10:47:50 +01:00
pavelxdd
885b97282a Change xml properties to attributes in xtixml.cpp
Probably a follow-up fix for commit from 10 years ago: 288b610

This fixes compilation with `--enable-extended_rtti` configure flag.

Also removed all trailing spaces in this file.
2017-11-25 09:13:11 +03:00
pavelxdd
4156634b24 Fix macros in xti.cpp
Replaced `wxToStringConverter<type, data, result)` with
`wxFromStringConverter<type>(data, result)`, which was broken
for 7 years since the commit 13830d6

This fixes compilation with `--enable-extended_rtti` configure flag.

Also removed all trailing spaces in this file.
2017-11-25 08:52:01 +03:00
Vadim Zeitlin
a065e98a22 Regenerate configure after recent files additions
Fix undefined variable in the makefile.
2017-11-25 00:32:55 +01:00
Vadim Zeitlin
7130b4c611 No real changes, just regenerate autoconf_inc.m4 from scratch
Get rid of outdated references in this file.
2017-11-25 00:28:29 +01:00
Vadim Zeitlin
99db923c2c Add more missing generic headers to wxQt headers list
See f5cdda7b8b (commitcomment-25822547)
2017-11-25 00:25:14 +01:00
Vadim Zeitlin
53bf5936f1 Rename QT_LOWLEVEL_{HDR,SRC} to just QT_{HDR,SRC}
These file lists contained files that were not low level (meaning "used
by wxQt/Univ" in this context) at all and it doesn't make much sense to
think about Qt-based wxUniv port anyhow, so instead of painstakingly
separating them in low level part and the rest, just rename the
variables to be less confusing.
2017-11-25 00:12:38 +01:00
Vadim Zeitlin
472bb3d6d2 Fix wxUSE_PRIVATE_FONTS definition in configure
Only define it unconditionally for wxMSW and wxOSX, not wxGTK where we
need to test that the required versions of FontConfig and Pango Fc are
available.

Also do all wxUSE_PRIVATE_FONTS-related checks in the same place, to
make things more clear and avoid similar blunders in the future.
2017-11-25 00:07:01 +01:00
Vadim Zeitlin
19c4172671 Correct example of using wxDataObjectComposite in the docs
Don't call base class pure virtual method, but do call GetData() before
using the data object. Also fix a typo in a variable name.
2017-11-24 23:10:47 +01:00
Vadim Zeitlin
778340a286 Merge branch 'private-fonts'
Add support for using application-private fonts.

Closes #13568.

Closes https://github.com/wxWidgets/wxWidgets/pull/591
2017-11-24 22:58:09 +01:00
Vadim Zeitlin
b040dab0ca Add wxUSE_PRIVATE_FONTS and drop wxHAS_PRIVATE_FONTS
Handle this feature as all the other ones and provide a configure switch
and a setup.h option to disable it if necessary, as it may be desirable
to do it, especially under Linux, to avoid extra dependency on pangoft2
if this functionality is unnecessary.
2017-11-24 22:56:17 +01:00
Vadim Zeitlin
ba5a203105 Rewrite TLW unit test as a single function
Get rid of the unnecessary test case class.

No real changes yet.
2017-11-24 22:55:11 +01:00
Vadim Zeitlin
a68cb585cd Consistently use "unsigned" and "%u" in font unit test
Don't mix "size_t" and "unsigned" and don't use "%lu" for printing
"size_t" values as this doesn't work under Win64 where sizeof(size_t) is
8 while sizeof(unsigned long) is still just 4.
2017-11-24 22:55:11 +01:00
Vadim Zeitlin
bc100ff31e Build tests under AppVeyor too 2017-11-24 22:55:11 +01:00
Vadim Zeitlin
a50541795c Compilation fix for VsnprintfTestCase with Catch
Rewrite an assert using "||" as 2 asserts to allow it compile with Catch
(this wasn't detected before as this code is only compiled when using
our own vsnprintf() implementation, which is usually not the case).
2017-11-24 22:55:11 +01:00
PB
a04782238d Update version in the examples used in docs/msw/install.txt
Update the version number contained in the library file names to 3.1, e.g.,
from "wxmsw30ud_core.lib" to "wxmsw31ud_core.lib".
2017-11-23 18:15:04 +01:00
Vadim Zeitlin
25da7a58ef Allow safely disabling touch events from a touch event handler
Don't delete the window wxWindowGesturesData when calling
EnableTouchEvents(wxTOUCH_NONE) but just free it, to make it safe to
call EnableTouchEvents() even from a touch event handler, which later
returns to wxGTK code that could still use the gestures data object.
2017-11-23 13:33:36 +01:00
Vadim Zeitlin
d6af0236c5 Simplify GTK+ 2 version checks with a helper function
Use wx_is_at_least_gtk2(minor) instead of gtk_check_version(2, minor)
because it is more clear and also works as expected (i.e. returns true)
when using GTK+ 3 instead of creating difficult to notice bugs in the
code by failing the version check in this case.

See #18004.
2017-11-23 13:15:31 +01:00
Vadim Zeitlin
166f754973 Fix comparison of size_t values with -1 in base 64 unit test
This doesn't work correctly in Catch after reverting the commit that
broke compilation with MSVC 9, so we have to live with explicitly using
the values of the correct type.
2017-11-23 02:02:19 +01:00
Maarten
bb9cd7a912 Fix rescaling image with wxIMAGE_QUALITY_BOX_AVERAGE
Work around rounding errors caused by using doubles.

Update reference images.

Closes https://github.com/wxWidgets/wxWidgets/pull/615
2017-11-23 00:36:46 +01:00
Jake Nelson
a8671869e5 Fix wxButton::SetBitmapPosition() with GTK+ 3
Make the check for GTK+ >= 2.10 pass for GTK+ 3 too by simply not making
it in this case.

Closes #18004.
2017-11-22 23:23:42 +01:00
Vadim Zeitlin
0b8c4d54a8 Don't run FTP unit test by default any longer
ftp.wxwidgets.org seems to have gone, breaking the existing test (thanks
chris for all the fish...), so don't hardcode this URL in the test and,
without it, don't run the test by default any more and require
specifying a working FTP host (as well as an existing directory and a
file on it) when running it manually.

Rewrite the test using normal functions instead of Java-like structure
imposed by CppUnit to make it simple to skip it.
2017-11-22 22:48:05 +01:00
René J.V. Bertin
10201c2732 Add support for stock menu items to wxQt
Sets the new QAction's text and shortcut properties to the
values provided by the corresponding wxGetStockXXX() functions.

Closes https://github.com/wxWidgets/wxWidgets/pull/613
2017-11-22 22:08:07 +01:00
Vadim Zeitlin
04209e3a3e Remove GetStandardCmdLineOptions() from wxGTK
Unfortunately there is no reasonable way to implement this function for all
glibc versions as the information we need is stored in the private
_GOptionGroup struct whose layout has already changed once (in 2.44) and could
change again, so we can't rely on it.

We really need a g_option_group_get_entries() in glib itself, but the request
to add it at http://bugzilla.gnome.org/show_bug.cgi?id=431021 hasn't been
touched since 10 years, so it seems unlikely to happen.

See 99367a1530 (commitcomment-25789514)
2017-11-22 22:02:36 +01:00
Vadim Zeitlin
f5cdda7b8b Add missing qt/nonownedwnd.h to the list of headers
Also add the previously added src/qt/nonownedwnd.cpp to the master files
list.
2017-11-22 21:49:56 +01:00
Vadim Zeitlin
e82cdf4a1e Merge branch 'travis-gtk3'
Test wxGTK3 on Travis too.
2017-11-22 12:57:24 +01:00
Paul Cornett
135e3875e2 Hide wxSpinButton's underlying GtkEntry using CSS on GTK+ >= 3.20 2017-11-21 22:05:08 -08:00