Commit Graph

68 Commits

Author SHA1 Message Date
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
7af8598903 Yet another wxStopWatch unit test fix for buildbot.
Relax the check in RestartBug() test too, the time can be slightly smaller
than expected (by ~2ms on disc-xp machine).
2015-04-17 01:43:57 +02:00
Vadim Zeitlin
594dc3396a Relax another check in wxStopWatch unit test.
Increase the upper bound even further to avoid spurious failures in the
buildbot builds.
2015-04-13 15:55:33 +02:00
Vadim Zeitlin
ca0c422964 Relax wxStopWatch test to make it less likely to fail on buildbot.
Be prepared for sleeping taking more time than we budget for it on a highly
loaded machine such as a buildbot slave.
2015-04-12 22:47:46 +02:00
Vadim Zeitlin
98c68150ed no changes, add more specific description of these tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:44:45 +00:00
Vadim Zeitlin
42d5c34c64 x11 alrady support GetUnicodeKey() by last commit, remove these check
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:43:41 +00:00
Vadim Zeitlin
adf61108be wxX11 return keycode by GetKeyCode directly, not support GetUnicodeKey yet
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:54 +00:00
Vadim Zeitlin
31f0808ee2 reenable this tests under wxUniv/x11 port. EventPropagationTestCase::MenuEvent cause the problem, not these. MenuEvent will be fixed later
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:29 +00:00
Vadim Zeitlin
4363f9b578 These test will cause test_gui segmentation fault, disable for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:40:15 +00:00
Vadim Zeitlin
5de9b53902 Disable another wxStopWatch test case in the build bot builds.
We can't rely on the program waking up quickly enough when running on the
(loaded) buildbot machines, better to skip this test than to have spurious
failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-22 15:13:16 +00:00
Vadim Zeitlin
f4b80e5337 Remove MSVC6 support.
Don't support this compiler any more, this allows to get rid of tons of
MSVC6-specific workarounds, in particular we can now use Bind() and natural
template functions calls in the library code.

Also remove MSVC6 project and solution files and don't generate them when
bakefile_gen is ran any more (removing the remaining occurrences of msvc6prj
from the bakefiles results in weird bake-time errors, so it's simpler to just
leave them there).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-15 22:32:17 +00:00
Vadim Zeitlin
f641dfd78c Disable wxSleep() test case for buildbot builds.
This test keeps failing just because the buildbot machine are too heavily
loaded. This is not really an error, so just avoid running this test there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-10 16:20:13 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
1ed753dc8d Fix harmless Clang warning about an unused function.
GlobalOnAnotherEvent() is not used in normal testing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-15 01:31:40 +00:00
Vadim Zeitlin
12ab6ad3d2 Test handling of events from the toolbar in an MDI parent frame.
These events must be received by the currently active child.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 22:18:18 +00:00
Vadim Zeitlin
ada25b6e95 Ensure that the MDI child is active in event propagation test.
Call wxMDIChildFrame::Activate() explicitly as the behaviour was different
under MSW (where the activation happened too late for the test) and GTK where
the child did become active because of the hacks in place to ensure it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 22:17:55 +00:00
Vadim Zeitlin
d3ad22bdb3 Add wxEventLoop::ScheduleExit().
This method allows to request exiting from the given event loop even if it's
not the currently active one, unlike Exit() which would assert in this case.
With it, it becomes possible to ask the loop to terminate as soon as possible
even if a nested loop is currently running.

See #10258.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 00:26:13 +00:00
Vadim Zeitlin
dbd5b2ce42 Better fix for duplicate wxContextMenuEvent generation under MSW.
Fix the bug with multiple wxContextMenuEvent being generated for a single
WM_CONTEXTMENU without breaking context menus for wxTextCtrl (and all the
other native controls). Do this by ensuring that WM_CONTEXTMENU is still
passed to DefWindowProc() if we don't process it instead of just being eaten
completely in any case.

Also add a unit test checking for this bug to ensure it stays fixed.

See #13683.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-02 20:24:22 +00:00
Vadim Zeitlin
233666915e Use wxWindow::Refresh() instead of artificial wxPaintEvent in the test.
This fixes memory leaks under wxMSW: as the test code didn't (and couldn't)
call wxPaintDCImpl::EndPaint(), there was a leak for each wxPaintEvent
generated in it since the changes to wxDC caching in r72938.

It's also preferable because it uses public API instead of feeding events to
the window which is not documented to work.

Unfortunately even using Refresh() still doesn't allow the test to work under
wxOSX.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-05 00:00:01 +00:00
Vadim Zeitlin
a7c0de8a98 Fix event handling order in doc/view framework.
Ensure that the events are always (provided there is an open document)
processed in the following order:

1. wxDocument
2. wxView
3. wxDocManager
4. wxDocChildFrame
5. wxDocParentFrame
6. wxApp

Do this by forwarding the events from wxDocParentFrame to wxDocChildFrame
first and forward them from there to wxDocManager which -- and this part
remains unchanged -- in turn forwards them to the active wxView which finally
forwards them to wxDocument. This requires another condition in the event
handling code as we still must forward from wxDocParentFrame to wxDocManager
itself if there are no active children at all, but this is the only way to
have the same event order in all cases, whether the event is originally
received by wxDocChildFrame or wxDocParentFrame.

Document this and add a unit test verifying that things indeed work like this.

See #14314.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-04 23:59:56 +00:00
Vadim Zeitlin
bbde2164ac Factor out functions dealing with menus in the event propagation test.
No real changes, just refactor the code to allow testing for menu events in
other frames too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-04 23:59:48 +00:00
Vadim Zeitlin
9fe942190d Use correct line numbers in assert failures in event propagation test.
Replace the calls to CheckMenuEvent() helper with ASSERT_MENU_EVENT_RESULT()
macro to allow passing the correct line number to cppunit assertion function,
otherwise the line number of CheckMenuEvent() was always used in case of
failure.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-04 23:59:40 +00:00
Vadim Zeitlin
4ed3f4abd8 Pass menu events to the handler in the associated menu bar.
We handled the menu events in the menu itself and the associated window, but
not in the menu bar that the menu belonged to. This was unexpected, so allow
handling the events in the menu bar itself too.

Closes #15095.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-04 23:59:32 +00:00
Vadim Zeitlin
3bad8c3926 Fix menu event handlers calling order.
Pass the menu event to the window associated with the menu first, before
falling back on wxApp.

This required adding yet another flag to keep state in wxEvent but it seems to
be unavoidable as wxMenuBase::SendEvent() calls ProcessEvent() twice and we
must have some way to distinguish the first call from the second one.

Added a test case verifying that the menu events are indeed processed in the
expected order.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-04 23:59:29 +00:00
Vadim Zeitlin
75b2220eba Fix crashes after using "wildcard" wxEvtHandler::Disconnect().
When not specifying the function to disconnect, the associated event sink was
destroyed too early resulting in crashes later. Fix this and add unit tests
verifying that things work as expected and at least don't crash.

Closes #14563.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-10 12:22:32 +00:00
Vadim Zeitlin
073d9e0f26 Don't use Shift-TAB in keyboard test.
This key combination seems to be intercepted by GTK now for keyboard
navigation purposes and we never get key up events for it. Just use a
different key.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 00:25:09 +00:00
Paul Cornett
33a190beb6 fake paint events don't work with wxGTK3 either
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-11 07:32:10 +00:00
Vadim Zeitlin
d130167576 Increase the tolerance in wxStopWatch unit test.
Sleeping can take more time than expected when running on the build slaves,
probably because the machine is heavily loaded. Increase the tolerance to
prevent this from resulting in test failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-26 12:57:49 +00:00
Vadim Zeitlin
17d72a48ff Fix bug with wxStopWatch::Start() not resuming paused stopwatch any more.
Since r69835 the stop watch remained paused even when Start() was called. Do
resume it when restarting it both for backwards compatibility and because it
makes more sense and also document this behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-03 00:34:00 +00:00
Vadim Zeitlin
b0ec002323 Added wxStopWatch::TimeInMicro() for better precision time measurement.
Also simplify/streamline wxStopWatch implementation and replace confusingly
named m_pause with more clear m_elapsedBeforePause.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69835 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-27 19:50:12 +00:00
Vadim Zeitlin
c439998525 Use shorter sleep times in wxStopWatch unit test.
Make wxStopWatchTestCase::Misc() run in 2.5 seconds instead of 7. This not
only makes the test run faster but allows us to test wxMilliSleep() and
precision of wxStopWatch for time periods in fractional seconds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-27 19:50:05 +00:00
Dimitri Schoolwerth
e3778b4d9c No code changes, fixed some typos.
Changed several occurrences of "it's" where "its" is meant, as well as a few other minor typos.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-30 10:57:04 +00:00
Vadim Zeitlin
4a695c4689 Disable keyboard unit test with wxUIActionSimulator under OS X.
The test doesn't work because the test window never get any events. This might
be a bug in the test or in wxUIActionSimulator itself but for now I just have
no idea about how to fix it, so disable the test to let the rest of the test
suite run.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-05 21:37:27 +00:00
Vadim Zeitlin
9a1ff9516c Disable TimerEventTestCase::Multiple() test for ANSI wxGTK build.
This test crashes for unknown reasons on wxGTK ANSI build slave and prevents
the rest of the test suite from running, so disable it for now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-05 13:37:44 +00:00
Vadim Zeitlin
d0fb62a656 Generate the same flags for modifier key events in wxGTK as in wxMSW.
Resolve the discrepancy between modifier flags of the key events corresponding
to the modifier key itself between wxMSW and wxGTK by changing the latter to
follow wxMSW behaviour.

Clearly document the now officially correct behaviour of the modifiers for the
key events corresponding to the modifiers keys themselves in the manual.

This fix also makes it unnecessary to work around this bug in the keyboard
unit test so remove it from there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-11 10:19:14 +00:00
Vadim Zeitlin
7333c0ef82 Generate unshifted Unicode key codes in wxEVT_KEY_XXX events in wxGTK.
wxGTK generated wxEVT_KEY_XXX with key codes corresponding to the unshifted
state of the key (except for the letters) but Unicode key codes corresponding
to the current shift state. This was inconsistent with wxMSW and also with the
idea that key events, unlike char ones, don't depend on the modifiers states.

Change wxGTK to behave as wxMSW and use unshifted values for Unicode key codes
as well.

Remove the now unnecessary workaround for different key event Unicode codes
from test.

Also try to explain the difference between normal and Unicode keys and key and
char events even better and mention that the Unicode key codes for the key
events are also untranslated in the documentation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-11 10:19:07 +00:00
Vadim Zeitlin
042ddf5def Add a simple test for keyboard events generation.
Check that the events generated by wxUIActionSimulator result in the same
wxKeyEvents being generated under all platforms. This is not the same as
checking the event generation for the actual keys pressed by the user as there
are some small differences between the two but better than nothing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-11 10:18:31 +00:00
Vadim Zeitlin
232fdc630c Merge the new GUI tests from SOC2010_GUI_TEST branch.
Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 22:16:05 +00:00
Stefan Csomor
155362949b paint events cannot be constructed outside a native redraw in OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 13:48:17 +00:00
Stefan Csomor
f009da6ed5 paint events cannot be constructed outside a native redraw in OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 12:46:20 +00:00
Vadim Zeitlin
bbdee10d5f Fix recently broken forwarding of events between event handlers.
After the recent changes to the event processing logic, forwarding an event
from one event handler to another one stopped working correctly because the
per-event "process here only" flag prevented it from following the event
handler chain after forwarding. This notably broke keyboard navigation in
wxComboCtrl under MSW in wx itself and probably quite a few of other things in
user code.

Fix this by replacing the boolean flag with a pointer to the handler to which
the processing of this event should be restricted. This allows the full
processing to still take place if an event is forwarded to another handler.
So wxEvent::ShouldProcessHereOnly() is now called ShouldProcessOnlyIn() and
takes a wxEvtHandler parameter.

This made appear a problem in wxScrollHelperEvtHandler code that was hidden by
the bug above: the events were still processed multiple times in it. To fix
this, also add wxEvent::DidntHonourProcessOnlyIn() and take it into account in
the base class code. Did I mention that wxScrollHelperEvtHandler must die?

Add another unit test checking that forwarding works correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:31 +00:00
Vadim Zeitlin
52212bcb4a Yet another fix to event propagation in scrolled windows.
Calling ProcessEventLocally() didn't work because the command events were not
propagated to the parent window any more, breaking a lot of things including
wxDataViewCtrl event generation in the generic version. So do restore
ProcessEvent() call but use it on the next handler (i.e. the window itself)
and not this one now. This still results in some duplicate calls but at least
the events should be passed everywhere where they are expected to arrive.

wxScrollHelperEvtHandler must die.

Closes #12078.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-21 12:07:45 +00:00
Vadim Zeitlin
ce45133ee7 Fix wxScrollHelperEvtHandler broken by recent changes to event processing.
Use ProcessEventLocally() added in r64261 (which was probably the one to break
this) to forward event to the window itself instead of ProcessEvent() in
wxScrollHelperEvtHandler::ProcessEvent() implementation. Calling ProcessEvent()
didn't work any more in a case when another event handler was pushed on a
wxScrolledWindow: in this case the EVT_SIZE and EVT_PAINT handlers defined in
the window itself were not called at all any more.

Add a unit test checking for the even more tortuous than usual event
processing path in this particular case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-20 17:33:26 +00:00
Francesco Montorsi
45cb70531f remove TestTimer() (adds nothing to existing tests) and move wxStopWatch tests to a new CppUnit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-16 15:44:17 +00:00
Vadim Zeitlin
6b8ef0b35d Merge SOC2009_FSWATCHER branch into trunk.
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.

Add wxFileSystemWatcher and related classes.

Also introduces wxEventLoopSource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:35:43 +00:00
Vadim Zeitlin
09be33645a fix errors in EvtHandlerTestCase::BindFunctor() in optimized build: apparently compiler is smart enough to detect that the same object can be used for all temporaries
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-17 10:56:14 +00:00
Vadim Zeitlin
ca6911c361 allow passing temporary functors to Bind() too (closes #10653)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-02 15:28:16 +00:00
Vadim Zeitlin
890d70ebea improvements to wxEventFunctor classes; use wxHAS_EVENT_BIND instead of wxEVENTS_COMPATIBILITY_2_8 (see #10653)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-02 12:52:54 +00:00
Vadim Zeitlin
48c56e04b0 added failing compilation test for the case of missing handler in Bind() call
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 21:33:37 +00:00
Vadim Zeitlin
449cb073c0 added a failtest target to Makefile to test for the (expected) compilation failures
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 14:47:22 +00:00