Commit Graph

66667 Commits

Author SHA1 Message Date
Maarten Bent
181a03fc73 CMake: Only use -fno-rtti for C++
Using it for C generates the following warning:
command line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
2019-07-19 01:09:36 +02:00
Olly Betts
b3ef78124c Remove the flash sample
Adobe have announced the official EOL for flash is 2020 so we're
now at the point where support for flash just isn't interesting
any more.

It doesn't make sense to support it for the upcoming 3.2.x release
series, and the sample .swf files are lacking source code.

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

Closes #15886.
2019-07-18 17:48:23 +02:00
Vadim Zeitlin
08c7a0ca82 Hack to make wxHtmlPrintout unit test pass under wxGTK3
Set the "printer" PPI explicitly for wxMemoryDC used in the test to
ensure that it's the same in all ports: currently wxGTK3 stands out
because it uses 72 DPI unlike wxMSW and wxGTK2, which use 96.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
9ad8b6d6b7 Fix bug in scrolled single line wxTextCtrl::HitTest() with GTK 3
There seems to be something wrong with the vertical offset returned by
gtk_entry_get_layout_offsets() in GTK 3, so just don't use it at all, as
we don't need it anyhow.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
c1cbacd0ad Skip wxWebView unit tests when using wxGTK2
All tests currently fail because the initial LOADED event is never
received.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
96c3b11b99 Disable another wxSTC unit test mysteriously failing under Xvfb
For some reason, the control does lose focus there, even if it doesn't
happen when using a normal X11 server.

Just disable the test in this environment.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
8b6f79c886 Disable wxStyledTextCtrl unit test failing under wxGTK
wxStyledTextCtrl does _not_ always retain focus under wxGTK currently
while the STC popup is shown, even though it does get it at the end.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
c92b39a13d Disable tests requiring a WM under Xvfb
Both iconization and activation of TLWs is dependent on the presence of
a WM, but there is no WM running under Xvfb, so skip these tests in this
case.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
8634808a6c Make wxRadioButton focus test MSW-specific
This test doesn't need to, and actually does not, pass under wxGTK,
where a radio button can have focus without being selected, unlike in
wxMSW.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
e3caafabc3 Provide more information for failures involving FindFocus()
It is useful to know where the focus actually is when a test checking
that it's set to a particular window fails.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
ee0f21388f Add a helper IsRunningUnderXvfb() function to the test suite
This will allow disabling some tests which fail when running only under
Xvfb.

The new function doesn't work automatically because there doesn't seem
to be any way to distinguish it from the usual server, so it just checks
whether wxUSE_XVFB=1 is set in the environment, as is done by Travis CI
build script.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
7425fd0c50 Explicitly request 24bpp screen with Xvfb
Older versions of the server default to 8bpp, which breaks some of our
tests (admittedly, this shouldn't be the case, but it's probably better
to test in the same configuration as is used by 99.99% of the users
rather than adjusting or disabling tests in the remaining 0.01%).
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
342494e5f4 Only run GUI tests for the selected wxGTK builds
The tests are known to fail for the other tested ports, so don't enable
them for now.

Also, using a special environment variable allows to detect when the
test is being run under Xvfb, which behaves differently from the normal
X server in some cases.
2019-07-18 17:45:20 +02:00
Scott Talbert
e5b76a3b13 Run GUI tests under Travis using xvfb-run
Closes https://github.com/wxWidgets/wxWidgets/pull/905
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
7eeff36635 Give more information in case of wxImage comparison failure
Show the value of the first differing pixel to get at least some idea of
what is wrong.
2019-07-18 17:45:20 +02:00
Vadim Zeitlin
76e21c2ffa Merge branch 'gtk-persist-tlw'
Fix bugs affecting wxPersistentTLW under GTK.

See https://github.com/wxWidgets/wxWidgets/pull/1419
2019-07-18 17:44:35 +02:00
Vadim Zeitlin
6eac636576 Fix wxListCtrl column resizing with old comctl32.dll v5
The fix for visual artefacts when resizing columns with comctl32.dll v6
introduced them when using v5 of the DLL, so apply it only conditionally
now.

See #18032, #18441.
2019-07-17 02:59:51 +02:00
Vadim Zeitlin
c35075cbf0 Only use double buffering for MSW wxListCtrl when using themes
LVS_EX_DOUBLEBUFFER doesn't seem to work correctly with comctl32.dll v5,
and results in artefacts when the control is resized, so don't enable it
for it.

Closes #18441.
2019-07-17 02:59:50 +02:00
Vadim Zeitlin
b61a75d2d6 Merge branch 'msw-fontinfo-v0-fix'
Fix a user visible regression after fractional point size changes: don't
create 0-sized fonts from the wxNativeFontInfo version 0 strings.

See https://github.com/wxWidgets/wxWidgets/pull/1422
2019-07-16 23:20:37 +02:00
Maarten Bent
5bf5581dbe CMake: Disable finding X11 session manager by default
This is the same behaviour as configure has.
2019-07-16 22:58:48 +02:00
Vadim Zeitlin
e5f4e1b1b5 Merge branch 'webview-test'
Some cleanup of the webview test.

No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/1420
2019-07-16 20:22:21 +02:00
Igor Korot
1879e8e646 Make wxColourData parameter of wxColourDialog ctor const
This parameter is not modified by wxColourDialog (this might have been
the case, or at least the plan, some long time ago) and so has no reason
not to be "const".

Just add the qualifier to ctor and Create() in all ports.

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

Closes #12511.
2019-07-16 20:19:33 +02:00
Vadim Zeitlin
e21c4c78ca Remove unnecessary map-event callback in wxGTK wxFileDialog
Calling gtk_file_chooser_set_show_hidden() directly from Create() works
just as well and is simpler and shorter.

See https://github.com/wxWidgets/wxWidgets/pull/1413
2019-07-16 20:11:34 +02:00
oneeyeman1
8748a476c3 Add flag for displaying hidden files in the file dialog
Add wxFD_SHOW_HIDDEN and implement support for it for all the major
ports.

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

Closes #9342.
2019-07-16 19:59:48 +02:00
Vadim Zeitlin
7e90def99a Merge branch 'gtk-text-changed-coalesce'
Harmonize wxEVT_TEXT events in wxGTK with other ports.

Also use IME for wxComboBox in wxGTK too.

See https://github.com/wxWidgets/wxWidgets/pull/1400
2019-07-16 19:41:32 +02:00
Deamhan
0be2d94189 CMake: add an option for using preferred release build flags
Add wxUSE_OPTIMISE build option.

See #18436.

Closes https://github.com/wxWidgets/wxWidgets/pull/1399
2019-07-16 18:34:57 +02:00
Vadim Zeitlin
c219b53a2d Merge branch 'cmake-gcc-static' of https://github.com/Deamhan/wxWidgets
Add support for using static CRT libraries with gcc to CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/1398
2019-07-16 18:25:52 +02:00
Vadim Zeitlin
e27eebdd2a Work around GTK problems in wxPersistentDVC unit test
We need to wait until wxDataViewCtrl is realized for its columns widths
to be actually set, as calling gtk_tree_view_column_set_fixed_width()
just queues a resize that will take effect later, as documented in the
previous commit.
2019-07-16 18:25:40 +02:00
Vadim Zeitlin
4c553c1db2 Document delayed effect of wxDataViewColumn::SetWidth() in wxGTK
It may be surprising that calling GetWidth() after SetWidth(100) still
returns 0, so at least document this behaviour (fixing it doesn't seem
to be easily possible).
2019-07-16 18:23:35 +02:00
lucian-rotariu
04f7f1fd32 Add support for freezing columns and/or rows of wxGrid
Add wxGrid::FreezeTo() method which allows to freeze the given number of
columns and/or rows at the beginning of the grid, i.e. keep them pinned
in place while the rest of the grid is scrolled.

The main wxGridWindow (m_gridWin) now corresponds to the non-frozen part
of the grid, with up to 3 new similar windows for the frozen
rows/columns and the frozen corner cells (which only exist if both rows
and columns are frozen) being additionally used.

Doing this involved adding "wxGridWindow*" parameter to many functions
that previously only worked with m_gridWin itself and addressing
additional complications, such as mouse events that can now cross
different windows.

See https://github.com/wxWidgets/wxWidgets/pull/952 for the original
version of the changes.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
f61b58bba3 Override wxGrid::ScrollWindow() to scroll row/column labels too
Instead of doing it in overridden wxGridWindow::ScrollWindow(), do it
from wxGrid::ScrollWindow() itself, this makes more sense and will make
it easier to generalize it to scroll more windows.

No real changes yet.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
a871229f8b Refactor wxGrid code to use SetNativeHeaderColXXX() functions
Add two simple helpers: SetNativeHeaderColCount() and
SetNativeHeaderColOrder() and call the latter from the former to ensure
that the columns order is always correct when switching to the native
control.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
3baeb6e834 Rename wxGrid::m_colWindow to m_colLabelWin
No real changes, just rename it for consistency with m_rowLabelWin.
2019-07-16 18:01:36 +02:00
lucian-rotariu
00224e3f30 Add wxGrid::RefreshBlock() helper
This simple function combines BlockToDeviceRect() and
wxWindow::Refresh() calls and allows to avoid the ugly casts in
wxGridSelection code as well as making the code slightly shorter and
more clear.

No real changes.
2019-07-16 18:01:36 +02:00
lucian-rotariu
cf3709147a Use wxGrid::UpdateGridWindows() helper in wxGridSelection code
This function advantageously replaces the ugly casts that were used in
wxGridSelection code before.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
d37a15444f Add simple wxGrid::GetGridCursorCoords() method
This is sometimes more convenient than using GetGridCursor{Row,Col}()
separately.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
b69b4206c6 Add wxScrollWindow::ShouldScrollToChildOnFocus() virtual hook
This method can be overridden to indicate that the scrolled window
doesn't want its children to be scrolled into view when they're focused,
which is the default behaviour.

Also reuse this method for Mac-specific scrollbar workaround.
2019-07-16 18:01:36 +02:00
Vadim Zeitlin
228cd926e2 Initialize point size correctly from v0 native font info strings
Reading native font info strings in v0 format, used by the previous
wxWidgets versions, resulted in creation of fonts with 0 point size,
which resulted in suboptimal user experience when such a font was used
to display text.

Fix this by initializing point size to the value corresponding to the
font height in pixels using the default DPI, just as we already do when
creating wxNativeFontInfo from a LOGFONT.
2019-07-16 14:37:19 +02:00
Vadim Zeitlin
5507f8eebc Add wxNativeFontInfo::GetPointSizeFromLogFontHeight() helper
No real changes, just refactor the code previously present in both
wxNativeFontInfo ctor and SetPixelSize() in a single function and reuse
it in both places.
2019-07-16 14:33:36 +02:00
Deamhan
7c8d5dd36d CMake: -Wl,--exclude-libs=ALL has been removed for MinGW 2019-07-16 08:24:24 +03:00
Vadim Zeitlin
1e0d47452c Replace CppUnit check macros with CATCH ones
No real changes, just use more natural CHECK() instead of
CPPUNIT_ASSERT() and CPPUNIT_ASSERT_EQUAL().
2019-07-16 02:26:57 +02:00
Vadim Zeitlin
2b71ce3664 Get rid of CppUnit boilerplate in wxWebView unit test
This not only cuts down on its size, but will make it simpler to skip
this test in the environments where web access is unavailable in the
upcoming commit.
2019-07-16 02:26:57 +02:00
Vadim Zeitlin
f8bdf123f2 Remove unnecessary header from the webview unit test
No real changes.
2019-07-16 02:26:57 +02:00
Vadim Zeitlin
70f40e2f6a Fix position returned for iconized windows in wxGTK
Don't lose window position when the window is iconized, as this prevents
it from being correctly saved by wxPersitentTLW, for example, resulting
in failures in the corresponding unit test.

Unfortunately there doesn't seem to be any simple way to just ignore the
bogus (0, 0) configure events that we get from GTK when the window is
iconized, as explained in the comment, so we're reduced to remembering
the last position and restoring it when we realize that the window got
minimized and not moved, after all. This is obviously not ideal, as
there is still a lapse of time when (0, 0) is returned, but there just
doesn't seem to be anything better to do.
2019-07-16 02:26:11 +02:00
Vadim Zeitlin
8d405b80e4 Wait for the TLW to become iconized under GTK in the test
Iconize() doesn't take effect immediately, so wait until it does for up
to some reasonable amount of time.
2019-07-16 02:26:11 +02:00
Vadim Zeitlin
8cdd20667f Initialize wxTopLevelWindow::DecorSize in wxGTK
Add default ctor for this struct as it was too easy to forget to
initialize it otherwise, ending up with bogus values in it, as it
happened with wxTLWGeometry::m_decorSize, which resulted in a failure in
wxPersistTLW unit test and, probably, real code too.
2019-07-16 02:26:11 +02:00
Vadim Zeitlin
f9f58cca54 Mention that Iconize() and Maximize() don't have immediate effect
At least in wxGTK, the change of the window state is asynchronous.
2019-07-16 02:26:11 +02:00
marius
8ab9fed14e Fix wxGenericTimerImpl DLL declaration in wxX11 build
This class is defined in the core library, so use the appropriate
WXDLLIMPEXP macro.

Closes #16813.
2019-07-16 02:06:01 +02:00
Deamhan
f4a0ac93e3 CMake: wxUSE_VISIBILITY is non windows option now & -Wl,--exclude-libs=ALL has been added in MinGW case. 2019-07-15 19:13:58 +03:00
Vadim Zeitlin
7db13c7b93 Merge branch 'pm-dpi-aware-1-systemmetric' of https://github.com/MaartenBent/wxWidgets
Make GetSystemMetrics() and wxSystemParametersInfo DPI-aware in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1407
2019-07-15 13:21:16 +02:00