Commit Graph

2212 Commits

Author SHA1 Message Date
Maarten Bent
b245e4a571 Use dynamic widths in ellipsization tests so they will work for any font size 2019-08-14 21:02:33 +02:00
Vadim Zeitlin
5a394deba4 Merge branch 'accel_keys' of https://github.com/imciner2/wxWidgets
Fixes for accelerator handling in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/1463
2019-08-09 23:54:37 +02:00
Ian McInerney
ff1eb1afcc Fix comments from review 2019-08-05 20:51:46 +02:00
Ian McInerney
585302a69b Convert new menu unit test to C++98 style 2019-08-05 09:14:03 +02:00
Ian McInerney
942fd47ae8 Minor formatting fix 2019-08-05 01:18:50 +02:00
Ian McInerney
ef59628376 Fix CI errors in the unit tests 2019-08-05 01:16:16 +02:00
Ian McInerney
1eea919f13 Mark more keys as being invalid for GTK accelerator keys 2019-08-04 21:46:27 +02:00
Ian McInerney
f3edad2761 Remove invalid GTK accelerator keys 2019-08-04 21:17:10 +02:00
Ian McInerney
2cb96c16ff Add unit test for menu accelerator assignment 2019-08-04 18:41:06 +02:00
Ian McInerney
bdc301946f Upgrade accelerator entry unit tests
* Convert to the Catch framework
* Add a test for proper display name parsing
2019-08-04 18:24:16 +02:00
Maarten Bent
054cb35b39 Workaround for a crash with gcc 9.1 from MSYS2 MinGW 32bit 2019-08-03 21:08:10 +02:00
Lauri Nurmi
4739b9dedd Add C++20-style starts_with()/ends_with() functions to wxString
C++20 introduces these two functions, along with some overloads, to
std::string. Add similar functions to wxString, which simply call the
already existing StartsWith() and EndsWith().

Closes https://github.com/wxWidgets/wxWidgets/pull/1452
2019-07-31 00:52:29 +02:00
Vadim Zeitlin
bcf604b5cb Disable wxTE_PROCESS_ENTER unit tests under wxGTK
wxUIActionSimulator doesn't work reliably there and doesn't work at all
when using Xvfb.
2019-07-26 19:29:00 +02:00
Vadim Zeitlin
fb2c17c193 Merge remote-tracking branch 'sunset/process-enter'
Fix wxTE_PROCESS_ENTER logic for wxMSW and wxGTK too.

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

Closes #18273.
2019-07-26 18:02:08 +02:00
Vadim Zeitlin
9d92ba185c Fix truncating CJK mnemonics in control labels
13068d3603 introduced code for stripping
CJK mnemonics (i.e. trailing " (&X)") from the menu items, but due to
the use of wxStripMenuCodes() in wxControl::GetLabelText(), it also
applied to the control labels, resulting in wrongly measuring their size
(because the text used for measurement didn't include the "(&X)" part)
and truncating them in display.

Fix this by adding an explicit wxStrip_CJKMnemonics and using it only in
the code dealing with the menu item labels. This requires more changes
than just modifying GetLabelText() to use some wxStrip_NoCJKMnemonics
flag, but is more compatible as it's not impossible that some existing
code using wxStripMenuCodes() could be broken by this change too, while
now the existing behaviour is preserved.

Also improve wxStrip_XXX documentation.

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

See #16736.

Closes #18452.
2019-07-26 17:59:47 +02:00
Vadim Zeitlin
5bd9c5b65b Test wxTextCtrl::HitTest() with negative coordinates under wxGTK
In wxGTK using negative coordinates with HitTest() happens to work and
it's useful to test that it does, as this test will run when the control
is scrolled even under Travis CI, unlike the test with positive
coordinates which doesn't work under Xvfb there and was disabled in the
previous commit.

Also document that passing negative coordinates to this function only
works in wxGTK.
2019-07-19 01:44:29 +02:00
Vadim Zeitlin
cfb12091ca Skip wxTextCtrl::HitTest() unit test failing under Xvfb
For some reason, wxTextCtrl scrolls much too far when running under
Xvfb, so the test assumption that it still has some visible characters
after calling SetInsertionPointEnd() fails and must be disabled in this
environment.
2019-07-19 01:41:13 +02:00
Vadim Zeitlin
ef0f4243fb Tweak wxHtmlPrintout::Pagination unit test to pass under Travis
For some reason, the height of a text line is 15px there and not 18px as
locally, so 400px high image still fit on the second page in the last
test. Make it higher to ensure that it doesn't.
2019-07-19 01:40:44 +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
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
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
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
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
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
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
13aa2a6721 Add unit tests for checking wxTE_PROCESS_ENTER handling
Verify that pressing Enter in a dialog activates its default button when
a text-like (i.e. wxTextCtrl or wxComboBox) has focus either if it
doesn't have wxTE_PROCESS_ENTER style or if it does, but its handler
skips the event, but not if the style is used and the event is handled.
2019-07-14 16:55:44 +02:00
Vadim Zeitlin
cf16c29e39 Remove CppUnit boilerplate from wxEvent::Clone() test case
Just remove the unnecessary macros and test case class.

No real changes.
2019-07-14 14:12:25 +02:00
Vadim Zeitlin
bd09b4132d Remove wxTimerEvent default constructor
This ctor just created unusable wxTimerEvent objects (all of the methods
specific to this class would just crash if called on them) and doesn't
seem to be useful at all.

It was added in e47859daeb apparently only
in order to allow using wxIMPLEMENT_DYNAMIC_CLASS() instead of the
previously used wxIMPLEMENT_ABSTRACT_CLASS() for wxTimerEvent, but there
doesn't seem to be any reason to prefer macro over another, and there
are good reasons to not allow creating objects in an invalid state.

The only place where we relied on having default ctor for this event was
in wxEvent::Clone() unit test, so update it to handle wxTimerEvent
specially now that this ctor doesn't exist any longer.
2019-07-14 14:10:55 +02:00
Vadim Zeitlin
4a6f16cf15 Merge branch 'statictext-setlabel'
wxControl label-related fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1364
2019-07-08 10:09:49 +02:00
Vadim Zeitlin
44634cbf90 Merge branch 'qt_tree_control' of https://github.com/GeoTeric/wxWidgets into qt-fixes
See https://github.com/wxWidgets/wxWidgets/pull/1225
2019-06-29 20:49:25 +02:00
Vadim Zeitlin
30726437c0 Fix the result width check in the ellipsization unit test
When processing mnemonics, the resulting string should still contain
them and they need to be stripped before measuring its width, but the
code didn't do it.

This didn't prevent the tests from passing, but only due to another bug
in ellipsization code itself, which lost the mnemonics completely. As
this bug is about to be fixed, the test needs to take mnemonics into
account properly now.
2019-06-20 01:46:28 +02:00
Vadim Zeitlin
a6b8774636 Run label unit tests for ellipsized wxStaticText too
Check that the public methods still behave as expected even if the
displayed value is different because it is ellipsized.
2019-06-20 01:45:26 +02:00
Vadim Zeitlin
672847772d Fix an off-by-1 bug in wxControl::FindAccelIndex() after "&&"
This resulted in wrong letter being underlined in wxGenericStaticText
when the mnemonic occurred after "&&" (i.e. an actual ampersand) in the
label.

Add unit test which passes now, but would fail before on the last check.
2019-06-19 19:40:05 +02:00
Vadim Zeitlin
a93b1416a7 Add unit tests for wxControl::SetLabelMarkup() too
Check that "&" is interpreted correctly.
2019-06-19 19:18:48 +02:00
Vadim Zeitlin
21babfa2d0 Test a couple more cases in wxControl label unit test
Check that double ampersand also works correctly.
2019-06-19 19:13:00 +02:00
Vadim Zeitlin
0d35c3f36a Put all wxControl label unit tests inside a loop
There doesn't seem to be any reason to write some of them out
explicitly.

No real changes.
2019-06-19 19:08:38 +02:00
Vadim Zeitlin
5e98099699 Add unit test for wxGenericStaticText label
Run the same tests for it as for the native wxStaticText too.
2019-06-19 18:55:52 +02:00
Vadim Zeitlin
d22321b14f Rewrite wxControl label unit test without CppUnit macros
Also remove the macros used in the test to perform the same tests for
wxStaticText and wxCheckBox and use a helper function instead, making
the code more clear and extensible.

No real changes.
2019-06-19 18:51:40 +02:00
Vadim Zeitlin
04689e9727 Merge branch 'utf8-text-stream'
Really fix reading from UTF-8 text streams.

Closes #14720.

See https://github.com/wxWidgets/wxWidgets/pull/1304
2019-05-10 01:35:55 +02:00
Vadim Zeitlin
9484d453a9 Merge branch 'fswatcher-test-modernize'
Modernize and clean up wxFileSystemWatcher unit test.

See https://github.com/wxWidgets/wxWidgets/pull/1307
2019-04-26 23:35:23 +02:00
Vadim Zeitlin
0b9041dd29 Remove macOS workaround unnecessary any longer
The workaround introduced by f0e098fa06
doesn't seem to be needed any more, the test passes just fine without
it, so remove it.

See #16969.
2019-04-26 13:36:00 +02:00
Vadim Zeitlin
1b7b79e1c2 Remove wxLog::AddTraceMask() call
This shouldn't be done unconditionally, trace mask can always be enabled
using WXTRACE environment variable from outside the test.

Also remove a useless tracing message.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
77645a1aad Replace legacy CppUnit macros with CATCH ones
No real changes.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
ba8a594bb3 Remove unnecessary wxLogDebug() from the test cases
Tests can be traced using CATCH command line options already, so these
log statements were useless.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
12e2f9c0cc Get rid of CppUnit::TestCase subclass
Use a test fixture instead.

This gets rid of some boilerplate and allows to avoid repeating
preprocessor checks.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
91b3bfedf8 Fix using std::reverse() with wxString iterators in a proper way
The solution with specializing std::iter_swap() for wxString::iterator
was not conforming as the iterator was still not swappable, as it is
required to be.

Fix this by providing std::swap() overload for wxString::iterator, which
is correct and even simpler.

This allows std::reverse(s.begin(), s.end()) work with clang too and
incidentally avoids warnings about the code relying on non-conforming
extensions with MSVS 2017 which were due to the fact that iter_swap()
workaround wasn't enabled for it, while the new swap() overload is.
2019-04-26 03:20:38 +02:00
Vadim Zeitlin
9adcae898f Make wxFileSystemWatcherEvent handler non-virtual and private
There is no reason for it to be neither virtual nor public.
2019-04-26 02:52:57 +02:00
Vadim Zeitlin
194fa8b4ca Remove unneeded KeepWaiting() and AfterWait() functions
These functions were never used anywhere and their meaning was not
clear, so just drop them.

Also remove the now unused "tested" member and "WAIT_DURATION" constant.
2019-04-26 02:52:57 +02:00
Vadim Zeitlin
4783262238 Simplify the code by using CallAfter()
Use CallAfter() to perform idle-time initialization, this is shorter and
simpler than dealing with the idle events explicitly.

Unfortunately the remaining use of idle events can't be avoided, explain
the reasons for this in a comment.
2019-04-26 02:51:47 +02:00
Vadim Zeitlin
9c956ea962 Remove strange counter-based idle handling code
Just bind the idle events we want to execute dynamically instead.

This is already more clear and robust than the old version, but will be
simplified event further in the next commit.
2019-04-26 02:35:14 +02:00
Vadim Zeitlin
db0d288f60 Use Bind() instead of Connect()
Just another modernization, no real changes.
2019-04-25 02:49:23 +02:00
Vadim Zeitlin
cfb194e55f Use wxVector<> instead of macro-based wxArray
Also remove the never used m_lastEvent member variable.

No real changes.
2019-04-25 02:50:08 +02:00
Vadim Zeitlin
cd8bbcb8df Remove unused variable
FileSystemWatcherTestCase::m_loop was never used, so just remove it.
2019-04-25 02:50:03 +02:00
Vadim Zeitlin
a83ffbe320 Reduce use of raw pointers
Use objects instead of pointers whenever possible and wxScopedPtr
instead of raw pointers when we really need to allocate objects on the
heap.
2019-04-25 02:49:54 +02:00
Vadim Zeitlin
789ba56c77 Rename class used as the test skeleton
Use a better name than the absolutely meaningless EventHandler.

Also add a brief comment describing this class.

No real changes.
2019-04-25 02:49:24 +02:00
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Vadim Zeitlin
7d3687f515 Restore wxConvAuto in wxTextInputStream used by wxExecute()
This reverts commit a05ae051d8 and allows
to correctly decode UTF-8 output of child processes again.

Also add a (disabled by default) test allowing to verify that this does
work now.

Closes #14720, #18382.
2019-04-21 20:10:30 +02:00
Vadim Zeitlin
d662a2223e Add wxColour::GetLuminance()
This method can be used to return the perceived brightness of the
colour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1300
2019-04-21 02:09:42 +02:00
Vadim Zeitlin
b6477e0b9c Merge branch 'stcpopup'
Many usability and appearance improvements for autocompletion popups and
call tips in wxSTC.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-04-21 02:03:32 +02:00
Vadim Zeitlin
999d78a3bc Allow using alignment with wxEXPAND and wxSHAPED in wxBoxSizer
Don't assert in wxBoxSizer when both alignment flags and wxEXPAND are
used together if wxSHAPED is also used, as such flag combinations may
make sense and so shouldn't be forbidden.

Add a unit test checking that this is allowed.
2019-03-23 17:18:48 +01:00
Vadim Zeitlin
20db193332 Replace CPPUNIT_ASSERT_EQUAL() with CHECK() in wxBoxSizer test
No real changes, just get rid of the last traces of CppUnit in this
test.
2019-03-23 17:13:06 +01:00
Vadim Zeitlin
8fdb5a7982 Rewrite wxBoxSizer unit test without CppUnit::TestCase
No real changes, just get rid of the old CppUnit-compatible machinery in
this unit test.
2019-03-23 17:10:26 +01:00
Vadim Zeitlin
8042648c73 Don't move wxTextCtrl insertion point if it doesn't really change
Resetting the insertion point position to 0 after calling
wxTextCtrl::SetValue() or ChangeValue() which didn't really change the
control contents was unexpected, as such calls are supposed to be
"optimized away", and this was indeed the case under wxMSW and wxOSX,
but not in wxGTK.

So change wxGTK to follow the other ports, add a unit test checking for
this behaviour and officially document it.

As a side effect, this ensures that the numeric validator classes don't
reset the insertion point position to 0 on every focus loss under wxGTK,
as happened before.
2019-03-21 02:44:45 +01:00
New Pagodi
5f39bb4157 Update other test build files by hand for the new STC test 2019-03-20 17:07:56 -05:00
New Pagodi
a4b688cb45 Regenerate the test make files to include the new STC test 2019-03-20 17:07:47 -05:00
New Pagodi
7b0c7495e3 Add gui test for STC popup items
With wxSTC, popup autocompletion lists and call tips need to be able to
show their information and respond to mouse clicks, but should never
take focus from their parent STC. This test verifies that these popups
function in this manner.
2019-03-20 17:07:39 -05:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

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

Closes #18341.
2019-03-18 18:29:19 +01:00
Vadim Zeitlin
3e0238e089 Merge branch 'wrapsizer' of https://github.com/thesiv/wxWidgets
Fix wxWrapSizer min size calculation in the secondary direction and
improve its unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/1258
2019-03-18 18:22:07 +01:00
Ilya Sinitsyn
d5a6a5a627 Add unit test for wxWrapSizer::CalcMinFromMinor
Add a unit test for a special case of a wrap sizer min size caclulation.
Test wxWrapSizer::CalcMinFromMinor function for this case, when a wrap
sizer used inside a sizer with the same alignment.
2019-03-15 04:16:41 +07:00
Ilya Sinitsyn
e2a9fb1fba Use CATCH in WrapSizer unit tests
Use CATCH instead of CppUnit for unit tests of wxWrapSizer.
2019-03-15 04:14:22 +07:00
Vadim Zeitlin
5a78b82673 Add support for passing nullptr to wx pseudo-vararg functions
Allow passing literal nullptr as an argument corresponding to "%p" in
the format string.

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

Closes #18355.
2019-03-09 01:14:31 +01:00
Ryan Norton
b7f3a2b30f Make parsing wxURI paths more conforming to RFC 3986
Don't recognize the "path" following the port number without a slash as
a path, this is invalid according to the RFC.

Also require two leading slashes for URIs without the authority part.
2019-02-23 14:36:36 +01:00
Vadim Zeitlin
466a2d000f Use CHECK() in wxURI unit test case
This allows the subsequent tests to still run even if one of the tests
fails, which is more useful in this test than CPPUNIT_ASSERT_EQUAL(),
which maps to REQUIRE() and so stops the test execution as soon as any
check fails, because the tests are independent.
2019-02-23 14:11:58 +01:00
Graham Dawes
5d2663432e Delete child items in wxTreeCtrl::Delete under wxQT 2019-02-11 08:14:25 +00:00
Graham Dawes
c87e959a4a Add test for wxTreeCtrl::GetItemCount() 2019-02-05 19:49:36 +00:00
Vadim Zeitlin
ddc550105e Merge branch 'qt-radio-groups'
Fix radio button grouping in Qt.

See https://github.com/wxWidgets/wxWidgets/pull/1212
2019-02-05 03:03:10 +01:00
Vadim Zeitlin
9886c25645 Ensure that test notebook is destroyed after the end of its test
Don't let wxNotebook created in the recently added test for the events
generated when adding pages to it continue to live after the test end as
this breaks the subsequent tests using wxUIActionSimulator (but only
when using MinGW, for some reason).
2019-02-02 17:40:33 +01:00
Vadim Zeitlin
0a7b5a9879 Ensure that test windows are destroyed in TLW unit test
Don't leave the maximized frame created in the test case for getting
events from it lying around needlessly.
2019-02-02 17:31:05 +01:00
Vadim Zeitlin
2a907769fb Suppress all -Wmissing-field-initializers in the test suite
There were many dozens of such warnings given for the various arrays
used in the tests and it just doesn't seem feasible nor desirable to fix
them all, so just suppress the warnings for all these arrays to get rid
of them with recent (7+?) versions of gcc.
2019-02-02 17:25:37 +01:00
Vadim Zeitlin
a913393147 Test that controls between radio buttons don't break grouping
Add a test checking that even not directly consecutive radio buttons are
still treated as being part of the same radio group.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
d403c9ecce Slightly simplify radio buttons creation in the unit test
No real changes, just add a temporary variable for the parent and use
more useful (and shorter) labels for the buttons.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
c5f9bed8ff Merge branch 'tlw-activate-event'
Extend activation event unit tests and enable them for wxGTK where they
seem to pass too now.

See https://github.com/wxWidgets/wxWidgets/pull/1194
2019-01-30 17:40:03 +01:00
Vadim Zeitlin
4d16029f8b Merge branch 'notebook-add-page-events'
Harmonize events sent by wxNotebook::AddPage(): they are now sent only
when adding any page except the first one if it is selected in all
ports.

See https://github.com/wxWidgets/wxWidgets/pull/1192
2019-01-30 17:38:51 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Vadim Zeitlin
f9323e4b87 Enable tests for wxTopLevelWindow::IsActive() for wxGTK too
After the addition of EventCounter::WaitEvent() call in the previous
commit these checks pass as well (with another WaitEvent() added to wait
for deactivation event as well).
2019-01-29 00:16:52 +01:00
Vadim Zeitlin
e599e26395 Test that showing a TLW generates wxActivateEvent
Wait until wxEVT_ACTIVATE arrives and check that it does.
2019-01-29 00:16:50 +01:00
Vadim Zeitlin
c22e81c7a1 Extend unit test for events generated by wxNotebook::AddPage()
In addition to checking that adding the first page doesn't generate any
events, check that adding another page later does generate them.
2019-01-28 19:01:17 +01:00
Vadim Zeitlin
6fdcfd8199 Add unit test for no events when adding first wxNotebook page
Adding the first page shouldn't generate any events even if the
selection does change (from -1 to 0) internally.
2019-01-28 18:21:32 +01:00
Vadim Zeitlin
5811d541da Refactor code waiting for events in the test suite
We already had WX_ASSERT_EVENT_OCCURS_IN macro and a recent commit also
added code doing almost the same thing manually in wxTopLevelWindow unit
test, which was one version too many.

Replace both of them with the new EventCounter::WaitEvent().

No real changes, this is just a refactoring.
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
f4ea128007 Include wx/stopwatch.h explicitly from wxTextCtrl unit test
Don't rely on it being implicitly included from another header when we
use wxStopWatch in this file (with wxGTK only).
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
7c831d25ee Group headers together in wxTextCtrl unit test
No real changes.
2019-01-24 22:52:46 +01:00
Richard Smith
537b2c3bb0 Reinstate wxTextCtrl unit test previously disabled for wxQt
This test was fixed by earlier changes to wxQt font styles and passes
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1169
2019-01-23 16:48:26 +01:00
Vadim Zeitlin
8703f0c437 Merge branch 'qt-dropdown'
Make wxQt wxComboBox behave more consistently with the other ports. Also
includes related fixes to wxChoice and wxTextEntry.

See https://github.com/wxWidgets/wxWidgets/pull/1161
2019-01-22 15:45:03 +01:00
Richard Smith
4c05b3650a Add a test for WriteText and fix implementation in wxQt 2019-01-21 23:09:17 +01:00
Vojtech Kral
63432e5ef5 Fix wxShowEvent not being received for maximized frames on MSW
Send wxEVT_SHOW explicitly when showing a maximized TLW under MSW as the
system doesn't send WM_SHOW in this case (as documented in the MSDN and
also confirmed by testing).

Closes https://github.com/wxWidgets/wxWidgets/pull/1153
2019-01-21 18:38:46 +01:00
Vadim Zeitlin
288d26598c Merge branch 'dvc-var-height'
Optimize generic wxDataViewCtrl performance with variable line heights.

Closes https://github.com/wxWidgets/wxWidgets/pull/1053
2019-01-16 01:25:06 +01:00
Vadim Zeitlin
9a27ea5a2d Merge branch 'ci-url-test'
Try to work around the errors in URL test under AppVeyor.

See https://github.com/wxWidgets/wxWidgets/pull/1138
2019-01-14 23:41:31 +01:00
chris2oph
dd306cac77 Various wxFont fixes in wxQt
Implement point/pixel size accessors correctly.

Implement support for strike-through fonts.

Also implement DoSetNativeFontInfo() for wxQt.

Make wxFont unit test pass by accounting for Qt-specific aspects.

Closes https://github.com/wxWidgets/wxWidgets/pull/1113
2019-01-14 23:39:02 +01:00
Vadim Zeitlin
3c468260ff Retry in URL test when running in a CI environment
There are episodic failures in this test when running under AppVeyor,
check if retrying to connect can work around them.
2019-01-12 15:39:09 +01:00
Vadim Zeitlin
50c90f9174 Use wxScopedPtr<> in URL unit test
Don't leak the stream if an error happens in the rest of the test.
2019-01-12 15:35:44 +01:00
ali kettab
36f6f8ad49 wxTextValidator improvements
Improve char inclusion/exclusion support; update the sample to show more
features of this class and add a unit test for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1093
2019-01-05 23:33:35 +01:00
Vadim Zeitlin
dcee3ce899 Suppress some harmless clang warnings in the test suite
Use wxCLANG_WARNING_SUPPRESS() to avoid multiple warnings in CATCH
headers as well as in some of our own tests.
2019-01-04 23:51:31 +01:00
Vadim Zeitlin
7f63adde95 Merge branch 'select-after-delete'
Harmonize behaviour of wxItemContainer::Delete() for all controls and
ports when using single selection.

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

Closes #18267.
2019-01-04 14:01:02 +01:00
Cătălin Răceanu
5885b2f142 Test that selecting 'single' radio button does not reset others
Add a unit test for the expected behaviour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1102
2019-01-04 13:59:06 +01:00
chris2oph
155a19a1a2 Improve checks for dates range in wxQt wxCalendarCtrl
Account for the minimum and maximum dates supported by QDatePicker, both
in the code and in the test suite, which shouldn't rely on not having
any range restrictions in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1088
2019-01-03 00:18:37 +01:00
Vadim Zeitlin
6f0c5f65b6 Add "aui" project to MSVS 2017 unit tests solution file too
This should have been done in e9cbbede00
which updated the solution files for all the other MSVS versions, but
somehow forgot this one.

See https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-30 16:02:09 +01:00
Richard Smith
0fbf87d11b Split single/multi line behaviour in Qt wxTextCtrl
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
2018-12-24 01:52:07 +01:00
Sebastian Walderich
e9cbbede00 Implement wxAuiNotebook::GetBestSize()
Compute the best size of the notebook, taking into account all the
different layout possibilities, and add a test checking that this works
as expected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Vadim Zeitlin
b2cdd287bb Resolve change log conflict with master
Reapply the change log change manually to master version of the file to
let the CI builds merge this branch automatically.
2018-12-20 02:24:49 +01:00
Vadim Zeitlin
b825c49c2e Document and test wxItemContainer::Delete() selection handling
Add test checking that selection is reset when deleting the selected
item or any item before, but not after, it.

Also explicitly document this behaviour.
2018-12-15 23:47:26 +01:00
Vadim Zeitlin
e0e4f16282 Fix a typo in ItemContainerTestCase comment
No real changes, just fix a copy-and-pasto.
2018-12-15 23:04:30 +01:00
Vadim Zeitlin
4ed28f681f Add a common tag for wxItemContainer-derived classes tests
This makes it possible to run the tests for all controls implementing
wxItemContainer interface by just passing "[item-container]" on the test
command line.
2018-12-15 23:04:30 +01:00
Graham Dawes
db15e99884 Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer,
which resulted in a crash when using it, e.g. in the unit test.

Fix this by keeping a QImage as a member in wxBitmapRefData, so that the
pointer to its data remain valid until UngetRawData() is called.

Also check that GetRawData() returns a non-null pointer in the test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1067
2018-12-13 15:24:54 +01:00
Vadim Zeitlin
c95f668b21 Fix use of dangling pointer in ButtonTestCase::Disabled()
Fix the test added in dfec7aa0c0 which
deleted the button pointer used by EventCounter by simply moving
EventCounter initialization after the button re-creation.

See #16385.
2018-12-13 00:39:25 +01:00
Vadim Zeitlin
141f0cb0e4 Suppress harmless gcc missing initializers warnings in a test
Suppressing the warnings is ugly but less ugly than explicitly
specifying all the omitted elements in the array.
2018-12-12 23:45:09 +01:00
Vadim Zeitlin
cf25bbbf9a Merge branch 'window-create-disabled'
Make calling wxWindow::Disable() before wxWindow::Create() work.

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

Closes #16385.
2018-12-12 18:24:10 +01:00
Vadim Zeitlin
e1185d8bf0 Increment version number to 3.1.3
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.
2018-12-10 19:06:18 +01:00
Vadim Zeitlin
dfec7aa0c0 Make disabling the window before creating it actually work
Disabling a window before actually creating it ought to work, similarly
to hiding a window before creating it which can be used to avoid showing
the window on screen at all, even briefly. However it didn't under MSW
where the window was disabled from wxWidgets point of view, but not at
the MSW level.

Fix this by accounting for the enabled state in MSWGetStyle().

Closes #16385.
2018-12-09 19:20:50 +01:00
oleksii.vorobiov
fd5c62bc41 Make updating the value in wxEVT_SPINCTRL work in wxMSW
In wxMSW, the value of the control was modified after executing the
user-defined wxEVT_SPINCTRL handler which meant that any calls to
SetValue() there were effectively ignored.

Fix this and add a unit test checking for the described scenario.

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

Closes #18187.
2018-12-08 19:51:56 +01:00
Vadim Zeitlin
aee926f2d5 Make wxVector::reverse_iterator satisfy RandomAccessIterator
RandomAccessIterator requirements include LessThanComparable, so
implement the missing comparison operators for this class, as well as
for const_reverse_iterator.

This also fixes compilation problems with MSVS 2013 in debug mode, where
the CRT uses these operators to check the iterators correctness.

See https://github.com/wxWidgets/wxWidgets/pull/1048
2018-12-07 14:52:51 +01:00
Vadim Zeitlin
d1b02b8dd6 Fix memory leaks in newly added unit test
There is no need to allocate neither RowRanges nor HeightCache on the
heap, just create them on the stack -- if nothing else, this ensures we
don't leak memory, unlike before.
2018-12-07 04:17:16 +01:00
Vadim Zeitlin
090491cdbc Minor style and formatting clean up of the new code
Fix typos in comments and indent them.

Wrap over-long lines.

Remove useless top-level const.
2018-12-07 04:17:16 +01:00
jensgoe
d6a137b730 Improve wxDataViewCtrl performance with wxDV_VARIABLE_LINE_HEIGHT
Store the line heights in a cache to make the (generic) wxDataViewCtrl
usable with this style.
2018-12-07 04:05:16 +01:00
Vadim Zeitlin
7e22ddd27c Merge branch 'qt_menubar' of https://github.com/GeoTeric/wxWidgets
Improve radio menu items support in wxQt and make the menu unit tests
pass for it, although some of them had to be disabled.

See https://github.com/wxWidgets/wxWidgets/pull/1030
2018-12-05 02:53:37 +01:00
Maarten Bent
2f78849d24 Fix build without precompiled headers 2018-11-26 23:51:40 +01:00
Maarten Bent
3bab07edcf Fix some build warnings
private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
2018-11-25 21:29:38 +01:00
Maarten Bent
eb23d4735c Fix unannotated fall-through warnings 2018-11-25 21:29:37 +01:00
Richard Smith
69c19f29ca Restore menu tests, excluding QT where appropriate. 2018-11-22 22:32:08 +00:00
Richard Smith
82f8fad240 Split out test which will not work on QT, and fix insertion behaviour of radio menu items. 2018-11-22 10:22:39 +00:00
Vadim Zeitlin
5b891e9ffc Merge branch 'dvc-getitemrect'
Make wxDataViewCtrl::GetIremRect() work under all platforms and improve
tests, documentation and fix a couple of other problems in the same code
area.

See https://github.com/wxWidgets/wxWidgets/pull/1015
2018-11-10 22:38:05 +01:00
Vadim Zeitlin
767639276f Disable failing wxDataViewCtrl::IsExpanded() test under Mac
For some unfathomable reason IsExpanded() returns wrong value for one of
the items. This should be fixed, but for now just leave a warning in the
test but don't fail it.

Also document this bug to at least spare people some surprises.
2018-11-06 04:03:34 +01:00
Vadim Zeitlin
ef92b92691 Add unit test for wxCTZ
Check that the new function works reasonably correctly.
2018-11-05 19:27:53 +01:00
Vadim Zeitlin
fad50e74b7 Fix wxDataViewCtrl::GetItemRect() in wxGTK and enable its test
A couple of fixes compared to the previous commit:

- Use the correct gtk_tree_view_get_cell_area() rather than
  gtk_tree_view_get_background_area() which doesn't work correctly
  for the items which are not shown because their parent is collapsed.
- Translate logical coordinates to physical ones using
  gtk_tree_view_convert_bin_window_to_widget_coords().

With these fixes, the unit tests for this function pass and can now be
enabled under wxGTK as well.

See https://github.com/wxWidgets/wxWidgets/pull/990
2018-11-04 18:28:59 +01:00
Vadim Zeitlin
12f8ab20f9 Move operator<<(std::ostream&, wxRect) overload to a header
This will allow reusing it in other tests too.

Also make the output slightly more readable by formatting the rectangle
as "{x,y w*h}" instead of "{x,y,w,h}".

No real changes.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
9d2ee59138 Update comments in tests/asserthelper.h
No real changes, just avoid mentioning CPPUNIT_ASSERT_EQUAL() in the
comments for the operator<<() overloads as it is used with CATCH too.

Also don't duplicate the same comment 4 times unnecessarily.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
9460038b3f Return empty rectangle from GetItemRect() if item is not visible
This was already the case if the item was not visible because its parent
was not expanded, but now make it also true for the items which are not
visible due to the current scrollbar position.

Add unit tests checking for this and also verifying that GetItemRect()
returns the coordinates in the physical window coordinates.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
9b7757c44d Ensure that wxDataViewMainWindow has correct size in the test
Replace a redundant (because the same size was already specified in the
ctor) SetSize() call with a Layout() call which resizes
wxDataViewMainWindow to fit the parent control size when using the
generic implementation.

This is important for any tests dealing with the control geometry, i.e.
calling GetItemRect() or HitTest().
2018-11-04 17:49:12 +01:00
Vadim Zeitlin
ada5de3d0d Fix wxDataViewCtrl::GetItemRect() for collapsed items
Calling GetItemRect() for an item which was not currently visible
because its parent was collapsed resulted in silently returning the
value for a wrong value before the recent fix to GetRowByItem() and in
a crash after it because GetTreeNodeByRow() returned null when passed
invalid row index.

Fix this by explicitly checking whether the item is shown and just
returning an empty rectangle instead.

Also document this behaviour and add a unit test for it.
2018-11-04 17:15:42 +01:00
Vadim Zeitlin
31c49caab5 Add unit test for wxDataViewCtrl::IsExpanded()
Check that it returns correct results, both for the currently visible
and hidden items.
2018-11-04 17:10:23 +01:00
Vadim Zeitlin
fe865a1743 Rewrite wxDataViewCtrl unit test without using CppUnit macros
Use CATCH API directly, this simplifies the code and makes adding new
tests simpler.

No real changes yet.
2018-11-04 14:34:49 +01:00
Vadim Zeitlin
8e817f8a0e Don't send events from wxTextCtrl::ChangeValue("") in wxGTK
ChangeValue() must not send events, but did in wxGTK when changing the
contents of a wxTextCtrl to be empty when it had been non-empty before.

Closes #18264.
2018-11-01 02:04:01 +01:00
Vadim Zeitlin
f3c148cd4a Verify that wxTextCtrl::ChangeValue("") doesn't generate events
Check that changing the value of an already empty control to empty
doesn't result in any events.

See #18264.
2018-10-30 01:35:32 +01:00
Vadim Zeitlin
602b4a6863 Run all wxTextEntry unit tests for wxTextCtrl too
Comment stated that InsertionPoint() didn't pass, but it was actually
already running (and passing) and the only excluded test was the
TextChangeEvents() one which really should pass for multiline controls
as well, so run it too.
2018-10-30 01:34:27 +01:00
Vadim Zeitlin
d6793893c0 Add a simple benchmark of wxDisplaySize() and related functions
This benchmark shows that wxGetDisplaySize() has only minimal overhead
compared to wxDisplaySize(), but wxDisplay().GetGeometry() is almost 3
times slower (under wxGTK).
2018-09-30 00:38:27 +02:00
Vadim Zeitlin
6db5b54fc7 Fix wxHTML benchmarks compilation
wx/crt.h must be included to use wxSscanf().
2018-09-30 00:32:21 +02:00
Vadim Zeitlin
21a5314c52 Another graphics benchmark compilation fix for non-MSW
Use GraphicsRenderer name for the enum in all ports.

See 573cb961cb
2018-09-30 00:31:41 +02:00
Vadim Zeitlin
a8ac1e3240 Graphics benchmark compilation fix under Unix
Only use wxMSW-specific wxBitmap::UseAlpha() when using this port.

See 7ddb522ec2
2018-09-30 00:30:53 +02:00
Maarten Bent
7c1ab06ea5 Add more wxOVERRIDE 2018-09-22 14:44:07 +02:00
Maarten Bent
837b7ca3e1 Fix ambiguous call to wxNotebook::DeletePage 2018-09-19 22:01:18 +02:00
Maarten Bent
7bf952165f Test success in BitmapTestCase::Mask() 2018-09-19 22:01:17 +02:00
Maarten Bent
a914478f60 Add guards around test cases 2018-09-19 22:01:17 +02:00
Vadim Zeitlin
b88d5e08ce Fix adding pages without associated window to wxTreebook
wxTreebook is supposed to allow not specifying any valid window for the
top-level pages, but this didn't work any longer, probably since the
changes of 02a92e23f3 (see #4379), as a
possibly null page was dereferenced without checking, resulting in a
crash.

Fix this by adding a missing check.

Also rename DoGetNonNullPage() to TryGetNonNullPage() to make it more
clear that this function can return null and add a unit test checking
that calling AddPage(NULL) really works (or at least doesn't crash).

See https://github.com/wxWidgets/wxWidgets/pull/921
2018-09-18 00:33:59 +02:00
Vadim Zeitlin
6401c2e956 Merge branch 'font-fixes'
Complete support for fractional point sizes and font weights other than
light/bold.

Also harmonize wxFont API and implementation among all ports (fixing
compilation of those of them that were broken by recent changes).

See https://github.com/wxWidgets/wxWidgets/pull/919
2018-09-17 22:58:56 +02:00
Vadim Zeitlin
f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
Vadim Zeitlin
b1dcdb864c Add simple unit tests for the new wxFont features
Check that calling SetFractionalPointSize() and SetNumericWeight() at
the very least results in the expected return values from
GetFractionalPointSize() and GetNumericWeight().
2018-09-17 15:24:42 +02:00
Artur Wieczorek
75225cc1a6 Remove references to "adv" library from MSVS 201x test projects 2018-09-13 20:56:54 +02:00
Vadim Zeitlin
08e5acedcc Centralize backwards compatibility code in wxFont
Add wxFontBase::AccountForCompatValues() and use it in all ports instead
of redoing the same comparison with wxDEFAULT in all of them.

This is done not so much to avoid the code duplication, which was
minimal anyhow, but to make the code more clear and make it easier to
remove it from all ports at once in the bright (but remote) future when
we don't need these compatibility hacks any more.

Also document that wxDEFAULT and wxNORMAL are only handled specially in
the old-style ctor taking the individual font components and not the new
one using wxFontInfo and extend the unit test to check this.
2018-09-07 03:08:42 +02:00
Vadim Zeitlin
b84db46feb Add unit test for wxFont::GetStyle() and special style values
Similarly to the previous commit, verify that wxNORMAL, wxITALIC and
wxSLANT still work for compatibility (note the latter is synonymous with
wxITALIC under MSW).
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
5bf920775a Add unit test for wxFont::GetWeight() and special weight values
Verify that using wxNORMAL, wxBOLD and wxLIGHT still works, as they must
do for compatibility reasons.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
de3cc614b2 Add unit test for wxFont::GetPointSize() and special sizes
Verify that using wxDEFAULT works to create a font of default size, for
compatibility reasons, and that using -1 works in the same way too.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
7cc016b5fa Remove CppUnit boilerplate from wxFont unit test
No real changes, just remove the test case class which is not at all
necessary in this unit test.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
76aad86cfb Remove unnecessary wxUSE_FONTMAP guard from wxFont unit test
This test doesn't require wxFontMapper.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
3ffa651a34 Move wxAdv library contents into wxCore
This basically removes the "adv" library, even though it's still
preserved for compatibility with user make/project files referring to
it.

It is done because the distinction between "adv" and "core" was never
really clear (e.g. why wxTreeCtrl was in core but wxTreeListCtrl in
adv?) and it prevented some core classes from using adv ones.
2018-08-27 21:13:04 +02:00
Vadim Zeitlin
a59f5932df Add wxHtmlContainerCell::Detach()
This allows manipulating the HTML DOM from the outside, e.g. to detach
a header element in order to be able to repeat it on all pages.
2018-08-25 21:16:55 +02:00
Vadim Zeitlin
869fb4f2bc Remove CppUnit compatibility macros from wxHtmlParser test
There was just a single test there, so remove all CppUnit boilerplate
which accounted for more than 50% of the file before adding more tests.
2018-08-25 21:00:11 +02:00
Vadim Zeitlin
de5ba70203 Fix handling events from their items in submenu itself
This previously worked in wxGTK, but not in wxMSW and even under wxGTK
it could be surprising that the submenu got the event, but its parent
menu did not.

Make things consistent between the platforms and send the event to the
menu directly containing it first, but then also to its parent menu(s).

Document the new behaviour and verify that it works as intended with a
new unit test.

Closes #18202.
2018-08-25 02:36:45 +02:00
Vadim Zeitlin
48da21619e Merge branch 'treectrl-delete-events'
See https://github.com/wxWidgets/wxWidgets/pull/881
2018-08-18 15:07:37 +02:00
Vadim Zeitlin
3c8b9589d8 Test that wxTreeCtrl::DeleteAllItems() does send events
This seems to be the case under all still supported MSW versions, so
remove the note saying that the events might not be sent from the
documentation and add a unit test verifying that they are indeed sent.
2018-08-14 17:50:28 +02:00
Vadim Zeitlin
d9d05bc221 Document that wxTreeCtrl::DeleteChildren() does send events
Contrary to what the documentation stated previously, this function does
generate the wxEVT_TREE_DELETE_ITEM events for all the items being
deleted, in both MSW and generic implementations.

Update the documentation and add a new unit test checking that the
behaviour really conforms to it.
2018-08-14 17:48:46 +02:00
Maarten Bent
bcfc9a8a26 Fix printf tests for recent MinGW versions
The default mantissa length was changed from 3 to 2 in MinGW 5.0.4.
Fix the test for printing pointer addresses in 64bit MinGW.
2018-08-02 21:10:20 +02:00
Maarten Bent
f3ae302b4d Prevent segfault in vararg test with MinGW
The segmentation fault is caused by swscanf with __USE_MINGW_ANSI_STDIO=1.
See https://sourceforge.net/p/mingw-w64/mailman/message/36118530/
2018-08-02 20:50:55 +02:00
Maarten Bent
da9b4bc0a0 Remove unused variable in graphpath test 2018-07-29 16:29:36 +02:00
Maarten Bent
5ea4e639b6 Fix type cast warning in thread test 2018-07-29 16:29:36 +02:00
Maarten Bent
5da4e81e10 Fix type casts and invalid format specifiers in interactive tests 2018-07-29 16:29:35 +02:00
Maarten Bent
a5b1a418bb Use wxPrintf in interactive tests
Remove unneeded calls to c_str() and mb_str().
2018-07-29 16:26:41 +02:00
Maarten Bent
57180d68c8 Add wxOVERRIDE to test files
And cleanup some tailing spaces and tabs.
2018-07-29 12:08:53 +02:00
Artur Wieczorek
e732da462f Add tests for the bounds of wxGraphicsPath
Check if bounding box of wxGraphicsPath is properly determined.
2018-07-28 11:36:44 +02:00
Vadim Zeitlin
1345b38c51 Merge branch 'gtk-datapick-focus'
Fix focus event generation for generic wxDatePickerCtrl and other
wxCompositeWindows.

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

Closes #18120.
2018-07-25 20:15:32 +02:00
Vadim Zeitlin
fb71adab04 Add a unit test for wxDatePickerCtrl focus events
Unfortunately it doesn't work with wxGTK, as usual, due to
wxUIActionSimulator not working correctly there.
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
9e05eb42b5 Fix outdated comment in wxHtmlPrintout unit test
This should have been part of 321854b519
which changed the code, but not the accompanying comment.
2018-07-25 13:52:49 +02:00
Vadim Zeitlin
0338796847 Remove unnecessary headers from wxHtmlPrintout unit test
These headers were added by 905789485a
which was replaced with 321854b519 later
and are not needed any more.
2018-07-25 13:49:00 +02:00
Vadim Zeitlin
6acd663190 Revert "Add even more debug output to the test"
This reverts commit 1ce009e73a as AppVeyor
test failures problem is fixed now.
2018-07-25 13:47:13 +02:00
Vadim Zeitlin
542124aa95 Fix page-break-inside:avoid to work for nested tags too
The initial version was too naïve and didn't work correctly if the <div>
with this style had nested elements.
2018-07-25 02:23:02 +02:00
Vadim Zeitlin
321854b519 Try using fixed font size in pixels in the test 2018-07-22 00:54:05 +02:00
Vadim Zeitlin
1ce009e73a Add even more debug output to the test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
96cca10328 Use fixed font name in the HTML pagination test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
905789485a Fix the just added pagination test for high DPI systems
Adjust the font size used by a DPI-dependent factor to ensure that the
text takes the same amount of pixels independently of DPI.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
566e401a3f Add support for style="page-break-inside:avoid" to wxHTML
Allow using this style to prevent page breaks inside the given <div>.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
02ffdd16f6 Fix using WX_DECLARE_OBJARRAY() with pointer types
While this doesn't make, and never made, any sense (pointers should be
stored in a plain, non-object array), we still should continue to
support it for compatibility.

Fix the problem introduced by 97684a9267
by writing "T const&" instead of "const T&" as the latter didn't have
the same meaning when the macro parameter "T" expanded into "U*" as
"const" applied to "U", making this type incompatible with the actual
one.

Also extend the unit test to check for this.
2018-07-15 14:48:08 +02:00
Artur Wieczorek
fc53007ab4 Add unit test for current point of wxGraphicsPath
Verify that last point is properly positioned after the operations
on wxGraphicsPath.

See #18111.
2018-07-02 20:08:30 +02:00
Vadim Zeitlin
f03d655b1a Enable running TLW activation unit tests in CI environments
Hopefully the previous commit fixed it under AppVeyor.
2018-06-22 02:44:40 +02:00