Commit Graph

67395 Commits

Author SHA1 Message Date
Vadim Zeitlin
57d2be63fc Wait until grid is fully shown in the unit test
Without this, the mouse clicks sometimes are received by the parent
frame and not the grid itself.
2019-10-17 22:04:20 +02:00
Vadim Zeitlin
94bdb7402d Don't do anything in WaitForPaint class under non-GTK platforms
Under MSW the tests pass even without it, so don't make them take longer
unnecessarily.
2019-10-17 22:03:44 +02:00
Vadim Zeitlin
8534ec4699 Get rid of an unnecessary function in wxWindow unit test
No real changes, just inline a short function only used once.
2019-10-17 22:01:36 +02:00
Vadim Zeitlin
c810bfad47 Move WaitForPaint helper into a header
No real changes, just make this class, used in wxWindow::SetSize() tests
only so far, reusable in the other tests.
2019-10-17 21:59:06 +02:00
Vadim Zeitlin
7d6d514984 Improve WaitForPaint helper used in window unit tests
Unbind the event handler referencing a local variable, as leaving it
bound could result in a crash later if another paint event was generated
for the window for whatever reason.

Doing it like this requires using 2 different objects, but the
complexity can be still hidden inside WaitForPaint class, with the 2nd
object being just a member of it, and, in fact, makes the code using it
simpler as it doesn't need to use a boolean variable with it.
2019-10-17 17:07:00 +02:00
dos
5413f68c61 Build vc14x libraries in official binaries build script
Replace vc140,vc141,vc142 builds using VS2015,VS2017,VS2019
with a single set of libraries using vc14x toolset built with VS2015.

Closes https://github.com/wxWidgets/wxWidgets/pull/1607
2019-10-17 17:02:07 +02:00
Vadim Zeitlin
7a980c455e Fix crash in wxDataViewTreeCtrl::DeleteAllItems() in wxGTK
Restore the checks for the model stamp, reverting the changes of
18594afe76: we still need to ignore the
calls to at least iter_children() and iter_nth_child() model methods
that can be called from inside gtk_tree_view_set_model() when we reset
the model, as running these methods crashes when trying to use the
pointers to already deleted items.

For consistency and robustness, add checks for the model stamp to all
the methods and not just those two, just in case other ones end up being
called later in some way.

Also add a unit test checking that DeleteAllItems() doesn't crash and
does delete all items.

Closes #18533.
2019-10-17 14:57:04 +02:00
Thomas Klausner
a3212b35f6 Fix udata type in wxFileSystemWatcher code under NetBSD 10
The previous fix in 5442edbbe9 corrected
the type for the older NetBSD versions, but not NetBSD 10, which now
uses "void*", as all the other platforms, so restrict the original fix
to NetBSD versions < 10 only.

See #18199.
2019-10-16 23:23:31 +02:00
Paul Kulchenko
e4111c521e Update to use GetScaled* methods in auiTabArt calculations. 2019-10-15 22:20:29 -07:00
Vadim Zeitlin
29be54d76e Define all stock colours using their fixed RGB values
For some reason, names were used for cyan and light grey, even though
all the other ones used RGB values since refactoring the stock objects
to be created on demand in f516d98637.

Use RGB values for these two as well now.

Closes #18530.
2019-10-15 23:13:04 +02:00
Vadim Zeitlin
ad7fb7f4aa Merge branch 'warnings' of https://github.com/catalinr/wxWidgets
Fix MSVS analyzer warnings about int multiplication overflow and
uninitialized member variables.

See https://github.com/wxWidgets/wxWidgets/pull/1606
2019-10-15 22:50:17 +02:00
Vadim Zeitlin
ed783b95f8 Add a hack to make wxGrid UI unit test pass
This is an ugly workaround for a mysterious problem occurring with the
simulated "Enter" presses under GTK, but it's worth it, as it allows all
grid tests, including the ones using wxUIActionSimulator, to pass now
under wxGTK2 (a couple of tests still fail under wxGTK3).
2019-10-15 03:18:28 +02:00
Vadim Zeitlin
f65133a41f Call XFlush() after simulating mouse button events too
For some reason, mouse press events were still received without
flushing, but mouse release ones were not received by GTK itself (and a
fortiori by wxGTK) without it.
2019-10-15 00:07:38 +02:00
Vadim Zeitlin
1df0b0ac99 Use "CurrentTime" symbolic constant in XTestFakeXXXEvent()
No real changes, just replace "0" with a more clear constant.
2019-10-14 23:59:34 +02:00
Vadim Zeitlin
2228caa8d4 Don't disable logging in the tests if WXTRACE is set
Disabling logging makes WXTRACE useless, so avoid doing it in this case
to facilitate debugging the code exercised by the tests.
2019-10-14 23:40:08 +02:00
catalinr
67dd28619f Cast more int vars to double to avoid overflow warning 2019-10-14 22:20:37 +03:00
catalinr
62981e1561 Move member initialization in default ctor 2019-10-14 21:34:00 +03:00
Paul Cornett
cfdcc3c29d Remove unreachable code 2019-10-14 09:32:40 -07:00
Paul Cornett
29e0da97d1 Remove invalid flag from HDITEM mask
HDF_LEFT is zero, so it had no effect, but it doesn't belong there
2019-10-14 09:27:50 -07:00
Paul Cornett
2ece977ed7 Add copy ctor for wxUniCharRef
It just does the default, but C++11 deprecates having copy assignment operator
without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings.
2019-10-14 09:08:13 -07:00
Paul Cornett
a3598ba33f Remove unnecessary copy ctors/copy assignment operators
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Paul Cornett
764c01832d Use C++11 member-delete in NO_COPY_CLASS/NO_ASSIGN_CLASS macros 2019-10-14 09:06:48 -07:00
catalinr
0508764973 Initialize isLSB to avoid warning 2019-10-14 08:10:41 +03:00
catalinr
2fc569f0c2 Initialize member variables to avoid warnings 2019-10-14 08:09:47 +03:00
catalinr
c150ece20f Cast int to double to avoid arithmetic overflow warning 2019-10-14 07:49:28 +03:00
Maarten Bent
05e0fad687 Resolve some recently introduced warnings 2019-10-13 08:34:30 -07:00
Vadim Zeitlin
ddd7ef45d0 Use CHECK() instead of CPPUNIT_ASSERT_EQUAL(), i.e. REQUIRE()
Perform all the checks, even if one (or more) of them fails.
2019-10-13 01:56:13 +02:00
Vadim Zeitlin
97b3e6e50b Check that the grid cell has the expected value in the test
In addition to checking that we get the expected events, also verify
that editing the cell actually worked.
2019-10-13 01:56:13 +02:00
Vadim Zeitlin
879d6e40b2 Fix wxGrid cell editing unit test in wxGTK
Wait until the in-place editor is actually shown and then wait again
until is hidden.
2019-10-13 01:56:13 +02:00
Vadim Zeitlin
b66a4b9948 Add a menu item to start editing the cell to grid sample
Show that this is done using EnableCellEditControl() and not
ShowCellEditControl(), as might have been expected.
2019-10-13 01:56:13 +02:00
Paul Kulchenko
ba8cbf6027 Fix width for toolbar items with dropdown when scalefactor >1. 2019-10-12 10:34:57 -07:00
Paul Kulchenko
af0ad629ca Update to fix formatting style for multi-line if. 2019-10-12 10:31:12 -07:00
Paul Kulchenko
f55609b997 Move Mac/GTK3 check to avoid warning on unused variable. 2019-10-12 10:27:54 -07:00
Paul Cornett
127ec4dd7f Build fixes for various wxUSE_* macros ==0 2019-10-12 09:22:02 -07:00
Paul Cornett
0cced058d8 Fix linking when wxUSE_VALIDATORS==0
The changes from 25e9be6873 don't work, at least with GCC 9, as the compiler
seems to be removing the definition of the wxDefaultValidator variable.
2019-10-12 09:18:19 -07:00
Vadim Zeitlin
18c9d7375b Remove useless calls to ShowCellEditControl() from wxGrid tests
This function simply does nothing if the current cells is not always
being edited, so it's completely unnecessary to call it.
2019-10-12 17:36:38 +02:00
Vadim Zeitlin
0656823e2a Document that wxGrid::ShowCellEditControl() does not start editing
This was sufficiently misleading that event our own wxGrid unit tests
used this function in an attempt to start editing a grid cell -- even
though it actually doesn't do it at all.

Unfortunately documenting the surprising semantics of this functions
looks like the best thing we can do because it appears to have always
behaved like this and changing it now to actually show the cell editor
control, i.e. starting to edit the cell, is almost certain to break some
existing code.
2019-10-12 17:34:35 +02:00
Vadim Zeitlin
6530886d31 Call XFlush() after simulating key press in wxGTK
This makes simulating keys much more reliable, previously they were just
completely lost (i.e. never resulted in key-press-event signal being
generated by GTK) sometimes.
2019-10-12 17:27:05 +02:00
Vadim Zeitlin
6d6f7cc1ec Allow running all wxGrid tests using wxUIActionSimulator in wxGTK
These tests are still disabled by default during run-time, but at least
allow explicitly enabling them (by setting WX_UI_TESTS=1) even when
using wxGTK where they're known to fail.
2019-10-12 16:09:59 +02:00
Vadim Zeitlin
5e3ba81bbf Revert accidentally committed wxGrid changes
These changes were included in 18e05aeeee
accidentally, revert them for now (they will be recommitted later with a
proper commit message).

See https://github.com/wxWidgets/wxWidgets/pull/1601
2019-10-12 16:08:24 +02:00
Paul Kulchenko
dbc659f5b2 Disabled scaling for wxAui*TabArt on Mac/GTK3. 2019-10-11 22:32:49 -07:00
Paul Kulchenko
27dcd02dcf Updated bitmap scaling in wxAui{Generic,Simple}TabArt for better results. 2019-10-11 15:02:24 -07:00
Paul Kulchenko
ab439fcdee Updated to fix formatting style for multi-line if. 2019-10-11 15:01:21 -07:00
Maarten Bent
591136c7bc Improve button heights at high DPI on wxMSW
Don't use FromDIP together with ConvertDialogToPixels, because the font height
is already adjusted to the DPI.
Also limit the button height at higher DPI. Because the height determined by
ConvertDialogToPixels is higher than standard buttons use on Windows.

Closes #18528
2019-10-11 22:30:34 +02:00
Vadim Zeitlin
9e2ff111a4 Restore, but deprecate, default ctor of wxTimerEvent
Apparently some existing code still used it, even though it only created
an object that could never be used for anything, so undo its removal in
bd09b4132d and deprecate it instead.

Unfortunately, this also requires changing wxTimerEvent::m_timer type
back to pointer, even though it should be a reference.
2019-10-11 19:22:55 +02:00
Artur Wieczorek
92cab3d20a Use proper macros to translate logical to device y-coordinates
Fortunately these macros do nothing but invalid names here could be misleading.
2019-10-11 19:02:15 +02:00
Vadim Zeitlin
a668db8b64 Do nothing in wxListCtrl::SetDoubleBuffered() in wxMSW
Setting WS_EX_COMPOSITED, as the base class version does, just results
in visual artefacts and is useless, as we turn on LVS_EX_DOUBLEBUFFER
already, if it's supported, anyhow.

So don't break the display if people call SetDoubleBuffered() in the
mistaken belief that it does something useful in this case.
2019-10-11 15:34:49 +02:00
Olly Betts
18e05aeeee Remove no-op uses of wxNO_FULL_REPAINT_ON_RESIZE
This behaviour has been the default and this constant 0 since
e441e1f4e8 which was over 16 years ago.

Closes https://github.com/wxWidgets/wxWidgets/pull/1601
2019-10-11 14:12:43 +02:00
Paul Kulchenko
fc75497794 Update wxAuiGenericTabArt and wxAuiSimpleTabArt to properly handle scaled content. 2019-10-10 20:16:53 -07:00
Artur Wieczorek
bf4640f1d8 Fix drawing cross hair on wxDC
There is no need to draw cross hair lines within the entire viewport because only the part inside the current clipping region will be actually drawn. This way we can also avoid working with huge numeric values of coordinates (VIEWPORT_EXTENT = 2^27-1) which apparently are not handled properly by LineTo() API.

Closes #18526.
2019-10-10 20:34:17 +02:00